Loading...
Searching...
No Matches
formatter Class Referenceabstract

Abstract class for a VTK output stream formatter. More...

#include <foamVtkFormatter.H>

Inheritance diagram for formatter:
Collaboration diagram for formatter:

Public Types

enum  quoteChar : char { DOUBLE_QUOTE = '\"' , SINGLE_QUOTE = '\'' }
 Quoting for XML attributes. More...
typedef uint64_t headerType
 The header data is vtk UInt64.

Public Member Functions

virtual ~formatter ()=default
 Destructor.
std::ostream & os () noexcept
 Access to the underlying output stream.
virtual const vtk::outputOptionsopts () const =0
 The format-type / output options.
virtual const char * name () const =0
 Name for the XML output type or the legacy output type.
virtual const char * encoding () const =0
 Name for the XML append encoding.
void quoting (quoteChar quote) noexcept
 Change quoting char for XML attributes (default: SINGLE_QUOTE).
virtual uint64_t offset (const uint64_t numbytes)
 Increase the append data offset by numbytes and sizeof(uint64_t).
virtual std::size_t encodedLength (std::size_t n) const
 The encoded length for binary output is pass-through.
virtual bool writeSize (const uint64_t numbytes)=0
 Write leading size for binary output.
virtual void write (const uint8_t val)=0
virtual void write (const label val)=0
virtual void write (const float val)=0
virtual void write (const double val)=0
virtual void flush ()=0
 Flush encoding, write newline etc.
void indent ()
 Add indenting according to the current XML tag depth.
void indent (label n)
 Add indenting of n spaces.
formatterxmlHeader ()
 Write XML header.
template<class... Args>
formatterxmlComment (const std::string &text, Args &&... args)
 Write XML comment (at the current indentation level).
template<class... Args>
formatteropenTag (const word &tagName, Args &&... args)
 Start an XML tag, optionally with attributes.
template<class... Args>
formatteropenTag (vtk::fileTag t, Args &&... args)
 Start an XML tag, optionally with attributes.
formattercloseTag (const bool isEmpty=false)
 Finish an XML tag, optional as an empty container.
formatterendTag (const word &tagName=word::null)
 An end XML tag, optional with sanity check.
virtual formatterendTag (vtk::fileTag t)
 An end XML tag with sanity check.
template<class... Args>
formattertag (const word &t, Args &&... args)
 Write XML tag without any attributes. Combines openTag/closeTag.
template<class... Args>
formattertag (vtk::fileTag t, Args &&... args)
 Write XML tag without any attributes. Combines openTag/closeTag.
formatterbeginVTKFile (const word &contentType, const word &contentVersion, const bool leaveOpen=false)
 Add a "VTKFile" XML tag for contentType, followed by a tag for the contentType itself.
formatterbeginVTKFile (vtk::fileTag contentType, const word &contentVersion, const bool leaveOpen=false)
 Add a "VTKFile" XML tag for contentType, followed by a tag for the contentType itself.
formatterbeginVTKFile (vtk::fileTag contentType, const bool leaveOpen=false)
 Add a "VTKFile" XML tag for contentType, followed by a tag for the contentType itself.
template<vtk::fileTag ContentType>
formatterbeginVTKFile (bool leaveOpen=false)
 Add a "VTKFile" XML tag for contentType, followed by a tag for the contentType itself.
formatterbeginAppendedData ()
 Add a "AppendedData" XML tag with the current encoding and output the requisite '_' prefix.
formatterbeginBlock (label index, std::string name="")
 Begin "Block" XML section.
formatterendBlock ()
 End "Block" XML section.
formatterbeginPiece (label index, std::string name="")
 Begin "Piece" XML section.
virtual formatterendPiece ()
 End "Piece" XML section.
formatterDataSet (label index, std::string file="", bool autoName=true)
 Insert a single "DataSet" XML entry tag.
formatterDataSet (label index, std::string file, std::string name)
 Insert a single "DataSet" XML entry tag.
template<class Type, direction nComp = 1, int nTuple = 0>
formatterbeginDataArray (const word &dataName, uint64_t payLoad=npos, bool leaveOpen=false)
 Begin "DataArray" XML section.
template<class Type, direction nComp = 1, int nTuple = 0>
formatterbeginDataArray (const vtk::dataArrayAttr &dataName, uint64_t payLoad=npos, bool leaveOpen=false)
 Begin "DataArray" XML section.
virtual formatterendDataArray ()
 End "DataArray" XML section.
template<class Type, direction nComp = 1, int nTuple = 0>
formatterPDataArray (const word &dataName)
 Insert a single "PDataArray" XML entry tag.
formatterbeginFieldData ()
 Begin "FieldData" XML section.
formatterbeginCellData ()
 Begin "CellData" XML section.
formatterbeginPointData ()
 Begin "PointData" XML section.
virtual formatterendFieldData ()
 End "FieldData" XML section.
virtual formatterendCellData ()
 End "CellData" XML section.
virtual formatterendPointData ()
 End "PointData" XML section.
formatterendAppendedData ()
 End "AppendedData" XML section.
