24 #ifndef FAUDES_TOKEN_H
25 #define FAUDES_TOKEN_H
109 void SetString(
const std::string& rName);
117 void SetBegin(
const std::string& rName);
125 void SetEnd(
const std::string& rName);
133 void SetEmpty(
const std::string& rName);
141 void SetOption(
const std::string& rName);
149 void SetInteger(
const Int number);
157 void SetInteger16(
const Int number);
165 void SetBoolean(
const Int number);
186 void SetBinary(
const char* data, std::size_t len);
201 Int IntegerValue(
void)
const;
217 const std::string& StringValue(
void)
const;
225 const std::string& OptionValue(
void)
const;
234 const std::string& PreceedingSpace(
void)
const;
242 void PreceedingSpace(
const std::string& sep);
255 TokenType
Type(
void)
const;
263 bool IsNone(
void)
const;
271 bool IsInteger(
void)
const;
279 bool IsInteger16(
void)
const;
287 bool IsBoolean(
void)
const;
295 bool IsFloat(
void)
const;
303 bool IsOption(
void)
const;
311 bool IsString(
void)
const;
319 bool IsBinary(
void)
const;
327 bool IsCdata(
void)
const;
335 bool IsBegin(
void)
const;
345 bool IsBegin(
const std::string& tag)
const;
353 bool IsEnd(
void)
const;
363 bool IsEnd(
const std::string& tag)
const;
371 bool IsEmpty(
void)
const;
377 void ClearAttributes();
385 void ClrAttribute(
const std::string& name);
396 void InsAttribute(
const std::string& name,
const std::string& value);
407 void InsAttributeString(
const std::string& name,
const std::string& value);
418 void InsAttributeInteger(
const std::string& name,
Int value);
429 void InsAttributeInteger16(
const std::string& name,
Int value);
440 void InsAttributeBoolean(
const std::string& name,
Int value);
451 void InsAttributeFloat(
const std::string& name,
faudes::Float value);
461 bool ExistsAttributeString(
const std::string& name);
471 bool ExistsAttributeInteger(
const std::string& name);
481 bool ExistsAttributeFloat(
const std::string& name);
491 const std::string& AttributeStringValue(
const std::string& name);
501 Int AttributeIntegerValue(
const std::string& name);
527 int Read(std::istream* pStream,
bool fcomments=
true);
537 void Write(std::ostream* pStream)
const;
549 static void WriteBinary(std::ostream* pStream,
const char* pData, std::size_t len);
566 static void WriteVerbatim(std::ostream* pStream,
const std::string& rString,
bool lfflag=0);
581 static int WriteEscapedString(std::ostream* pStream,
const std::string& outstr);
598 static int ReadEscapedString(std::istream* pStream,
char stop, std::string& rString);
617 static int ReadCharacterData(std::istream* pStream, std::string& rString,
bool fcomments);
628 std::string Str(
void)
const;
669 typedef std::map<std::string, AttributeValue>::iterator
aiterator;
670 typedef std::map<std::string, AttributeValue>::const_iterator
caiterator;
676 bool InterpretNumber(
const std::string& numstr,
int& type,
Int& ival,
faudes::Float& fval);
679 bool InterpretNumber(
void);
693 void WriteString(std::ostream* pStream,
const std::string& delim)
const;
700 void WriteBinary(std::ostream* pStream)
const;
717 int ReadString(std::istream* pStream,
char stop);
728 int ReadAttributes(std::istream* pStream);
741 int ReadMarkup(std::istream* pStream);
752 int ReadBinary(std::istream* pStream);
765 int ReadSpace(std::istream* pStream,
bool fcomments=
true);
C-level utilities functions.
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)