Detailed Description

Tokens model atomic data for stream IO.

A Token models a string or numeric datum that can be read from a or written to a C++ stream. The class itself implements the representation of the data including its type and parsing from/to C++ streams. For section handling see TokenReader and TokenWriter.

There is no one-to-one correspondence between elementary faudes data types like string or index with a particlular representation. The class Token therefore takes a relaxed approach and indicates possible interpretations when reading from a stream and requiering specific directions when writing.

See TokenType for a list of supported formats/interpretations.

Definition at line 53 of file cfl_token.h.

#include <cfl_token.h>

Classes

class  AttributeValue
 Attribute value. More...
 

Public Types

enum  TokenType {
  None = 0x000 , Begin = 0x001 , End = 0x002 , String = 0x004 ,
  Option = 0x008 , Integer = 0x010 , Integer16 =0x020 , Boolean = 0x040 ,
  Float = 0x080 , Binary = 0x100 , Cdata = 0x200
}
 Token types: More...
 

Public Member Functions

 Token (void)
 Empty constructor, constructs None token. More...
 
 Token (const Token &rToken)
 Copy constructor. More...
 
 ~Token (void)
 Token destructor. More...
 
Tokenoperator= (const Token &rOther)
 Assignment operator. More...
 
void SetNone (void)
 Initialize None token. More...
 
void SetString (const std::string &rName)
 Initialize as String token. More...
 
void SetBegin (const std::string &rName)
 Initialize as Begin token. More...
 
void SetEnd (const std::string &rName)
 Initialize as End token. More...
 
void SetEmpty (const std::string &rName)
 Initialize as empty-tag token. More...
 
void SetOption (const std::string &rName)
 Initialize as Option token. More...
 
void SetInteger (const Int number)
 Initialize as Integer token. More...
 
void SetInteger16 (const Int number)
 Initialize as Integer16 token. More...
 
void SetBoolean (const Int number)
 Initialize as Boolean token. More...
 
void SetFloat (const faudes::Float number)
 Initialize as Float token. More...
 
void SetBinary (const char *data, std::size_t len)
 Initialize Binary token. More...
 
void ClrEnd (void)
 Clear End type (resolve empty section) More...
 
Int IntegerValue (void) const
 Get integer value of a numeric token. More...
 
faudes::Float FloatValue (void) const
 Get float value of a numeric token. More...
 
const std::string & StringValue (void) const
 Get string value of a name token. More...
 
const std::string & OptionValue (void) const
 Get option value of a name token. More...
 
const std::string & PreceedingSpace (void) const
 Preceeding space when writing to stream. More...
 
void PreceedingSpace (const std::string &sep)
 Preceeding space when writing to stream. More...
 
TokenType Type (void) const
 Get token Type. More...
 
bool IsNone (void) const
 Test token Type. More...
 
bool IsInteger (void) const
 Test token Type. More...
 
bool IsInteger16 (void) const
 Test token Type. More...
 
bool IsBoolean (void) const
 Test token Type. More...
 
bool IsFloat (void) const
 Test token Type. More...
 
bool IsOption (void) const
 Test token Type. More...
 
bool IsString (void) const
 Test token Type. More...
 
bool IsBinary (void) const
 Test token Type. More...
 
bool IsCdata (void) const
 Test token Type. More...
 
bool IsBegin (void) const
 Test token Type. More...
 
bool IsBegin (const std::string &tag) const
 Test token Type. More...
 
bool IsEnd (void) const
 Test token Type. More...
 
bool IsEnd (const std::string &tag) const
 Test token Type. More...
 
bool IsEmpty (void) const
 Test token Type. More...
 
void ClearAttributes ()
 Clear all attributes. More...
 
void ClrAttribute (const std::string &name)
 Clear attribute. More...
 
void InsAttribute (const std::string &name, const std::string &value)
 Insert named attribute, no type. More...
 
void InsAttributeString (const std::string &name, const std::string &value)
 Insert named attribute with string value. More...
 
