63XmlOFile::XmlOFile(
const char* iFileName, std::ios::openmode iOpenMode):
66 open(iFileName, iOpenMode);
71XmlOFile::XmlOFile(
const char* iFileName,
const char* iRoot):
74 open(iFileName, iRoot);
79XmlOFile::XmlOFile(
const std::string& iFileName, std::ios::openmode iOpenMode):
82 open(iFileName, iOpenMode);
87XmlOFile::XmlOFile(
const std::string& iFileName,
const std::string& iRoot):
90 open(iFileName, iRoot);
102void XmlOFile::open(
const char* iFilename, std::ios::openmode iOpenMode)
104 file_.open(iFilename, iOpenMode);
106 clear(file_.rdstate());
111void XmlOFile::open(
const char* iFilename,
const char* iRoot)
113 file_.open(iFilename, std::ios::out | std::ios::trunc);
115 file_ <<
"<?xml version=\"1.0\"?>\n";
116 file_ <<
"<" << root_ <<
">\n";
117 clear(file_.rdstate());
122void XmlOFile::open(
const std::string& iFilename, std::ios::openmode iOpenMode)
124 open(iFilename.c_str(), iOpenMode);
129void XmlOFile::open(
const std::string& iFilename,
const std::string& iRoot)
131 open(iFilename.c_str(), iRoot.c_str());
136void XmlOFile::close()
138 if (file_.is_open() && !root_.empty())
140 file_ <<
"</" << root_ <<
">\n";
143 clear(file_.rdstate());
148bool XmlOFile::is_open()
150 return file_.is_open();
155#define LASS_IO_XML_O_FILE_INSERTOR( type__ )\
156 XmlOFile& XmlOFile::operator<<( type__ iIn )\
159 clear(file_.rdstate());\
163LASS_IO_XML_O_FILE_INSERTOR(
char )
164LASS_IO_XML_O_FILE_INSERTOR(
signed char )
165LASS_IO_XML_O_FILE_INSERTOR(
unsigned char )
166LASS_IO_XML_O_FILE_INSERTOR(
signed short )
167LASS_IO_XML_O_FILE_INSERTOR(
unsigned short )
168LASS_IO_XML_O_FILE_INSERTOR(
signed int )
169LASS_IO_XML_O_FILE_INSERTOR(
unsigned int )
170LASS_IO_XML_O_FILE_INSERTOR(
signed long )
171LASS_IO_XML_O_FILE_INSERTOR(
unsigned long )
172LASS_IO_XML_O_FILE_INSERTOR(
float )
173LASS_IO_XML_O_FILE_INSERTOR(
double )
174LASS_IO_XML_O_FILE_INSERTOR(
long double )
175LASS_IO_XML_O_FILE_INSERTOR(
bool )
176LASS_IO_XML_O_FILE_INSERTOR(
const void* )
177LASS_IO_XML_O_FILE_INSERTOR(
const char* )
178LASS_IO_XML_O_FILE_INSERTOR(
const std::string& )
180XmlOFile& XmlOFile::operator<<( std::ostream& (*iIn) (std::ostream&) )
183 clear(file_.rdstate());
Output stream for writing a selection of geometric primitives to XML files.
streams, binary streams, vrmlstreams, ...
Library for Assembled Shared Sources.