|
|
||||||
|
Public Types |
Public Member Functions |
Private Member Functions |
Private Attributes |
List of all members
faudes::TokenWriter Class Reference Detailed DescriptionA TokenWriter writes sequential tokens to a file, a string or stdout. It is the counterpart of the TokenReader. Since wrtiting data is comparatively straight foreward, there is no explicit support of sections etc. It is left to the calling function to organise the output appropriately. There are two twists required to get alogn with faudes-tokens within an XML context
Definition at line 51 of file cfl_tokenwriter.h.
Member Enumeration Documentation◆ ModeMode of operation: write to file, string or stdout.
Definition at line 58 of file cfl_tokenwriter.h. Constructor & Destructor Documentation◆ TokenWriter() [1/4]
Console or String TokenWriter constructor. Technical detail: Stdout mode uses the global console object ConsoleOut::G() declared in cfl_helper.h.
Definition at line 73 of file cfl_tokenwriter.cpp. ◆ TokenWriter() [2/4]
File TokenWriter constructor.
Definition at line 29 of file cfl_tokenwriter.cpp. ◆ TokenWriter() [3/4]
Xml File TokenWriter constructor.
Definition at line 47 of file cfl_tokenwriter.cpp. ◆ TokenWriter() [4/4]
Stream TokenWriter constructor.
Definition at line 118 of file cfl_tokenwriter.cpp. ◆ ~TokenWriter()
Member Function Documentation◆ Columns() [1/2]
Set number of columns in a line.
of columns in a lineDefinition at line 184 of file cfl_tokenwriter.cpp. ◆ Columns() [2/2]
Get number of columns in a line.
of columns in a lineDefinition at line 179 of file cfl_tokenwriter.cpp. ◆ DoFlush()
Flush internal buffer. Definition at line 209 of file cfl_tokenwriter.cpp. ◆ Endl() [1/2]
Turn endl separator on/off. Definition at line 203 of file cfl_tokenwriter.cpp. ◆ Endl() [2/2]
Write endl separator.
Definition at line 189 of file cfl_tokenwriter.cpp. ◆ FileMode()
◆ FileName()
Get the filename. Return dummy values for console or string mode.
Definition at line 539 of file cfl_tokenwriter.cpp. ◆ Flush()
Flush any buffers. Definition at line 147 of file cfl_tokenwriter.cpp. ◆ operator<<() [1/3]
Operator for writing Idxs to a stream.
Definition at line 476 of file cfl_tokenwriter.h. ◆ operator<<() [2/3]
Operator for writing std::strings to a stream.
Definition at line 461 of file cfl_tokenwriter.h. ◆ operator<<() [3/3]
Operator for writing tokens.
Definition at line 446 of file cfl_tokenwriter.h. ◆ StdoutMode()
◆ Str()
Retrieve output as string (if in String mode)
Definition at line 160 of file cfl_tokenwriter.cpp. ◆ Streamp()
Access C++ stream. Definition at line 171 of file cfl_tokenwriter.cpp. ◆ Write()
Write next token.
Definition at line 246 of file cfl_tokenwriter.cpp. ◆ WriteBegin()
Write begin label.
Definition at line 439 of file cfl_tokenwriter.cpp. ◆ WriteBinary()
Write comment.
Definition at line 533 of file cfl_tokenwriter.cpp. ◆ WriteCharacterData()
Write character data. Writes a preproccessed string to the token stream. The string may or may not contain any markup. Formating like linefeed is maintained. This method is meant to support 1:1 copying from one stream to another. See also ReadCharacterData() from TokenReader.
Definition at line 388 of file cfl_tokenwriter.cpp. ◆ WriteComment()
Write comment in faudes format.
Definition at line 460 of file cfl_tokenwriter.cpp. ◆ WriteEmpty()
Write empty section label.
Definition at line 453 of file cfl_tokenwriter.cpp. ◆ WriteEnd()
Write end label.
Definition at line 446 of file cfl_tokenwriter.cpp. ◆ WriteFloat()
Write float.
Definition at line 423 of file cfl_tokenwriter.cpp. ◆ WriteInteger()
Write non negative integer.
Definition at line 409 of file cfl_tokenwriter.cpp. ◆ WriteInteger16()
Write integer as hex.
Definition at line 416 of file cfl_tokenwriter.cpp. ◆ WriteOption()
Write option (may not contain any "+")
Definition at line 431 of file cfl_tokenwriter.cpp. ◆ WriteString()
Write string. Writes a faudes string token, i.e. enclosed in double quotes if required and any special markup characters substitited by entity references. The string must not include any formating controls like linefeed.
Definition at line 300 of file cfl_tokenwriter.cpp. ◆ WriteText() [1/3]
Write text section. Convenience wrapper for WriteText(Token&, const std::string&).
Definition at line 348 of file cfl_tokenwriter.cpp. ◆ WriteText() [2/3]
Write text. Converts the specified string to character data by substituting markup signal characters with the resp. entities and writes the result to the token stream. In contrast to WriteString(const std::string&), no quotes are applied and the output will in general be interpretable by multiple faudes string tokens. This function is depreciated as of libFAUDES 2.16. For a consistent readback, it is required to wrap the output between a begin-end-elemant pair. This is organized conveniently organised by WriteText(Token&, const std::string&).
Definition at line 313 of file cfl_tokenwriter.cpp. ◆ WriteText() [3/3]
Write text section. Converts the specified string to character data by substituting markup signal characters with the resp. entities and writes the result to a section in the token stream. Formating by linefeeds etc is maintained. There is a matching ReadText() function for the Tokenreader to retrieve the original text. See also WriteText(const std::string&, const std::string&).
Definition at line 326 of file cfl_tokenwriter.cpp. ◆ WriteVerbatim() [1/2]
Write verbatim text section. Convenience wrapper for WriteVerbatim(Token&, const std::string&).
Definition at line 380 of file cfl_tokenwriter.cpp. ◆ WriteVerbatim() [2/2]
Write verbatim text section. Writes a string verbatim as a sequence of CDATA markup in a deticated section. The string may contain any characters. In the libFAUDES context, the usecase are long fragments of text such as Lua code. For cosmetic reasons, the specified string in wrapped in linefeeds. Use the corresponding ReadVerbatim() for a consistent readback. See also WriteVerbatim(const std::string&, const std::string&).
Definition at line 356 of file cfl_tokenwriter.cpp. ◆ WriteXmlComment()
Write comment in Xml format.
Definition at line 501 of file cfl_tokenwriter.cpp. ◆ XmlMode()
Member Data Documentation◆ mColCount
Column counter. Definition at line 509 of file cfl_tokenwriter.h. ◆ mColumns
Number of columns. Definition at line 506 of file cfl_tokenwriter.h. ◆ mDocType
Xml doctype if in xml mode. Definition at line 515 of file cfl_tokenwriter.h. ◆ mEndl
Endl seperator on/off. Definition at line 512 of file cfl_tokenwriter.h. ◆ mFileName
Filename. Definition at line 503 of file cfl_tokenwriter.h. ◆ mFStream
Actual stream object, file output. Definition at line 490 of file cfl_tokenwriter.h. ◆ mHasOutBuffer
Definition at line 500 of file cfl_tokenwriter.h. ◆ mMode
Output mode. Definition at line 484 of file cfl_tokenwriter.h. ◆ mOutBuffer
Outputbuffer. Definition at line 499 of file cfl_tokenwriter.h. ◆ mpStream
ostream object pointer Definition at line 487 of file cfl_tokenwriter.h. ◆ mSStream
Actual stream object, string output. Definition at line 493 of file cfl_tokenwriter.h. ◆ pSStream
Actual stream object, stream output. Definition at line 496 of file cfl_tokenwriter.h. The documentation for this class was generated from the following files: libFAUDES 2.32b --- 2024.03.01 --- c++ api documentaion by doxygen |