void InsAttributeInteger (const std::string &name, Int value)
 Insert named attribute with integer value. More...
 
void InsAttributeInteger16 (const std::string &name, Int value)
 Insert named attribute with integer value. More...
 
void InsAttributeBoolean (const std::string &name, Int value)
 Insert named attribute with boolean value. More...
 
void InsAttributeFloat (const std::string &name, faudes::Float value)
 Insert named attribute with integer value. More...
 
bool ExistsAttributeString (const std::string &name)
 Test attibute existence. More...
 
bool ExistsAttributeInteger (const std::string &name)
 Test attibute existence. More...
 
bool ExistsAttributeFloat (const std::string &name)
 Test attibute existence. More...
 
const std::string & AttributeStringValue (const std::string &name)
 Access attribute value. More...
 
Int AttributeIntegerValue (const std::string &name)
 Access attribute value. More...
 
faudes::Float AttributeFloatValue (const std::string &name)
 Access attribute value. More...
 
int Read (std::istream *pStream, bool fcomments=true)
 Read Token from input stream. More...
 
void Write (std::ostream *pStream) const
 Write Token to output stream. More...
 
std::string Str (void) const
 Pretty print string representation. More...
 

Static Public Member Functions

static void WriteBinary (std::ostream *pStream, const char *pData, std::size_t len)
 Write specified binary data as base64 string to output stream. More...
 
static void WriteVerbatim (std::ostream *pStream, const std::string &rString, bool lfflag=0)
 Write a std::string value to an output stream. More...
 
static int WriteEscapedString (std::ostream *pStream, const std::string &outstr)
 Write a std::string value to an output stream. More...
 
static int ReadEscapedString (std::istream *pStream, char stop, std::string &rString)
 Read a std::string value from an input file stream. More...
 
static int ReadCharacterData (std::istream *pStream, std::string &rString, bool fcomments)
 Read chracter data from an input file stream. More...
 

Private Types

typedef std::map< std::string, AttributeValue >::iterator aiterator
 Convenience typedef. More...
 
typedef std::map< std::string, AttributeValue >::const_iterator caiterator
 

Private Member Functions

void InterpretAttribute (aiterator ait)
 Interpret attribute value from string. More...
 
bool InterpretNumber (const std::string &numstr, int &type, Int &ival, faudes::Float &fval)
 Interpret string a s number. More...
 
bool InterpretNumber (void)
 Interpret string a s number. More...
 
void WriteString (std::ostream *pStream, const std::string &delim) const
 Write a std::string value to an output stream. More...
 
void WriteBinary (std::ostream *pStream) const
 Write my binary data as base64 string to output stream. More...
 
int ReadString (std::istream *pStream, char stop)
 Read a std::string value from an input file stream. More...
 
int ReadAttributes (std::istream *pStream)
 Read and interpret attribute definitions of begin tags from an input file stream. More...
 
int ReadMarkup (std::istream *pStream)
 Read and interpret markup an input file stream. More...
 
int ReadBinary (std::istream *pStream)
 Read a base64 binary string from an input file stream. More...
 
int ReadSpace (std::istream *pStream, bool fcomments=true)
 Read (ignore) spaces on input file stream. More...
 

Private Attributes

int mType
 Token type. More...
 
std::string mStringValue
 Token std::string value (for any token type) More...
 
std::string mOptionValue
 Token std::string value (if token is of type Option) More...
 
Int mIntegerValue
 Token integer value (if Token is of type Integer or Integer16) More...
 
faudes::Float mFloatValue
 Token float value (if Token is of type Float or Integer) More...
 
std::string mPreceedingSpace
 Preceeding space (cosmetic) More...
 
std::map< std::string, AttributeValuemAttributes
 Attribute value map. More...
 
int mAttributeCount
 Attribute sort index (for nice output only) More...
 

Friends

class TokenWriter
 
class TokenReader
 

Member Typedef Documentation

◆ aiterator

typedef std::map<std::string, AttributeValue>::iterator faudes::Token::aiterator
private

