#include </home/gallen/repositories/libvariant/src/BundleHdrParser.h>
Public Member Functions | |
| BundleHdrParserImpl (shared_ptr< ParserInput > i) | |
| virtual int | Run () |
| unsigned | GetLine () const |
| virtual void | Reset () |
| virtual bool | Done () const |
| virtual bool | Error () const |
| virtual bool | Ok () const |
| virtual std::string | ErrorStr () const |
| Return a string describing the last error suitable for presentation to a user. | |
Public Member Functions inherited from libvariant::ParserImpl | |
| virtual void | PushAction (shared_ptr< ParserActions > action) |
| virtual shared_ptr< ParserActions > | PopAction () |
| ParserActions * | TopAction () |
Protected Types | |
| enum | State_t { START, BEGIN_MAP, KEY, VALUE, LIST, END_MAP, END, STOP } |
Protected Member Functions | |
| void | ReadLine () |
| void | RetireLine () |
| bool | ScanLine () |
Protected Attributes | |
| shared_ptr< ParserInput > | input |
| State_t | state |
| const char * | line |
| unsigned | line_len |
| std::vector< char > | key |
| std::vector< char > | value |
| std::deque< char * > | list |
| unsigned | line_num |
| std::string | errorstr |
Protected Attributes inherited from libvariant::ParserImpl | |
|
std::deque< shared_ptr < ParserActions > > | action_stack |
A simple parser for the Bundle header.
Maintanance programmer note: BundleParserImpl relies on a lot of the implementation details of this class.
|
virtual |
These three functiosn can be used to query the state later. Done means that a call to Process will immediately return 1 Error if Process threw an exception last Ok if everything looks good (Process never been called, or last return 0 or possibly -1)
Implements libvariant::ParserImpl.
|
virtual |
Resets the parser to the state it was in when just constructed.
Implements libvariant::ParserImpl.
|
virtual |
Attempt to parse some actions. At least one ParserActions should be on the action stack.
Run is not guaranteed to be recursively callable from inside a ParserActions callback. Do not do that.
return 0 on success return 1 when done return -1 if needing more data is detected (not all parsers support this; can be treated as an error) throw on error
Implements libvariant::ParserImpl.
1.8.7