virtual formatterendVTKFile ()
 End "VTKFile" XML section.
formatterwriteTimeValue (scalar timeValue)
 Emit "TimeValue" for FieldData (name as per Catalyst output).
template<class... Args>
formatterxmlAttr (const word &k, const std::string &v, Args &&... args)
 Pair-wise write of XML key/value attributes.
template<class... Args>
formatterxmlAttr (const word &k, const int32_t v, Args &&... args)
 Pair-wise write of XML key/value attributes.
template<class... Args>
formatterxmlAttr (const word &k, const int64_t v, Args &&... args)
 Pair-wise write of XML key/value attributes.
template<class... Args>
formatterxmlAttr (const word &k, const uint64_t v, Args &&... args)
 Pair-wise write of XML key/value attributes.
template<class... Args>
formatterxmlAttr (const word &k, const scalar v, Args &&... args)
 Pair-wise write of XML key/value attributes.
template<class... Args>
formatterxmlAttr (const vtk::fileAttr &k, const std::string &v, Args &&... args)
 Pair-wise write of XML key/value attributes.
template<class... Args>
formatterxmlAttr (const vtk::fileAttr &k, const int32_t v, Args &&... args)
 Pair-wise write of XML key/value attributes.
template<class... Args>
formatterxmlAttr (const vtk::fileAttr &k, const int64_t v, Args &&... args)
 Pair-wise write of XML key/value attributes.
template<class... Args>
formatterxmlAttr (const vtk::fileAttr &k, const uint64_t v, Args &&... args)
 Pair-wise write of XML key/value attributes.
template<class... Args>
formatterxmlAttr (const vtk::fileAttr &k, const scalar v, Args &&... args)
 Pair-wise write of XML key/value attributes.
template<class Type, direction nComp = 1, int nTuple = 0>
formatteropenDataArray (const word &dataName)
 Open "DataArray" XML tag and leave open (requires a closeTag).
template<class Type, direction nComp = 1, int nTuple = 0>
formatteropenDataArray (const vtk::dataArrayAttr &dataName)
 Open "DataArray" XML tag and leave open (requires a closeTag).
template<class... Args>
Foam::vtk::formatterxmlComment (const std::string &text, Args &&... args)
template<class... Args>
Foam::vtk::formatteropenTag (const word &tagName, Args &&... args)
template<class... Args>
Foam::vtk::formatteropenTag (vtk::fileTag t, Args &&... args)
template<class... Args>
Foam::vtk::formattertag (const word &t, Args &&... args)
template<class... Args>
Foam::vtk::formattertag (vtk::fileTag t, Args &&... args)
template<Foam::vtk::fileTag ContentType>
Foam::vtk::formatterbeginVTKFile (bool leaveOpen)
template<class Type, Foam::direction nComp, int nTuple>
Foam::vtk::formatterbeginDataArray (const vtk::dataArrayAttr &dataName, uint64_t payLoad, bool leaveOpen)
template<class... Args>
Foam::vtk::formatterxmlAttr (const word &k, const std::string &v, Args &&... args)
template<class... Args>
Foam::vtk::formatterxmlAttr (const word &k, const int32_t v, Args &&... args)
template<class... Args>
Foam::vtk::formatterxmlAttr (const word &k, const int64_t v, Args &&... args)
template<class... Args>
Foam::vtk::formatterxmlAttr (const word &k, const uint64_t v, Args &&... args)
template<class... Args>
Foam::vtk::formatterxmlAttr (const word &k, const scalar v, Args &&... args)
template<class... Args>
Foam::vtk::formatterxmlAttr (const vtk::fileAttr &k, const std::string &v, Args &&... args)
template<class... Args>
Foam::vtk::formatterxmlAttr (const vtk::fileAttr &k, const int32_t v, Args &&... args)
template<class... Args>
Foam::vtk::formatterxmlAttr (const vtk::fileAttr &k, const int64_t v, Args &&... args)
template<class... Args>
Foam::vtk::formatterxmlAttr (const vtk::fileAttr &k, const uint64_t v, Args &&... args)
template<class... Args>
Foam::vtk::formatterxmlAttr (const vtk::fileAttr &k, const scalar v, Args &&... args)

Static Public Attributes

static constexpr uint64_t npos = uint64_t(-1)
 Out of range position or size.

Protected Member Functions

bool canWriteAttr (const word &k) const
 Can write XML key/value attribute pair when inside a tag. Emit warning and return false if this condition is not met.
bool canWriteToplevel (const char *what) const
 Can write tag-like top-level content (eg, comment, ...) when not already inside a tag. Emit warning and return false if this condition is not met.
template<class Type>
void writeAttr (const word &k, const Type &v)
 Write XML key/value attribute pair (implementation).
formatterxmlAttr ()
 No-op write XML attribute (for templating code).
template<class... Args>
void xmlCommentLoop (const std::string &text, Args &&... args)
 Loop/output XML comments.