Convenience typedef.

Definition at line 668 of file cfl_token.h.

◆ caiterator

typedef std::map<std::string, AttributeValue>::const_iterator faudes::Token::caiterator
private

Definition at line 669 of file cfl_token.h.

Member Enumeration Documentation

◆ TokenType

Token types:

Enumerator
None 

Invalid/empty token

Begin 

<label> (begin of section)

End 

<\label> (end of section)

String 

any string, space separated or quoted, must start with a letter

Option 

+xyZ+ (option string, may not contain a "+")

Integer 

1234 (non-negative integer)

Integer16 

0x12fff ("0x" makes an integer an Integer16)

Boolean 

True/False

Float 

-12.34 ("-" or "." turns an integer to a float)

Binary 

=ABhlkjj= (base64 encoded binary data)

Cdata 

... verbatim markup

Definition at line 81 of file cfl_token.h.

Constructor & Destructor Documentation

◆ Token() [1/2]

faudes::Token::Token ( void  )

Empty constructor, constructs None token.

Definition at line 29 of file cfl_token.cpp.

◆ Token() [2/2]

faudes::Token::Token ( const Token rToken)

Copy constructor.

Definition at line 41 of file cfl_token.cpp.

◆ ~Token()

faudes::Token::~Token ( void  )

Token destructor.

Definition at line 68 of file cfl_token.cpp.

Member Function Documentation

◆ AttributeFloatValue()

faudes::Float faudes::Token::AttributeFloatValue ( const std::string &  name)

Access attribute value.

Parameters
nameAttribute name
Returns
String value of specified attribute

Definition at line 406 of file cfl_token.cpp.

◆ AttributeIntegerValue()

Int faudes::Token::AttributeIntegerValue ( const std::string &  name)

Access attribute value.

Parameters
nameAttribute name
Returns
Integer value of specified attribute (return 0 if it does not exist)

Definition at line 396 of file cfl_token.cpp.

◆ AttributeStringValue()

const std::string & faudes::Token::AttributeStringValue ( const std::string &  name)

Access attribute value.

Parameters
nameAttribute name
Returns
String value of specified attribute

Definition at line 385 of file cfl_token.cpp.

◆ ClearAttributes()

void faudes::Token::ClearAttributes ( void  )

Clear all attributes.

Definition at line 292 of file cfl_token.cpp.

◆ ClrAttribute()

void faudes::Token::ClrAttribute ( const std::string &  name)

Clear attribute.

Parameters
nameAttribute name

Definition at line 285 of file cfl_token.cpp.

◆ ClrEnd()

void faudes::Token::ClrEnd ( void  )

Clear End type (resolve empty section)

Definition at line 160 of file cfl_token.cpp.

◆ ExistsAttributeFloat()

bool faudes::Token::ExistsAttributeFloat ( const std::string &  name)

Test attibute existence.

Parameters
nameAttribute name
Returns
True is attribute exists and matches type.

Definition at line 375 of file cfl_token.cpp.

◆ ExistsAttributeInteger()

bool faudes::Token::ExistsAttributeInteger ( const std::string &  name)

Test attibute existence.

Parameters
nameAttribute name
Returns
True is attribute exists and matches type.

Definition at line 365 of file cfl_token.cpp.

◆ ExistsAttributeString()

bool faudes::Token::ExistsAttributeString ( const std::string &  name)

Test attibute existence.

Parameters
nameAttribute name
Returns
True is attribute exists and matches type.

Definition at line 355 of file cfl_token.cpp.

◆ FloatValue()

faudes::Float faudes::Token::FloatValue ( void  ) const

Get float value of a numeric token.

Returns
Token float value

Definition at line 172 of file cfl_token.cpp.

◆ InsAttribute()

void faudes::Token::InsAttribute ( const std::string &  name,
const std::string &  value 
)

Insert named attribute, no type.

Note: only begin tags can have attributes.

Parameters
nameAttribute name
valueAttribute value

Definition at line 299 of file cfl_token.cpp.

