Source-highlight Library
|
represent a string for a language definition file's element More...
#include <stringdef.h>
Public Member Functions | |
StringDef (const std::string &s, const std::string &o) | |
constructs a StringDef and store also the original representation | |
StringDef (const std::string &s, bool doubleQuotes=false) | |
constructs a StringDef and record whether it comes from a double quoted string. | |
const std::string | toString () const |
return the string representation (after preprocessing) | |
const std::string | toStringOriginal () const |
return the original representation (without any preprocessing); this is useful for printing errors | |
bool | isDoubleQuoted () const |
whether this comes from a double quoted string | |
bool | hasBackRef () const |
void | setBackRef (bool b) |
Static Public Member Functions | |
static StringDef * | concat (const StringDef *s1, const StringDef *s2) |
Given two StringDef produces a new StringDef (keeping properties such as hasBackRef) | |
Private Attributes | |
std::string | stringdef |
the actual content | |
std::string | orig |
the original representation (without any preprocessing) | |
bool | doubleQuotedString |
whether the string was specified with double quotes | |
bool | hasBackRef_ |
whether this is contains a back reference to a matched subexpression |
represent a string for a language definition file's element
srchilite::StringDef::StringDef | ( | const std::string & | s, |
const std::string & | o | ||
) | [inline] |
constructs a StringDef and store also the original representation
s | the actual content |
o | the original representation |
srchilite::StringDef::StringDef | ( | const std::string & | s, |
bool | doubleQuotes = false |
||
) | [inline] |
constructs a StringDef and record whether it comes from a double quoted string.
s | the actual content |
doubleQuotes |
StringDef * srchilite::StringDef::concat | ( | const StringDef * | s1, |
const StringDef * | s2 | ||
) | [static] |
bool srchilite::StringDef::hasBackRef | ( | ) | const [inline] |
bool srchilite::StringDef::isDoubleQuoted | ( | ) | const [inline] |
whether this comes from a double quoted string
void srchilite::StringDef::setBackRef | ( | bool | b | ) | [inline] |
b |
const std::string srchilite::StringDef::toString | ( | ) | const |
return the string representation (after preprocessing)
const std::string srchilite::StringDef::toStringOriginal | ( | ) | const [inline] |
return the original representation (without any preprocessing); this is useful for printing errors