bool openTagImpl (const word &tagName)
 Open XML tag (implementation), checking if not already inside another tag. Emit warning and return false if this condition is not met.
 formatter (std::ostream &os)
 Construct and attach to an output stream.

Protected Attributes

std::ostream & os_
 The output stream for the formatter.
DynamicList< wordxmlTags_
 LIFO stack of current XML tags.
bool inTag_
 Tag open/closed/ended state.
char quote_
 Quoting character for XML attributes.

Detailed Description

Abstract class for a VTK output stream formatter.

Includes simple support for writing XML elements. By default uses single-quoting for XML attributes.

Source files

Definition at line 66 of file foamVtkFormatter.H.

Member Typedef Documentation

◆ headerType

typedef uint64_t headerType

The header data is vtk UInt64.

Definition at line 164 of file foamVtkFormatter.H.

Member Enumeration Documentation

◆ quoteChar

enum quoteChar : char

Quoting for XML attributes.

Enumerator
DOUBLE_QUOTE 

Double-quote XML attributes.

SINGLE_QUOTE 

Single-quote XML attributes.

Definition at line 73 of file foamVtkFormatter.H.

Constructor & Destructor Documentation

◆ formatter()

◆ ~formatter()

virtual ~formatter ( )
virtualdefault

Destructor.

References Foam::noexcept.

Member Function Documentation

◆ canWriteAttr()

bool canWriteAttr ( const word & k) const
protected

Can write XML key/value attribute pair when inside a tag. Emit warning and return false if this condition is not met.

References k.

Referenced by xmlAttr(), xmlAttr(), xmlAttr(), xmlAttr(), xmlAttr(), xmlAttr(), xmlAttr(), xmlAttr(), xmlAttr(), and xmlAttr().

Here is the caller graph for this function:

◆ canWriteToplevel()

bool canWriteToplevel ( const char * what) const
protected

Can write tag-like top-level content (eg, comment, ...) when not already inside a tag. Emit warning and return false if this condition is not met.

References args, formatter(), and k.

Referenced by xmlComment(), and xmlHeader().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeAttr()

template<class Type>
void writeAttr ( const word & k,
const Type & v )
inlineprotected

Write XML key/value attribute pair (implementation).

Definition at line 313 of file foamVtkFormatterI.H.

References k, os_, and quote_.

Referenced by xmlAttr(), xmlAttr(), xmlAttr(), xmlAttr(), xmlAttr(), xmlAttr(), xmlAttr(), xmlAttr(), xmlAttr(), and xmlAttr().

Here is the caller graph for this function:

◆ xmlAttr() [1/21]

Foam::vtk::formatter & xmlAttr ( )
inlineprotected

No-op write XML attribute (for templating code).

Returns
formatter for chaining

Definition at line 23 of file foamVtkFormatterI.H.

Referenced by openTag(), tag(), xmlAttr(), xmlAttr(), xmlAttr(), xmlAttr(), xmlAttr(), xmlAttr(), xmlAttr(), xmlAttr(), xmlAttr(), and xmlAttr().

Here is the caller graph for this function:

◆ xmlCommentLoop()

template<class... Args>
void xmlCommentLoop ( const std::string & text,
Args &&... args )
inlineprotected

Loop/output XML comments.

Definition at line 30 of file foamVtkFormatterI.H.

References args, Foam::indent(), Foam::nl, os_, and xmlCommentLoop().

Referenced by xmlComment(), and xmlCommentLoop().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ openTagImpl()

bool openTagImpl ( const word & tagName)
protected

Open XML tag (implementation), checking if not already inside another tag. Emit warning and return false if this condition is not met.

References os().

Referenced by openTag(), and tag().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ os()

◆ opts()

virtual const vtk::outputOptions & opts ( ) const
pure virtual

The format-type / output options.

Implemented in appendBase64Formatter, appendRawFormatter, asciiFormatter, base64Formatter, legacyAsciiFormatter, and legacyRawFormatter.

References opts().

Referenced by opts().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ name()

virtual const char * name ( ) const
pure virtual

Name for the XML output type or the legacy output type.

Implemented in appendBase64Formatter, appendRawFormatter, asciiFormatter, base64Formatter, legacyAsciiFormatter, and legacyRawFormatter.

References name().

Referenced by beginBlock(), beginPiece(), DataSet(), and name().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ encoding()

virtual const char * encoding ( ) const
pure virtual

Name for the XML append encoding.

Implemented in appendRawFormatter, asciiFormatter, foamVtkBase64Layer, legacyAsciiFormatter, and legacyRawFormatter.

References encoding().

Referenced by encoding().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ quoting()

void quoting ( quoteChar quote)
noexcept

Change quoting char for XML attributes (default: SINGLE_QUOTE).

References Foam::noexcept, and quoting().

Referenced by quoting().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ offset()

virtual uint64_t offset ( const uint64_t numbytes)
virtual

Increase the append data offset by numbytes and sizeof(uint64_t).

The additional (uint64_t) size information is consistent with writeSize()

Returns
The previous data offset or formatter::npos for formats that do not support appending data.

Reimplemented in appendBase64Formatter, and appendRawFormatter.