◆ InsAttributeBoolean()

void faudes::Token::InsAttributeBoolean ( const std::string &  name,
Int  value 
)

Insert named attribute with boolean value.

Note: only begin tags can have attributes.

Parameters
nameAttribute name
valueAttribute value

Definition at line 336 of file cfl_token.cpp.

◆ InsAttributeFloat()

void faudes::Token::InsAttributeFloat ( const std::string &  name,
faudes::Float  value 
)

Insert named attribute with integer value.

Note: only begin tags can have attributes.

Parameters
nameAttribute name
valueAttribute value

Definition at line 346 of file cfl_token.cpp.

◆ InsAttributeInteger()

void faudes::Token::InsAttributeInteger ( const std::string &  name,
Int  value 
)

Insert named attribute with integer value.

Note: only begin tags can have attributes.

Parameters
nameAttribute name
valueAttribute value

Definition at line 318 of file cfl_token.cpp.

◆ InsAttributeInteger16()

void faudes::Token::InsAttributeInteger16 ( const std::string &  name,
Int  value 
)

Insert named attribute with integer value.

Note: only begin tags can have attributes.

Parameters
nameAttribute name
valueAttribute value

Definition at line 327 of file cfl_token.cpp.

◆ InsAttributeString()

void faudes::Token::InsAttributeString ( const std::string &  name,
const std::string &  value 
)

Insert named attribute with string value.

Note: only begin tags can have attributes.

Parameters
nameAttribute name
valueAttribute value

Definition at line 309 of file cfl_token.cpp.

◆ IntegerValue()

Int faudes::Token::IntegerValue ( void  ) const

Get integer value of a numeric token.

Returns
Token's integer value

Definition at line 166 of file cfl_token.cpp.

◆ InterpretAttribute()

void faudes::Token::InterpretAttribute ( aiterator  ait)
private

Interpret attribute value from string.

Definition at line 644 of file cfl_token.cpp.

◆ InterpretNumber() [1/2]

bool faudes::Token::InterpretNumber ( const std::string &  numstr,
int &  type,
Int ival,
faudes::Float fval 
)
private

Interpret string a s number.

Definition at line 658 of file cfl_token.cpp.

◆ InterpretNumber() [2/2]

bool faudes::Token::InterpretNumber ( void  )
private

Interpret string a s number.

Definition at line 653 of file cfl_token.cpp.

◆ IsBegin() [1/2]

bool faudes::Token::IsBegin ( const std::string &  tag) const

Test token Type.

Parameters
tagSection tag to test for
Returns
True on match

Definition at line 263 of file cfl_token.cpp.

◆ IsBegin() [2/2]

bool faudes::Token::IsBegin ( void  ) const

Test token Type.

Returns
True on match

Definition at line 258 of file cfl_token.cpp.

◆ IsBinary()

bool faudes::Token::IsBinary ( void  ) const

Test token Type.

Returns
True on match

Definition at line 248 of file cfl_token.cpp.

◆ IsBoolean()

bool faudes::Token::IsBoolean ( void  ) const

Test token Type.

Returns
True on match

Definition at line 228 of file cfl_token.cpp.

◆ IsCdata()

bool faudes::Token::IsCdata ( void  ) const

Test token Type.

Returns
True on match

Definition at line 253 of file cfl_token.cpp.

◆ IsEmpty()

bool faudes::Token::IsEmpty ( void  ) const

Test token Type.

Returns
True on match

Definition at line 280 of file cfl_token.cpp.

◆ IsEnd() [1/2]

bool faudes::Token::IsEnd ( const std::string &  tag) const

Test token Type.

Parameters
tagSection tag to test for
Returns
True on match

Definition at line 274 of file cfl_token.cpp.

◆ IsEnd() [2/2]

bool faudes::Token::IsEnd ( void  ) const

Test token Type.

Returns
True on match

Definition at line 269 of file cfl_token.cpp.

◆ IsFloat()

bool faudes::Token::IsFloat ( void  ) const

