Documentation
¶
Overview ¶
The configuration files parser.
Grammar:
File ::= AnonymousSection NamedSection* AnonymousSection ::= Section NamedSection ::= '[' Key ']' /.*/ '\n' Section Section ::= (Key /[[:space:]]/* '=' /[[:space:]]/* Value '\n')* Key ::= /[0-9A-Za-z_.]/ Value ::= /.*/
Index ¶
- type File
- type FileContent
- func (self *FileContent) Back() error
- func (self *FileContent) Current() (result rune, err error)
- func (self *FileContent) Debug() (result string)
- func (self *FileContent) IsValid() bool
- func (self *FileContent) Next() error
- func (self *FileContent) SkipBlanks() (result string, err error)
- func (self *FileContent) SkipSymbol(symbol string) (result string, err error)
- func (self *FileContent) SkipToEndOfLine() (result string, err error)
- func (self *FileContent) SkipUntil(stop func(rune, int) bool) (result string, err error)
- func (self *FileContent) SkipWord() (result string, err error)
- type Section
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileContent ¶
type FileContent struct {
// contains filtered or unexported fields
}
The content of a file.
func ReadFile ¶
func ReadFile(in io.Reader) (result *FileContent)
Reads all the data (until EOF) and returns it into a file content object.
func (*FileContent) Back ¶
func (self *FileContent) Back() error
Go to the previous character, if possible.
func (*FileContent) Current ¶
func (self *FileContent) Current() (result rune, err error)
The current character.
func (*FileContent) Debug ¶
func (self *FileContent) Debug() (result string)
A technical representation of the file content.
func (*FileContent) IsValid ¶
func (self *FileContent) IsValid() bool
True if the current character offset is valid.
func (*FileContent) Next ¶
func (self *FileContent) Next() error
Go to the next character, if possible.
func (*FileContent) SkipBlanks ¶
func (self *FileContent) SkipBlanks() (result string, err error)
Skip spaces.
func (*FileContent) SkipSymbol ¶
func (self *FileContent) SkipSymbol(symbol string) (result string, err error)
Skip the given symbol.
func (*FileContent) SkipToEndOfLine ¶
func (self *FileContent) SkipToEndOfLine() (result string, err error)
Skip to the end of the line.
func (*FileContent) SkipUntil ¶
Skip characters until the given function returns true; and returns the skipped characters. The current character offset is updated accordingly.
func (*FileContent) SkipWord ¶
func (self *FileContent) SkipWord() (result string, err error)
Skip a word.
Click to show internal directories.
Click to hide internal directories.