References offset().

Referenced by offset().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ encodedLength()

virtual std::size_t encodedLength ( std::size_t n) const
virtual

The encoded length for binary output is pass-through.

Reimplemented in asciiFormatter, and foamVtkBase64Layer.

References encodedLength(), and n.

Referenced by encodedLength().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeSize()

virtual bool writeSize ( const uint64_t numbytes)
pure virtual

Write leading size for binary output.

Returns
True if used by the formatter.

Implemented in appendRawFormatter, asciiFormatter, foamVtkBase64Layer, and legacyRawFormatter.

References writeSize().

Referenced by writeSize().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ write() [1/4]

virtual void write ( const uint8_t val)
pure virtual

Implemented in appendRawFormatter, asciiFormatter, foamVtkBase64Layer, and legacyRawFormatter.

References write().

Referenced by write(), write(), write(), write(), and Foam::vtk::legacy::writeTimeValue().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ write() [2/4]

virtual void write ( const label val)
pure virtual

Implemented in appendRawFormatter, asciiFormatter, foamVtkBase64Layer, and legacyRawFormatter.

References write().

Here is the call graph for this function:

◆ write() [3/4]

virtual void write ( const float val)
pure virtual

Implemented in appendRawFormatter, asciiFormatter, foamVtkBase64Layer, and legacyRawFormatter.

References write().

Here is the call graph for this function:

◆ write() [4/4]

virtual void write ( const double val)
pure virtual

Implemented in appendRawFormatter, asciiFormatter, foamVtkBase64Layer, and legacyRawFormatter.

References write().

Here is the call graph for this function:

◆ flush()

virtual void flush ( )
pure virtual

Flush encoding, write newline etc.

Implemented in appendRawFormatter, asciiFormatter, base64Formatter, foamVtkBase64Layer, and legacyRawFormatter.

References flush(), formatter(), indent(), n, and xmlHeader().

Referenced by flush(), and Foam::vtk::legacy::writeTimeValue().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ indent() [1/2]

void indent ( )
inline

Add indenting according to the current XML tag depth.

Two spaces per depth.

Definition at line 68 of file foamVtkFormatterI.H.

References Foam::indent(), and xmlTags_.

Referenced by flush().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ indent() [2/2]

void indent ( label n)
inline

Add indenting of n spaces.

Definition at line 74 of file foamVtkFormatterI.H.

References n, and os_.

◆ xmlHeader()

Foam::vtk::formatter & xmlHeader ( )
inline

Write XML header.

Returns
formatter for chaining

Definition at line 83 of file foamVtkFormatterI.H.

References canWriteToplevel(), Foam::nl, and os_.

Referenced by flush().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ xmlComment() [1/2]

template<class... Args>
formatter & xmlComment ( const std::string & text,
Args &&... args )
inline

Write XML comment (at the current indentation level).

Returns
formatter for chaining

References args, formatter(), and xmlComment().

Referenced by xmlComment().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ openTag() [1/4]

template<class... Args>
formatter & openTag ( const word & tagName,
Args &&... args )
inline

Start an XML tag, optionally with attributes.

Returns
formatter for chaining

References args, formatter(), and openTag().

Referenced by openTag(), and openTag().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ openTag() [2/4]

template<class... Args>
formatter & openTag ( vtk::fileTag t,
Args &&... args )
inline

Start an XML tag, optionally with attributes.

Returns
formatter for chaining

References args, formatter(), and openTag().

Here is the call graph for this function:

◆ closeTag()

formatter & closeTag ( const bool isEmpty = false)

Finish an XML tag, optional as an empty container.

Always adds a trailing newline.

Returns
formatter for chaining

References closeTag(), and formatter().

Referenced by closeTag(), and tag().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ endTag() [1/2]

formatter & endTag ( const word & tagName = word::null)

An end XML tag, optional with sanity check.

Always adds a trailing newline.

Returns
formatter for chaining

References endTag(), and formatter().

Referenced by endBlock(), endCellData(), endDataArray(), endFieldData(), endPiece(), endPointData(), endTag(), endTag(), and endVTKFile().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ endTag() [2/2]

Foam::vtk::formatter & endTag ( vtk::fileTag t)
inlinevirtual

An end XML tag with sanity check.

Always adds a trailing newline.

Returns
formatter for chaining

Reimplemented in legacyAsciiFormatter, and legacyRawFormatter.

Definition at line 262 of file foamVtkFormatterI.H.

References endTag(), and Foam::vtk::fileTagNames.

Here is the call graph for this function:

◆ tag() [1/4]

template<class... Args>
formatter & tag ( const word & t,
Args &&... args )
inline

Write XML tag without any attributes. Combines openTag/closeTag.

Returns
formatter for chaining

References args, formatter(), and tag().

Referenced by beginCellData(), beginFieldData(), beginPointData(), tag(), and tag().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ tag() [2/4]

template<class... Args>
formatter & tag ( vtk::fileTag t,
Args &&... args )
inline

Write XML tag without any attributes. Combines openTag/closeTag.

Returns
formatter for chaining