Test token Type.

Returns
True on match

Definition at line 233 of file cfl_token.cpp.

◆ IsInteger()

bool faudes::Token::IsInteger ( void  ) const

Test token Type.

Returns
True on match

Definition at line 218 of file cfl_token.cpp.

◆ IsInteger16()

bool faudes::Token::IsInteger16 ( void  ) const

Test token Type.

Returns
True on match

Definition at line 223 of file cfl_token.cpp.

◆ IsNone()

bool faudes::Token::IsNone ( void  ) const

Test token Type.

Returns
True on match

Definition at line 213 of file cfl_token.cpp.

◆ IsOption()

bool faudes::Token::IsOption ( void  ) const

Test token Type.

Returns
True on match

Definition at line 238 of file cfl_token.cpp.

◆ IsString()

bool faudes::Token::IsString ( void  ) const

Test token Type.

Returns
True on match

Definition at line 243 of file cfl_token.cpp.

◆ operator=()

Token & faudes::Token::operator= ( const Token rOther)

Assignment operator.

Definition at line 55 of file cfl_token.cpp.

◆ OptionValue()

const std::string & faudes::Token::OptionValue ( void  ) const

Get option value of a name token.

Returns
Token's option value

Definition at line 183 of file cfl_token.cpp.

◆ PreceedingSpace() [1/2]

void faudes::Token::PreceedingSpace ( const std::string &  sep)

Preceeding space when writing to stream.

Parameters
sepset new value

Definition at line 193 of file cfl_token.cpp.

◆ PreceedingSpace() [2/2]

const std::string & faudes::Token::PreceedingSpace ( void  ) const

Preceeding space when writing to stream.

Returns
preceeding string

Definition at line 188 of file cfl_token.cpp.

◆ Read()

int faudes::Token::Read ( std::istream *  pStream,
bool  fcomments = true 
)

Read Token from input stream.

Parameters
pStreamPointer to std::ifstream
fcommentswhen true, faudes comments are skipped
Exceptions
Exception
  • ios exceptions (eg file io error)
Returns
line count

Definition at line 1205 of file cfl_token.cpp.

◆ ReadAttributes()

int faudes::Token::ReadAttributes ( std::istream *  pStream)
private

Read and interpret attribute definitions of begin tags from an input file stream.

Parameters
pStreamReference to std::istream
Returns
Line count or -1 for error

Definition at line 957 of file cfl_token.cpp.

◆ ReadBinary()

int faudes::Token::ReadBinary ( std::istream *  pStream)
private

Read a base64 binary string from an input file stream.

Parameters
pStreamReference to std::istream
Returns
Line count or -1 for error

Definition at line 513 of file cfl_token.cpp.

◆ ReadCharacterData()

int faudes::Token::ReadCharacterData ( std::istream *  pStream,
std::string &  rString,
bool  fcomments 
)
static

Read chracter data from an input file stream.

Reads the stream until the next "<" character. The plain character data is returned, no entities re-substituted.

If fcomments is set, faudes-comments are ignored.

Parameters
pStreamReference to std::istream
rStringReference to result.
fcommentswhen true, faudes comments are skipped
Returns
Line count or -1 for error

Definition at line 918 of file cfl_token.cpp.

◆ ReadEscapedString()

int faudes::Token::ReadEscapedString ( std::istream *  pStream,
char  stop,
std::string &  rString 
)
static

Read a std::string value from an input file stream.

Read an XML escaped string until excluding the specified stop character.

Parameters
pStreamReference to std::istream
stopStop character
rStringReference to result.
Returns
Line count or -1 for error

Definition at line 857 of file cfl_token.cpp.

◆ ReadMarkup()

int faudes::Token::ReadMarkup ( std::istream *  pStream)
private

Read and interpret markup an input file stream.

This method will identify begin and end tags. Any other XML markup is meant to be gracefully ignored.

Parameters
pStreamReference to std::istream
Returns
Line count or -1 for error

Definition at line 1040 of file cfl_token.cpp.

