Class: OsuRuby::Parser::RawFile

Inherits:
Base
  • Object
show all
Defined in:
(osu-ruby2 0.0.2) osu-ruby2/parser/content.rb

Overview

Implements basic ability to parse normal file.

Parser Core uses 4 functionality to work.

  • Reader, text file to machine variables conversion. Uses Section and Entry to help.

  • Writer, machine variables to text file. Make a use of Base#compile_contents and Section#to_s.

  • Transformer, passing machine variables to other machine variables potentially changing its internals. Simplified the usage through #sections

  • Converter, passes machine variables into Behavior specific container that accepts given variables. See Base#convert

Direct Known Subclasses

Beatmap::BasicParser

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#convert, load, #write

Constructor Details

#initializeRawFile

Returns a new instance of RawFile.

Instance Attribute Details

#sectionsArray<Section> (readonly)

Returns file sections.

Returns:

  • (Array<Section>)

    file sections.

Instance Method Details

#compile_contentsString

converts parsed data into osu! readable text file.

Returns:

  • (String)

    osu! text file compatible string.

#parse(io)

This method returns an undefined value.

parse given IO input to program editable contents

Parameters:

  • io (#read)

    Readable IO stream to parse

#parse_header(io)

This method returns an undefined value.

parse file header if any

Parameters:

  • io (#read)

    Readable IO stream to parse

#parse_sections(io)

This method returns an undefined value.

parse whole file string and populate the #sections variable.

Parameters:

  • io (#read)

    Readable IO stream to parse