References args, formatter(), and tag().

Here is the call graph for this function:

◆ beginVTKFile() [1/5]

formatter & beginVTKFile ( const word & contentType,
const word & contentVersion,
const bool leaveOpen = false )

Add a "VTKFile" XML tag for contentType, followed by a tag for the contentType itself.

Parameters
leaveOpenLeave tag open for additional attributes.
Returns
formatter for chaining

References beginVTKFile(), and formatter().

Referenced by beginVTKFile(), beginVTKFile(), beginVTKFile(), beginVTKFile(), and beginVTKFile().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ beginVTKFile() [2/5]

Foam::vtk::formatter & beginVTKFile ( vtk::fileTag contentType,
const word & contentVersion,
const bool leaveOpen = false )
inline

Add a "VTKFile" XML tag for contentType, followed by a tag for the contentType itself.

Parameters
leaveOpenLeave tag open for additional attributes.
Returns
formatter for chaining

Definition at line 181 of file foamVtkFormatterI.H.

References beginVTKFile(), and Foam::vtk::fileTagNames.

Here is the call graph for this function:

◆ beginVTKFile() [3/5]

Foam::vtk::formatter & beginVTKFile ( vtk::fileTag contentType,
const bool leaveOpen = false )
inline

Add a "VTKFile" XML tag for contentType, followed by a tag for the contentType itself.

Parameters
leaveOpenLeave tag open for additional attributes.
Returns
formatter for chaining

Definition at line 197 of file foamVtkFormatterI.H.

References beginVTKFile(), Foam::vtk::fileContentVersions, and Foam::vtk::fileTagNames.

Here is the call graph for this function:

◆ beginVTKFile() [4/5]

template<vtk::fileTag ContentType>
formatter & beginVTKFile ( bool leaveOpen = false)
inline

Add a "VTKFile" XML tag for contentType, followed by a tag for the contentType itself.

Parameters
leaveOpenLeave tag open for additional attributes.
Returns
formatter for chaining

References beginVTKFile(), and formatter().

Here is the call graph for this function:

◆ beginAppendedData()

formatter & beginAppendedData ( )

Add a "AppendedData" XML tag with the current encoding and output the requisite '_' prefix.

Returns
formatter for chaining

References beginAppendedData(), and formatter().

Referenced by beginAppendedData().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ beginBlock()

formatter & beginBlock ( label index,
std::string name = "" )

Begin "Block" XML section.

Parameters
indexThe index of the block
nameThe name of the block (ignored if empty)
Returns
formatter for chaining

References beginBlock(), endBlock(), formatter(), and name().

Referenced by beginBlock().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ endBlock()

Foam::vtk::formatter & endBlock ( )
inline

End "Block" XML section.

Returns
formatter for chaining

Definition at line 292 of file foamVtkFormatterI.H.

References Foam::vtk::BLOCK, and endTag().

Referenced by beginBlock().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ beginPiece()

formatter & beginPiece ( label index,
std::string name = "" )

Begin "Piece" XML section.

Parameters
indexThe index of the piece
nameThe name of the piece (ignored if empty)
Returns
formatter for chaining

References beginPiece(), endPiece(), formatter(), and name().

Referenced by beginPiece().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ endPiece()

Foam::vtk::formatter & endPiece ( )
inlinevirtual

End "Piece" XML section.

Returns
formatter for chaining

Reimplemented in legacyAsciiFormatter, and legacyRawFormatter.

Definition at line 298 of file foamVtkFormatterI.H.

References endTag(), and Foam::vtk::PIECE.

Referenced by beginPiece().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DataSet() [1/2]

formatter & DataSet ( label index,
std::string file = "",
bool autoName = true )

Insert a single "DataSet" XML entry tag.

Parameters
indexThe index of the DataSet
fileThe file name for the data (ignored if empty)
autoNameThe name for the data extracted from the file name (without extension)
Returns
formatter for chaining

References DataSet(), and formatter().

Referenced by DataSet(), and DataSet().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DataSet() [2/2]

formatter & DataSet ( label index,
std::string file,
std::string name )

Insert a single "DataSet" XML entry tag.

Parameters
indexThe index of the DataSet
fileThe file name for the data (ignored if empty)
nameThe name for the dataset
Returns
formatter for chaining

References DataSet(), formatter(), and name().

Here is the call graph for this function:

◆ beginDataArray() [1/3]

template<class Type, direction nComp = 1, int nTuple = 0>
formatter & beginDataArray ( const word & dataName,
uint64_t payLoad = npos,
bool leaveOpen = false )

Begin "DataArray" XML section.

Parameters
dataNameThe name of the DataArray
payLoadAdditional payLoad information to increment the offset for an append formatter and add the "offset" attribute accordingly.
leaveOpenLeave tag open for additional attributes.
Returns
formatter for chaining

References beginDataArray(), formatter(), and npos.

Referenced by beginDataArray(), beginDataArray(), beginDataArray(), openDataArray(), and openDataArray().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ beginDataArray() [2/3]