◆ ReadSpace()

int faudes::Token::ReadSpace ( std::istream *  pStream,
bool  fcomments = true 
)
private

Read (ignore) spaces on input file stream.

Parameters
pStreamReference to std::istream
fcommentswhen true, read space swallows fcomments
Returns
Number of lines read

Definition at line 589 of file cfl_token.cpp.

◆ ReadString()

int faudes::Token::ReadString ( std::istream *  pStream,
char  stop 
)
private

Read a std::string value from an input file stream.

This method assumes that the string was written in the format of WriteString, i.e. either enclosed by single stop characters or with a trailing space as stop character. For practical reasons, it is assumed that the first stop character has been allready read.

Parameters
pStreamReference to std::istream
stopStop character
Returns
Line count or -1 for error

Definition at line 851 of file cfl_token.cpp.

◆ SetBegin()

void faudes::Token::SetBegin ( const std::string &  rName)

Initialize as Begin token.

Parameters
rNameTitle of section to fill the Token

Definition at line 91 of file cfl_token.cpp.

◆ SetBinary()

void faudes::Token::SetBinary ( const char *  data,
std::size_t  len 
)

Initialize Binary token.

This method allocates a copy of the data. For writing only, you may use the TokenWriter interface to avoid the local copy.

Parameters
dataReference to raw data record
lenNumber of bytes in record

Definition at line 152 of file cfl_token.cpp.

◆ SetBoolean()

void faudes::Token::SetBoolean ( const Int  number)

Initialize as Boolean token.

Parameters
numberNumber to fill the Token

Definition at line 136 of file cfl_token.cpp.

◆ SetEmpty()

void faudes::Token::SetEmpty ( const std::string &  rName)

Initialize as empty-tag token.

Parameters
rNameTitle of section to fill the Token

Definition at line 105 of file cfl_token.cpp.

◆ SetEnd()

void faudes::Token::SetEnd ( const std::string &  rName)

Initialize as End token.

Parameters
rNameTitle of section to fill the Token

Definition at line 98 of file cfl_token.cpp.

◆ SetFloat()

void faudes::Token::SetFloat ( const faudes::Float  number)

Initialize as Float token.

Parameters
numberNumber to fill the Token

Definition at line 144 of file cfl_token.cpp.

◆ SetInteger()

void faudes::Token::SetInteger ( const Int  number)

Initialize as Integer token.

Parameters
numberNumber to fill the Token

Definition at line 120 of file cfl_token.cpp.

◆ SetInteger16()

void faudes::Token::SetInteger16 ( const Int  number)

Initialize as Integer16 token.

Parameters
numberNumber to fill the Token

Definition at line 128 of file cfl_token.cpp.

◆ SetNone()

void faudes::Token::SetNone ( void  )

Initialize None token.

Definition at line 72 of file cfl_token.cpp.

◆ SetOption()

void faudes::Token::SetOption ( const std::string &  rName)

Initialize as Option token.

Parameters
rNameOption to fill the Token

Definition at line 112 of file cfl_token.cpp.

◆ SetString()

void faudes::Token::SetString ( const std::string &  rName)

Initialize as String token.

Parameters
rNameString to fill the Token

Definition at line 84 of file cfl_token.cpp.

◆ Str()

std::string faudes::Token::Str ( void  ) const

Pretty print string representation.

Convenience functio for inspection/debugging

Returns
Printable string representation

Definition at line 1296 of file cfl_token.cpp.

◆ StringValue()

const std::string & faudes::Token::StringValue ( void  ) const

Get string value of a name token.

Returns
Token's string value

Definition at line 177 of file cfl_token.cpp.

◆ Type()

Token::TokenType faudes::Token::Type ( void  ) const

Get token Type.

This method is for backward compatibility only. It returns a token type with only one bit set to indicate the type as in libfaudes up to version 2.17. To test for possible token interpretations, use the 2.17 interface IsInteger(), IsString() etc.

Returns
Type of token

Definition at line 198 of file cfl_token.cpp.

