36 <<
"xml attribute '" <<
k <<
"' but not inside a tag!" <<
endl;
48 <<
"Cannot add " << what <<
" inside a tag!" 81 <<
"open xml tag '" << tagName <<
"', but already within a tag!" 89 os_ <<
'<' << tagName;
92 xmlTags_.append(tagName);
104 <<
"attempt to close xml tag, but not within a tag!" 125 Foam::vtk::formatter& Foam::vtk::formatter::endTag(const word& tagName) 127 const word curr(std::move(xmlTags_.back())); 134 << "adding xml endTag '" << curr 135 << "' but already in another tag!" 138 // Also suppress further output, or not? 141 // Verify expected end tag 142 if (!tagName.empty() && tagName != curr) 145 << "expecting to end xml tag '" << tagName 146 << "' but found '" << curr << "' instead" 150 os_ << "</" << curr << '>
' << nl; 158 Foam::vtk::formatter& Foam::vtk::formatter::beginVTKFile 160 const word& contentType, 161 const word& contentVersion, 165 openTag(vtk::fileTag::VTK_FILE); 166 xmlAttr("type", contentType); 167 xmlAttr("version", contentVersion); 168 xmlAttr("byte_order", vtkPTraits<Foam::endian>::typeName); 169 xmlAttr("header_type", vtkPTraits<headerType>::typeName); 172 openTag(contentType); 182 Foam::vtk::formatter& Foam::vtk::formatter::beginAppendedData() 184 openTag("AppendedData"); 185 xmlAttr("encoding", encoding()); 193 Foam::vtk::formatter& Foam::vtk::formatter::endAppendedData() 195 flush(); // Flush any pending encoded content 196 os_ << nl; // Ensure clear separation from content 197 return endTag("AppendedData"); 201 Foam::vtk::formatter& Foam::vtk::formatter::beginBlock 207 openTag(vtk::fileTag::BLOCK); 210 xmlAttr("index", index); 214 xmlAttr("name", name); 222 Foam::vtk::formatter& Foam::vtk::formatter::beginPiece 228 openTag(vtk::fileTag::PIECE); 231 xmlAttr("index", index); 235 xmlAttr("name", name); 243 Foam::vtk::formatter& Foam::vtk::formatter::DataSet 250 openTag(vtk::fileTag::DATA_SET); 254 xmlAttr("index", index); 260 xmlAttr("name", fileName::stem(file)); 262 xmlAttr("file", file); 264 closeTag(true); // Empty tag. ie, <DataSet ... /> 270 Foam::vtk::formatter& Foam::vtk::formatter::DataSet 277 openTag(vtk::fileTag::DATA_SET); 281 xmlAttr("index", index); 285 xmlAttr("name", name); 289 xmlAttr("file", file); 291 closeTag(true); // Empty tag. ie, <DataSet ... /> 297 Foam::vtk::formatter& Foam::vtk::formatter::writeTimeValue(scalar timeValue) 299 // Emit "TimeValue" as FieldData 300 // NumberOfTuples="1" (required!) 302 uint64_t payLoad = vtk::sizeofData<float>(1); 304 beginDataArray<float,1,1>("TimeValue"); 316 // ************************************************************************* // Ostream & indent(Ostream &os)
Indent stream.
Ostream & endl(Ostream &os)
Add newline and flush stream.
label k
Boltzmann constant.
A class for handling words, derived from Foam::string.
#define WarningInFunction
Report a warning using Foam::Warning.