23 #ifndef FAUDES_TOKEN_H
24 #define FAUDES_TOKEN_H
108 void SetString(
const std::string& rName);
116 void SetBegin(
const std::string& rName);
124 void SetEnd(
const std::string& rName);
132 void SetEmpty(
const std::string& rName);
140 void SetOption(
const std::string& rName);
148 void SetInteger(
const Int number);
156 void SetInteger16(
const Int number);
164 void SetBoolean(
const Int number);
185 void SetBinary(
const char* data, std::size_t len);
200 Int IntegerValue(
void)
const;
216 const std::string& StringValue(
void)
const;
224 const std::string& OptionValue(
void)
const;
233 const std::string& PreceedingSpace(
void)
const;
241 void PreceedingSpace(
const std::string& sep);
254 TokenType
Type(
void)
const;
262 bool IsNone(
void)
const;
270 bool IsInteger(
void)
const;
278 bool IsInteger16(
void)
const;
286 bool IsBoolean(
void)
const;
294 bool IsFloat(
void)
const;
302 bool IsOption(
void)
const;
310 bool IsString(
void)
const;
318 bool IsBinary(
void)
const;
326 bool IsCdata(
void)
const;
334 bool IsBegin(
void)
const;
344 bool IsBegin(
const std::string& tag)
const;
352 bool IsEnd(
void)
const;
362 bool IsEnd(
const std::string& tag)
const;
370 bool IsEmpty(
void)
const;
376 void ClearAttributes();
384 void ClrAttribute(
const std::string& name);
395 void InsAttribute(
const std::string& name,
const std::string& value);
406 void InsAttributeString(
const std::string& name,
const std::string& value);
417 void InsAttributeInteger(
const std::string& name,
Int value);
428 void InsAttributeInteger16(
const std::string& name,
Int value);
439 void InsAttributeBoolean(
const std::string& name,
Int value);
450 void InsAttributeFloat(
const std::string& name,
faudes::Float value);
460 bool ExistsAttributeString(
const std::string& name);
470 bool ExistsAttributeInteger(
const std::string& name);
480 bool ExistsAttributeFloat(
const std::string& name);
490 const std::string& AttributeStringValue(
const std::string& name);
500 Int AttributeIntegerValue(
const std::string& name);
526 int Read(std::istream* pStream,
bool fcomments=
true);
536 void Write(std::ostream* pStream)
const;
548 static void WriteBinary(std::ostream* pStream,
const char* pData, std::size_t len);
565 static void WriteVerbatim(std::ostream* pStream,
const std::string& rString,
bool lfflag=0);
580 static int WriteEscapedString(std::ostream* pStream,
const std::string& outstr);
597 static int ReadEscapedString(std::istream* pStream,
char stop, std::string& rString);
616 static int ReadCharacterData(std::istream* pStream, std::string& rString,
bool fcomments);
627 std::string Str(
void)
const;
668 typedef std::map<std::string, AttributeValue>::iterator
aiterator;
669 typedef std::map<std::string, AttributeValue>::const_iterator
caiterator;
675 bool InterpretNumber(
const std::string& numstr,
int& type,
Int& ival,
faudes::Float& fval);
678 bool InterpretNumber(
void);
692 void WriteString(std::ostream* pStream,
const std::string& delim)
const;
699 void WriteBinary(std::ostream* pStream)
const;
716 int ReadString(std::istream* pStream,
char stop);
727 int ReadAttributes(std::istream* pStream);
740 int ReadMarkup(std::istream* pStream);
751 int ReadBinary(std::istream* pStream);
764 int ReadSpace(std::istream* pStream,
bool fcomments=
true);
A TokenReader reads sequential tokens from a file or string.
A TokenWriter writes sequential tokens to a file, a string or stdout.
faudes::Float mFloatValue
Tokens model atomic data for stream IO.
std::map< std::string, AttributeValue >::iterator aiterator
Convenience typedef.
Int mIntegerValue
Token integer value (if Token is of type Integer or Integer16)
faudes::Float mFloatValue
Token float value (if Token is of type Float or Integer)
std::string mOptionValue
Token std::string value (if token is of type Option)
std::map< std::string, AttributeValue >::const_iterator caiterator
int mAttributeCount
Attribute sort index (for nice output only)
std::map< std::string, AttributeValue > mAttributes
Attribute value map.
std::string mPreceedingSpace
Preceeding space (cosmetic)
std::string mStringValue
Token std::string value (for any token type)
Base class of all libFAUDES objects that participate in the run-time interface.
libFAUDES resides within the namespace faudes.
double Float
Type definition for real type.
long int Int
Type definition for integer type (let target system decide, minimum 32bit)