Documentation ¶
Overview ¶
package asciiscan is used to parse plaintext files into structured data
Index ¶
- func ConsumeProperty(s string) (string, string)
- func IsProperty(s string) bool
- type Scanner
- func (s *Scanner) Bufio() *bufio.Scanner
- func (s *Scanner) Close() error
- func (s *Scanner) ConsumeBool() (bool, error)
- func (s *Scanner) ConsumeBoolPtr(to *bool) error
- func (s *Scanner) ConsumeBoolPtrs(ptrs ...*bool) error
- func (s *Scanner) ConsumeInt() (int, error)
- func (s *Scanner) ConsumeIntPtr(to *int) error
- func (s *Scanner) ConsumeIntPtrs(ptrs ...*int) error
- func (s *Scanner) ConsumeProperty() (string, string, error)
- func (s *Scanner) ConsumeString() (string, error)
- func (s *Scanner) ConsumeStringList(skip ...string) ([]string, error)
- func (s *Scanner) PeekProperty() (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConsumeProperty ¶
It's common for properties to be specified as "foo : bar". Parse them out.
func IsProperty ¶
Check to see if the line looks like a property (contains a colon character).
Types ¶
type Scanner ¶
type Scanner struct {
// contains filtered or unexported fields
}
func (*Scanner) ConsumeBool ¶
func (*Scanner) ConsumeBoolPtr ¶
func (*Scanner) ConsumeBoolPtrs ¶
func (*Scanner) ConsumeInt ¶
func (*Scanner) ConsumeIntPtr ¶
func (*Scanner) ConsumeIntPtrs ¶
func (*Scanner) ConsumeString ¶
func (*Scanner) ConsumeStringList ¶
Reads a list of non-property lines, skipping any that match the given strings
func (*Scanner) PeekProperty ¶
Checks if the next line might be a property, without reading it
Click to show internal directories.
Click to hide internal directories.