#include <dolphin.h>
Public Types | |
enum | ErrorType |
enum | DirectiveType { ARGUMENT = 3000, ATTRIB_VALUE, EMPTY, NONE } |
Public Member Functions | |
Dolphin (void) | |
virtual | ~Dolphin (void) |
bool | parse (std::string &str) |
Dolphin::ErrorInfo | getErrorInfo (void) |
DirectiveType | getDirectiveType (void) |
std::string | getDirectiveName (void) |
std::string | getArgumentValue (void) |
seal::LinkedList < AttributeValuePair > | getAttributeValuePairList (void) |
Static Public Member Functions | |
static bool | isDot (const std::string &str) |
Classes | |
class | ErrorInfo |
enum Dolphin::ErrorType |
An enumerated data type which enumerates the different types of errors which can occur while parsing a 'dot' directive. A client of the Dolphin class should practically not need to make use of this data type.
Type of the directive which was parsed by a Dolphin object.
ARGUMENT |
An example of this type of directive is as follows: .include "file.h" In the above example .include is a dot directive which takes a single argument "file.h". |
ATTRIB_VALUE |
This type of 'dot' directive takes a space seperated list of attribute value pairs. An example is as follows. .student name=jim grade=senior dob="05/06/07" |
EMPTY |
This type of 'dot' directive does not take any argument. An example is follows. .code |
NONE | This is the type returned by Dolphin::getDirectiveType if there was an error in parsing. |
Dolphin::Dolphin | ( | void | ) |
Constructor.
virtual Dolphin::~Dolphin | ( | void | ) | [virtual] |
Destructor.
bool Dolphin::parse | ( | std::string & | str | ) |
Parses a string. Reports error if it is not a 'dot' directive. Returns false if there is an error in parsing, true otherwise.
str | The string to be parsed. |
Dolphin::ErrorInfo Dolphin::getErrorInfo | ( | void | ) |
Returns the error info of an error which might have occured during a call to Dolphin::parse. The returned value is meaningful only in case an error occurs with a call to Dolphin::parse.
DirectiveType Dolphin::getDirectiveType | ( | void | ) | [inline] |
Returns the directive type of the parsed directive.
std::string Dolphin::getDirectiveName | ( | void | ) | [inline] |
Returns the directive name of the parsed directive.
std::string Dolphin::getArgumentValue | ( | void | ) | [inline] |
Returns the argument value in case of directives of type Dolphin::ARGUMENT.
seal::LinkedList<AttributeValuePair> Dolphin::getAttributeValuePairList | ( | void | ) | [inline] |
Returns the list of attribute value pairs in case of an attribute-value pair directive.
static bool Dolphin::isDot | ( | const std::string & | str | ) | [static] |
Returns true if the string argument is a dot directive. Note that the string is not parsed.
str | The test string. |