◆ Write()

void faudes::Token::Write ( std::ostream *  pStream) const

Write Token to output stream.

Parameters
pStreamPointer to ostream
Exceptions
Exception
  • ios exceptions (eg file io error,)

Definition at line 749 of file cfl_token.cpp.

◆ WriteBinary() [1/2]

void faudes::Token::WriteBinary ( std::ostream *  pStream) const
private

Write my binary data as base64 string to output stream.

Parameters
pStreamReference to std::ostream

Definition at line 506 of file cfl_token.cpp.

◆ WriteBinary() [2/2]

void faudes::Token::WriteBinary ( std::ostream *  pStream,
const char *  pData,
std::size_t  len 
)
static

Write specified binary data as base64 string to output stream.

Parameters
pStreamReference to std::ostream
lenNumber of bytes to write
pDataData to write

Definition at line 445 of file cfl_token.cpp.

◆ WriteEscapedString()

int faudes::Token::WriteEscapedString ( std::ostream *  pStream,
const std::string &  outstr 
)
static

Write a std::string value to an output stream.

This method replace critical characters by their XML entities and streams the resulting string. No whitespace etc added.

Parameters
pStreamReference to std::ostream
outstrString to stream
Returns
Number of characters written.

Definition at line 812 of file cfl_token.cpp.

◆ WriteString()

void faudes::Token::WriteString ( std::ostream *  pStream,
const std::string &  delim 
) const
private

Write a std::string value to an output stream.

This method writes the string enclosed by a the specified delimiter, typically '"' or ' '. Relevant XML entities are replaced by references, e.g. &lt; && etc. A single white space is added as a sepqrqtor.

Parameters
pStreamReference to std::ostream
delimDelimiter

Definition at line 838 of file cfl_token.cpp.

◆ WriteVerbatim()

void faudes::Token::WriteVerbatim ( std::ostream *  pStream,
const std::string &  rString,
bool  lfflag = 0 
)
static

Write a std::string value to an output stream.

This method writes a string as verbatim character data using the markup "<[!CDATA[ ... ]]> i.e. incl all control characters. The flag is used to insert extra formating at the begin and the end of the markup.

Parameters
pStreamReference to std::ostream
rStringString to write
lfflagadd extra linefeeds etc

Definition at line 416 of file cfl_token.cpp.

Friends And Related Function Documentation

◆ TokenReader

friend class TokenReader
friend

Definition at line 57 of file cfl_token.h.

◆ TokenWriter

friend class TokenWriter
friend

Definition at line 56 of file cfl_token.h.

Member Data Documentation

◆ mAttributeCount

int faudes::Token::mAttributeCount
private

Attribute sort index (for nice output only)

Definition at line 665 of file cfl_token.h.

◆ mAttributes

std::map<std::string, AttributeValue> faudes::Token::mAttributes
private

Attribute value map.

Definition at line 662 of file cfl_token.h.

◆ mFloatValue

faudes::Float faudes::Token::mFloatValue
private

Token float value (if Token is of type Float or Integer)

Definition at line 645 of file cfl_token.h.

◆ mIntegerValue

Int faudes::Token::mIntegerValue
private

Token integer value (if Token is of type Integer or Integer16)

Definition at line 642 of file cfl_token.h.

◆ mOptionValue

std::string faudes::Token::mOptionValue
private

Token std::string value (if token is of type Option)

Definition at line 639 of file cfl_token.h.

◆ mPreceedingSpace

std::string faudes::Token::mPreceedingSpace
private

Preceeding space (cosmetic)

Definition at line 648 of file cfl_token.h.

◆ mStringValue

std::string faudes::Token::mStringValue
private

Token std::string value (for any token type)

Definition at line 636 of file cfl_token.h.

◆ mType

int faudes::Token::mType
private

Token type.

Definition at line 633 of file cfl_token.h.


The documentation for this class was generated from the following files:

libFAUDES 2.32b --- 2024.03.01 --- c++ api documentaion by doxygen