Documentation ¶
Overview ¶
Package linescanner provides functions to scan lines of property files.
Index ¶
Constants ¶
View Source
const ( // LUndefined denotes initial state, i.e. nothing has been parsed. LUndefined = 0 // LEmpty denotes empty line or a line with whitespace, only. LEmpty = 1 // LProperty denotes line with property. LProperty = 2 // LPropertyNext denotes line with property and continuation of property value on next line. LPropertyNext = 3 // LPropertyCont denotes line with continuation of property value from previous line. LPropertyCont = 4 // LPropertyContNext denotes line with continuation of property value from previous line and its continuation on next line. LPropertyContNext = 5 // LComment denotes comment line. LComment = 6 // LUnknownFormat denotes line with something that can not be interpreted. LUnknownFormat = 7 )
Line types.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LineScanner ¶
LineScanner holds line type and indices for property name and property value.
func (*LineScanner) PropertyName ¶
func (scanner *LineScanner) PropertyName(bytes, buffer []byte) []byte
PropertyName returns property name as string.
func (*LineScanner) PropertyValue ¶
func (scanner *LineScanner) PropertyValue(bytes, buffer []byte) []byte
PropertyValue returns property value as string.
func (*LineScanner) ScanLine ¶
func (scanner *LineScanner) ScanLine(bytes []byte, offset int) int
ScanLine processes one line searching for property name and property value. Result is written to LineScanner fields. Returns offset of next line.
func (*LineScanner) Set ¶
func (scanner *LineScanner) Set(lineType, propBegin, propEnd, valBegin, valEnd int)
Set assignes values to LineScanner fields.
Click to show internal directories.
Click to hide internal directories.