Documentation ¶
Overview ¶
Package parser parse and loads a cherry file to the memory. --
- Copyright (C) 2015 by Rafael Santiago *
- This is a free software. You can redistribute it and/or modify under
- the terms of the GNU General Public License version 2. *
Index ¶
- func GetNextSetFromData(data string, currLine int, tok string) ([]string, int, string)
- func StripBlanks(data string) string
- type CherryFileError
- func GetDataFromSection(section, configData string, currLine int, currFile string) (string, int, int, *CherryFileError)
- func GetRoomActions(roomName string, cherryRooms *config.CherryRooms, configData, filepath string) *CherryFileError
- func GetRoomImages(roomName string, cherryRooms *config.CherryRooms, configData, filepath string) *CherryFileError
- func GetRoomMisc(roomName string, cherryRooms *config.CherryRooms, configData, filepath string) *CherryFileError
- func GetRoomTemplates(roomName string, cherryRooms *config.CherryRooms, configData, filepath string) *CherryFileError
- func NewCherryFileError(src string, line int, msg string) *CherryFileError
- func ParseCherryFile(filepath string) (*config.CherryRooms, *CherryFileError)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetNextSetFromData ¶
GetNextSetFromData returns the next "field = value".
Types ¶
type CherryFileError ¶
type CherryFileError struct {
// contains filtered or unexported fields
}
CherryFileError is returned by any parse function implemented in "parser.go".
func GetDataFromSection ¶
func GetDataFromSection(section, configData string, currLine int, currFile string) (string, int, int, *CherryFileError)
GetDataFromSection returns the raw section data from a cherry file section data.
func GetRoomActions ¶
func GetRoomActions(roomName string, cherryRooms *config.CherryRooms, configData, filepath string) *CherryFileError
GetRoomActions parses "cherry.[roomName].actions" section.
func GetRoomImages ¶
func GetRoomImages(roomName string, cherryRooms *config.CherryRooms, configData, filepath string) *CherryFileError
GetRoomImages parses "cherry.[roomName].images" and "cherry.[roomName].images.url".
func GetRoomMisc ¶
func GetRoomMisc(roomName string, cherryRooms *config.CherryRooms, configData, filepath string) *CherryFileError
GetRoomMisc parses "cherry.[roomName].misc" section.
func GetRoomTemplates ¶
func GetRoomTemplates(roomName string, cherryRooms *config.CherryRooms, configData, filepath string) *CherryFileError
GetRoomTemplates parses "cherry.[roomName].templates" section.
func NewCherryFileError ¶
func NewCherryFileError(src string, line int, msg string) *CherryFileError
NewCherryFileError creates a *CherryFileError.
func ParseCherryFile ¶
func ParseCherryFile(filepath string) (*config.CherryRooms, *CherryFileError)
ParseCherryFile parses a file at @filepath and returns a *config.CherryRooms or a *CherryFileError.
func (*CherryFileError) Error ¶
func (c *CherryFileError) Error() string
Error spits the error string.