template<class Type, direction nComp = 1, int nTuple = 0>
formatter & beginDataArray ( const vtk::dataArrayAttr & dataName,
uint64_t payLoad = npos,
bool leaveOpen = false )
inline

Begin "DataArray" XML section.

Parameters
dataNameThe name of the DataArray as an enumeration
payLoadAdditional payLoad information to increment the offset for an append formatter and add the "offset" attribute accordingly.
leaveOpenLeave tag open for additional attributes.
Returns
formatter for chaining

References beginDataArray(), endDataArray(), formatter(), and npos.

Here is the call graph for this function:

◆ endDataArray()

Foam::vtk::formatter & endDataArray ( )
inlinevirtual

End "DataArray" XML section.

Returns
formatter for chaining

Reimplemented in legacyAsciiFormatter, and legacyRawFormatter.

Definition at line 286 of file foamVtkFormatterI.H.

References Foam::vtk::DATA_ARRAY, and endTag().

Referenced by beginDataArray().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PDataArray()

template<class Type, direction nComp = 1, int nTuple = 0>
formatter & PDataArray ( const word & dataName)

Insert a single "PDataArray" XML entry tag.

For some entries, the name is optional.

Returns
formatter for chaining

References beginCellData(), beginFieldData(), beginPointData(), endCellData(), endFieldData(), endPointData(), formatter(), and PDataArray().

Referenced by PDataArray().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ beginFieldData()

Foam::vtk::formatter & beginFieldData ( )
inline

Begin "FieldData" XML section.

Definition at line 254 of file foamVtkFormatterI.H.

References Foam::vtk::FIELD_DATA, and tag().

Referenced by PDataArray().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ beginCellData()

Foam::vtk::formatter & beginCellData ( )
inline

Begin "CellData" XML section.

Definition at line 242 of file foamVtkFormatterI.H.

References Foam::vtk::CELL_DATA, and tag().

Referenced by PDataArray().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ beginPointData()

Foam::vtk::formatter & beginPointData ( )
inline

Begin "PointData" XML section.

Definition at line 248 of file foamVtkFormatterI.H.

References Foam::vtk::POINT_DATA, and tag().

Referenced by PDataArray().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ endFieldData()

Foam::vtk::formatter & endFieldData ( )
inlinevirtual

End "FieldData" XML section.

Reimplemented in legacyAsciiFormatter, and legacyRawFormatter.

Definition at line 280 of file foamVtkFormatterI.H.

References endTag(), and Foam::vtk::FIELD_DATA.

Referenced by PDataArray().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ endCellData()

Foam::vtk::formatter & endCellData ( )
inlinevirtual

End "CellData" XML section.

Reimplemented in legacyAsciiFormatter, and legacyRawFormatter.

Definition at line 268 of file foamVtkFormatterI.H.

References Foam::vtk::CELL_DATA, and endTag().

Referenced by PDataArray().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ endPointData()

Foam::vtk::formatter & endPointData ( )
inlinevirtual

End "PointData" XML section.

Reimplemented in legacyAsciiFormatter, and legacyRawFormatter.

Definition at line 274 of file foamVtkFormatterI.H.

References endTag(), and Foam::vtk::POINT_DATA.

Referenced by PDataArray().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ endAppendedData()

formatter & endAppendedData ( )

End "AppendedData" XML section.

Returns
formatter for chaining

References endAppendedData(), endVTKFile(), and formatter().

Referenced by endAppendedData().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ endVTKFile()

Foam::vtk::formatter & endVTKFile ( )
inlinevirtual

End "VTKFile" XML section.

Returns
formatter for chaining

Reimplemented in legacyAsciiFormatter, and legacyRawFormatter.

Definition at line 304 of file foamVtkFormatterI.H.

References endTag(), and Foam::vtk::VTK_FILE.

Referenced by endAppendedData().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeTimeValue()

formatter & writeTimeValue ( scalar timeValue)

Emit "TimeValue" for FieldData (name as per Catalyst output).

References formatter(), and writeTimeValue().

Referenced by writeTimeValue().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ xmlAttr() [2/21]

template<class... Args>
formatter & xmlAttr ( const word & k,
const std::string & v,
Args &&... args )
inline

Pair-wise write of XML key/value attributes.

Returns
formatter for chaining

References args, formatter(), k, and xmlAttr().

Here is the call graph for this function:

◆ xmlAttr() [3/21]

template<class... Args>
formatter & xmlAttr ( const word & k,
const int32_t v,
Args &&... args )
inline

Pair-wise write of XML key/value attributes.

Returns
formatter for chaining

References args, formatter(), k, and xmlAttr().

Here is the call graph for this function:

◆ xmlAttr() [4/21]

template<class... Args>
formatter & xmlAttr ( const word & k,
const int64_t v,
Args &&... args )
inline

Pair-wise write of XML key/value attributes.

Returns
formatter for chaining

References args, formatter(), k, and xmlAttr().

Here is the call graph for this function:

◆ xmlAttr() [5/21]

template<class... Args>
formatter & xmlAttr ( const word & k,
const uint64_t v,
Args &&... args )
inline

