XMLWriter Class Reference

#include <XMLWriter.hpp>

List of all members.

Public Member Functions

void insert (const real_t &f)
void insert (const int &f)
void insert (const size_t &f)
void insertUnderscore ()
void insertNewLine ()
void writeHeader ()
void add (const XMLTag &xmlTag)
void closeTag ()
 XMLWriter (std::ostream &os)
 ~XMLWriter ()

Private Attributes

std::ostream & __os
std::stack< std::string > __openTagsName


Detailed Description

Definition at line 36 of file XMLWriter.hpp.


Constructor & Destructor Documentation

XMLWriter::XMLWriter ( std::ostream &  os  )  [inline]

Definition at line 98 of file XMLWriter.hpp.

00099     : __os(os)
00100   {
00101     ;
00102   }

XMLWriter::~XMLWriter (  )  [inline]

Definition at line 104 of file XMLWriter.hpp.

References __openTagsName, and closeTag().

00105   {
00106     while (not(__openTagsName.empty())) {
00107       this->closeTag();
00108     }
00109   }

Here is the call graph for this function:


Member Function Documentation

void XMLWriter::insert ( const real_t &  f  )  [inline]

Definition at line 43 of file XMLWriter.hpp.

References __os.

Referenced by WriterVTK::__proceed().

00044   {
00045     __os << ' ' << f;
00046   }

void XMLWriter::insert ( const int &  f  )  [inline]

Definition at line 48 of file XMLWriter.hpp.

References __os.

00049   {
00050     __os << ' ' << f;
00051   }

void XMLWriter::insert ( const size_t &  f  )  [inline]

Definition at line 53 of file XMLWriter.hpp.

References __os.

00054   {
00055     __os << ' ' << f;
00056   }

void XMLWriter::insertUnderscore (  )  [inline]

Definition at line 58 of file XMLWriter.hpp.

References __openTagsName, and __os.

Referenced by WriterVTK::__proceed().

00059   {
00060     for (size_t i=0; i<__openTagsName.size(); ++i) {
00061       __os << "  ";
00062     }
00063     __os << '_';
00064   }

void XMLWriter::insertNewLine (  )  [inline]

Definition at line 66 of file XMLWriter.hpp.

References __os.

Referenced by WriterVTK::__proceed().

00067   {
00068     __os << '\n';
00069   }

void XMLWriter::writeHeader (  )  [inline]

Definition at line 71 of file XMLWriter.hpp.

References __os, and StaticBase< StreamCenter >::instance().

Referenced by WriterVTK::__proceed().

00072   {
00073     __os << "<?xml version=\"1.0\"?>";
00074     if (StreamCenter::instance().getDebugLevel() > 0) {
00075       __os << " <!-- Generated by " << PACKAGE_STRING " -->";
00076     }
00077     __os << '\n';
00078   }

Here is the call graph for this function:

void XMLWriter::add ( const XMLTag xmlTag  )  [inline]

Definition at line 80 of file XMLWriter.hpp.

References __openTagsName, and __os.

Referenced by WriterVTK::__proceed().

00081   {
00082     for (size_t i=0; i<__openTagsName.size(); ++i) {
00083       __os << "  ";
00084     }
00085     __os << '<' << xmlTag << ">\n";
00086     __openTagsName.push(xmlTag.name());
00087   }

void XMLWriter::closeTag (  )  [inline]

Definition at line 89 of file XMLWriter.hpp.

References __openTagsName, and __os.

Referenced by WriterVTK::__proceed(), and ~XMLWriter().

00090   {
00091     for (size_t i=1; i<__openTagsName.size(); ++i) {
00092       __os << "  ";
00093     }
00094     __os << "</" << __openTagsName.top() << ">\n";
00095     __openTagsName.pop();
00096   }


Member Data Documentation

std::ostream& XMLWriter::__os [private]

Definition at line 39 of file XMLWriter.hpp.

Referenced by add(), closeTag(), insert(), insertNewLine(), insertUnderscore(), and writeHeader().

std::stack<std::string> XMLWriter::__openTagsName [private]

Definition at line 40 of file XMLWriter.hpp.

Referenced by add(), closeTag(), insertUnderscore(), and ~XMLWriter().


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

Generated on Wed Nov 19 00:18:19 2008 for FreeFEM3D (aka ff3d) by  doxygen 1.5.6