Pair-wise write of XML key/value attributes.

Returns
formatter for chaining

References args, formatter(), k, and xmlAttr().

Here is the call graph for this function:

◆ xmlAttr() [6/21]

template<class... Args>
formatter & xmlAttr ( const word & k,
const scalar v,
Args &&... args )
inline

Pair-wise write of XML key/value attributes.

Returns
formatter for chaining

References args, formatter(), k, and xmlAttr().

Here is the call graph for this function:

◆ xmlAttr() [7/21]

template<class... Args>
formatter & xmlAttr ( const vtk::fileAttr & k,
const std::string & v,
Args &&... args )
inline

Pair-wise write of XML key/value attributes.

Returns
formatter for chaining

References args, formatter(), k, and xmlAttr().

Here is the call graph for this function:

◆ xmlAttr() [8/21]

template<class... Args>
formatter & xmlAttr ( const vtk::fileAttr & k,
const int32_t v,
Args &&... args )
inline

Pair-wise write of XML key/value attributes.

Returns
formatter for chaining

References args, formatter(), k, and xmlAttr().

Here is the call graph for this function:

◆ xmlAttr() [9/21]

template<class... Args>
formatter & xmlAttr ( const vtk::fileAttr & k,
const int64_t v,
Args &&... args )
inline

Pair-wise write of XML key/value attributes.

Returns
formatter for chaining

References args, formatter(), k, and xmlAttr().

Here is the call graph for this function:

◆ xmlAttr() [10/21]

template<class... Args>
formatter & xmlAttr ( const vtk::fileAttr & k,
const uint64_t v,
Args &&... args )
inline

Pair-wise write of XML key/value attributes.

Returns
formatter for chaining

References args, formatter(), k, and xmlAttr().

Here is the call graph for this function:

◆ xmlAttr() [11/21]

template<class... Args>
formatter & xmlAttr ( const vtk::fileAttr & k,
const scalar v,
Args &&... args )
inline

Pair-wise write of XML key/value attributes.

Returns
formatter for chaining

References args, formatter(), k, and xmlAttr().

Here is the call graph for this function:

◆ openDataArray() [1/2]

template<class Type, direction nComp = 1, int nTuple = 0>
formatter & openDataArray ( const word & dataName)
inline

Open "DataArray" XML tag and leave open (requires a closeTag).

Deprecated
Use beginDataArray instead (SEPT-2018)

Definition at line 700 of file foamVtkFormatter.H.

References beginDataArray(), formatter(), npos, and openDataArray().

Referenced by openDataArray().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ openDataArray() [2/2]

template<class Type, direction nComp = 1, int nTuple = 0>
formatter & openDataArray ( const vtk::dataArrayAttr & dataName)
inline

Open "DataArray" XML tag and leave open (requires a closeTag).

Deprecated
Use beginDataArray instead (SEPT-2018)

Definition at line 714 of file foamVtkFormatter.H.

References beginDataArray(), formatter(), and npos.

Here is the call graph for this function:

◆ xmlComment() [2/2]

template<class... Args>
Foam::vtk::formatter & xmlComment ( const std::string & text,
Args &&... args )
inline

Definition at line 95 of file foamVtkFormatterI.H.

References args, canWriteToplevel(), Foam::indent(), Foam::nl, os_, and xmlCommentLoop().

Here is the call graph for this function:

◆ openTag() [3/4]

template<class... Args>
Foam::vtk::formatter & openTag ( const word & tagName,
Args &&... args )
inline

Definition at line 127 of file foamVtkFormatterI.H.

References args, openTagImpl(), and xmlAttr().

Here is the call graph for this function:

◆ openTag() [4/4]

template<class... Args>
Foam::vtk::formatter & openTag ( vtk::fileTag t,
Args &&... args )
inline

Definition at line 143 of file foamVtkFormatterI.H.

References args, Foam::vtk::fileTagNames, and openTag().

Here is the call graph for this function:

◆ tag() [3/4]

template<class... Args>
Foam::vtk::formatter & tag ( const word & t,
Args &&... args )
inline

Definition at line 154 of file foamVtkFormatterI.H.

References args, closeTag(), openTagImpl(), and xmlAttr().

Here is the call graph for this function:

◆ tag() [4/4]

template<class... Args>
Foam::vtk::formatter & tag ( vtk::fileTag t,
Args &&... args )
inline

Definition at line 169 of file foamVtkFormatterI.H.

References args, Foam::vtk::fileTagNames, and tag().

Here is the call graph for this function:

◆ beginVTKFile() [5/5]

template<Foam::vtk::fileTag ContentType>
Foam::vtk::formatter & beginVTKFile ( bool leaveOpen)
inline

Definition at line 213 of file foamVtkFormatterI.H.

References beginVTKFile(), Foam::vtk::fileContentVersions, and Foam::vtk::fileTagNames.

Here is the call graph for this function:

◆ beginDataArray() [3/3]

template<class Type, Foam::direction nComp, int nTuple>
Foam::vtk::formatter & beginDataArray ( const vtk::dataArrayAttr & dataName,
uint64_t payLoad,
bool leaveOpen )
inline

Definition at line 225 of file foamVtkFormatterI.H.

References beginDataArray(), and Foam::vtk::dataArrayAttrNames.

Here is the call graph for this function:

◆ xmlAttr() [12/21]

template<class... Args>
Foam::vtk::formatter & xmlAttr ( const word & k,
const std::string & v,
Args &&... args )
inline

Definition at line 320 of file foamVtkFormatterI.H.

References args, canWriteAttr(), k, writeAttr(), and xmlAttr().

Here is the call graph for this function:

◆ xmlAttr() [13/21]

template<class... Args>
Foam::vtk::formatter & xmlAttr ( const word & k,
const int32_t v,
Args &&... args )
inline

Definition at line 335 of file foamVtkFormatterI.H.

References args, canWriteAttr(), k, writeAttr(), and xmlAttr().

Here is the call graph for this function:

◆ xmlAttr() [14/21]

template<class... Args>
Foam::vtk::formatter & xmlAttr ( const word & k,
const int64_t v,
Args &&... args )
inline

Definition at line 350 of file foamVtkFormatterI.H.

References args, canWriteAttr(), k, writeAttr(), and xmlAttr().

Here is the call graph for this function:

◆ xmlAttr() [15/21]

template<class... Args>
Foam::vtk::formatter & xmlAttr ( const word & k,
const uint64_t v,
Args &&... args )
inline

Definition at line 365 of file foamVtkFormatterI.H.

References args, canWriteAttr(), k, writeAttr(), and xmlAttr().

Here is the call graph for this function:

◆ xmlAttr() [16/21]

template<class... Args>
Foam::vtk::formatter & xmlAttr ( const word & k,
const scalar v,
Args &&... args )
inline

Definition at line 380 of file foamVtkFormatterI.H.

References args, canWriteAttr(), k, writeAttr(), and xmlAttr().

Here is the call graph for this function:

◆ xmlAttr() [17/21]

template<class... Args>
Foam::vtk::formatter & xmlAttr ( const vtk::fileAttr & k,
const std::string & v,
Args &&... args )
inline

Definition at line 395 of file foamVtkFormatterI.H.

References args, canWriteAttr(), Foam::vtk::fileAttrNames, k, writeAttr(), and xmlAttr().

Here is the call graph for this function:

◆ xmlAttr() [18/21]

template<class... Args>
Foam::vtk::formatter & xmlAttr ( const vtk::fileAttr & k,
const int32_t v,
Args &&... args )
inline

Definition at line 410 of file foamVtkFormatterI.H.

References args, canWriteAttr(), Foam::vtk::fileAttrNames, k, writeAttr(), and xmlAttr().

Here is the call graph for this function:

◆ xmlAttr() [19/21]

template<class... Args>
Foam::vtk::formatter & xmlAttr ( const vtk::fileAttr & k,
const int64_t v,
Args &&... args )
inline

Definition at line 425 of file foamVtkFormatterI.H.

References args, canWriteAttr(), Foam::vtk::fileAttrNames, k, writeAttr(), and xmlAttr().

Here is the call graph for this function:

◆ xmlAttr() [20/21]

template<class... Args>
Foam::vtk::formatter & xmlAttr ( const vtk::fileAttr & k,
const uint64_t v,
Args &&... args )
inline

Definition at line 440 of file foamVtkFormatterI.H.

References args, canWriteAttr(), Foam::vtk::fileAttrNames, k, writeAttr(), and xmlAttr().

Here is the call graph for this function:

◆ xmlAttr() [21/21]

template<class... Args>
Foam::vtk::formatter & xmlAttr ( const vtk::fileAttr & k,
const scalar v,
Args &&... args )
inline

Definition at line 455 of file foamVtkFormatterI.H.

References args, canWriteAttr(), Foam::vtk::fileAttrNames, k, writeAttr(), and xmlAttr().

Here is the call graph for this function:

Member Data Documentation

◆ os_

std::ostream& os_
protected

The output stream for the formatter.

Definition at line 87 of file foamVtkFormatter.H.

Referenced by formatter(), indent(), os(), writeAttr(), xmlComment(), xmlCommentLoop(), and xmlHeader().

◆ xmlTags_

DynamicList<word> xmlTags_
protected

LIFO stack of current XML tags.

Definition at line 92 of file foamVtkFormatter.H.

Referenced by formatter(), and indent().

◆ inTag_

bool inTag_
mutableprotected

Tag open/closed/ended state.

Definition at line 97 of file foamVtkFormatter.H.

Referenced by formatter().

◆ quote_

char quote_
protected

Quoting character for XML attributes.

Definition at line 102 of file foamVtkFormatter.H.

Referenced by formatter(), and writeAttr().

◆ npos

uint64_t npos = uint64_t(-1)
staticconstexpr

Out of range position or size.

Definition at line 169 of file foamVtkFormatter.H.

Referenced by beginDataArray(), beginDataArray(), openDataArray(), and openDataArray().


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