library of assembled shared sources |
http://lass.cocamware.com |
#include <xml_o_file.h>
Public Member Functions | |
XmlOFile () | |
XmlOFile (const char *iFilename, std::ios::openmode iOpenMode=std::ios::out|std::ios::trunc) | |
XmlOFile (const char *iFilename, const char *iRoot) | |
XmlOFile (const std::string &iFilename, std::ios::openmode iOpenMode=std::ios::out|std::ios::trunc) | |
XmlOFile (const std::string &iFilename, const std::string &iRoot) | |
virtual | ~XmlOFile () |
void | open (const char *iFilename, std::ios::openmode iOpenMode=std::ios::out|std::ios::trunc) |
void | open (const char *iFilename, const char *iRoot) |
void | open (const std::string &iFilename, std::ios::openmode iOpenMode=std::ios::out|std::ios::trunc) |
void | open (const std::string &iFilename, const std::string &iRoot) |
void | close () |
bool | is_open () |
virtual XmlOFile & | operator<< (char iIn) |
virtual XmlOFile & | operator<< (signed char iIn) |
virtual XmlOFile & | operator<< (unsigned char iIn) |
virtual XmlOFile & | operator<< (signed short iIn) |
virtual XmlOFile & | operator<< (unsigned short iIn) |
virtual XmlOFile & | operator<< (signed int iIn) |
virtual XmlOFile & | operator<< (unsigned int iIn) |
virtual XmlOFile & | operator<< (signed long iIn) |
virtual XmlOFile & | operator<< (unsigned long iIn) |
virtual XmlOFile & | operator<< (float iIn) |
virtual XmlOFile & | operator<< (double iIn) |
virtual XmlOFile & | operator<< (long double iIn) |
virtual XmlOFile & | operator<< (bool iIn) |
virtual XmlOFile & | operator<< (const void *iIn) |
virtual XmlOFile & | operator<< (const char *iIn) |
virtual XmlOFile & | operator<< (const std::string &iIn) |
virtual XmlOFile & | operator<< (std::ostream &(*iIn)(std::ostream &)) |
const bool | good () const |
const bool | eof () const |
const bool | fail () const |
const bool | bad () const |
std::ios_base::iostate | rdstate () const |
void | clear (std::ios_base::iostate iState=std::ios_base::goodbit) |
void | setstate (std::ios_base::iostate iState) |
operator num::SafeBool () const | |
const bool | operator! () const |
Protected Member Functions | |
void | swap (NonCopyable &) |
Private Attributes | |
std::ofstream | file_ |
std::string | root_ |
if you open a XmlOFile with iOpenMode (or without a second argument), the file is opened and that's it. Not automatic content is written to it:
{ XmlOFile a("foo.xml"); a << "spam\n" } // foo.xml: // spam { XmlOFile b("bar.xml, std::ios::trunc); b << "eggs\n" } // bar.xml: // eggs
However, if your second argument is the name of your root element, then a standard XML declaration will be written to it and the root element will be opened. When the file is closed, this root element will be closed automatically as well.
{ XmlOFile c("fun.xml", "root"); c << "ham\n" } // fun.xml: // <?xml version="1.0"?> // <root> // ham // </root>
Definition at line 104 of file xml_o_file.h.
lass::io::XmlOFile::XmlOFile | ( | ) |
Definition at line 54 of file xml_o_file.cpp.
lass::io::XmlOFile::XmlOFile | ( | const char * | iFilename, | |
std::ios::openmode | iOpenMode = std::ios::out | std::ios::trunc | |||
) |
lass::io::XmlOFile::XmlOFile | ( | const char * | iFilename, | |
const char * | iRoot | |||
) |
lass::io::XmlOFile::XmlOFile | ( | const std::string & | iFilename, | |
std::ios::openmode | iOpenMode = std::ios::out | std::ios::trunc | |||
) |
lass::io::XmlOFile::XmlOFile | ( | const std::string & | iFilename, | |
const std::string & | iRoot | |||
) |
lass::io::XmlOFile::~XmlOFile | ( | ) | [virtual] |
void lass::io::XmlOFile::open | ( | const char * | iFilename, | |
std::ios::openmode | iOpenMode = std::ios::out | std::ios::trunc | |||
) |
Definition at line 102 of file xml_o_file.cpp.
References lass::io::StreamBase::clear(), file_, and root_.
Referenced by open(), and XmlOFile().
void lass::io::XmlOFile::open | ( | const char * | iFilename, | |
const char * | iRoot | |||
) |
Definition at line 111 of file xml_o_file.cpp.
References lass::io::StreamBase::clear(), file_, lass::prim::out(), and root_.
void lass::io::XmlOFile::open | ( | const std::string & | iFilename, | |
std::ios::openmode | iOpenMode = std::ios::out | std::ios::trunc | |||
) |
void lass::io::XmlOFile::open | ( | const std::string & | iFilename, | |
const std::string & | iRoot | |||
) |
void lass::io::XmlOFile::close | ( | ) |
Definition at line 136 of file xml_o_file.cpp.
References lass::io::StreamBase::clear(), file_, and root_.
Referenced by ~XmlOFile().
bool lass::io::XmlOFile::is_open | ( | ) |
virtual XmlOFile& lass::io::XmlOFile::operator<< | ( | char | iIn | ) | [virtual] |
Implements lass::io::XmlOStream.
virtual XmlOFile& lass::io::XmlOFile::operator<< | ( | signed char | iIn | ) | [virtual] |
Implements lass::io::XmlOStream.
virtual XmlOFile& lass::io::XmlOFile::operator<< | ( | unsigned char | iIn | ) | [virtual] |
Implements lass::io::XmlOStream.
virtual XmlOFile& lass::io::XmlOFile::operator<< | ( | signed short | iIn | ) | [virtual] |
Implements lass::io::XmlOStream.
virtual XmlOFile& lass::io::XmlOFile::operator<< | ( | unsigned short | iIn | ) | [virtual] |
Implements lass::io::XmlOStream.
virtual XmlOFile& lass::io::XmlOFile::operator<< | ( | signed int | iIn | ) | [virtual] |
Implements lass::io::XmlOStream.
virtual XmlOFile& lass::io::XmlOFile::operator<< | ( | unsigned int | iIn | ) | [virtual] |
Implements lass::io::XmlOStream.
virtual XmlOFile& lass::io::XmlOFile::operator<< | ( | signed long | iIn | ) | [virtual] |
Implements lass::io::XmlOStream.
virtual XmlOFile& lass::io::XmlOFile::operator<< | ( | unsigned long | iIn | ) | [virtual] |
Implements lass::io::XmlOStream.
virtual XmlOFile& lass::io::XmlOFile::operator<< | ( | float | iIn | ) | [virtual] |
Implements lass::io::XmlOStream.
virtual XmlOFile& lass::io::XmlOFile::operator<< | ( | double | iIn | ) | [virtual] |
Implements lass::io::XmlOStream.
virtual XmlOFile& lass::io::XmlOFile::operator<< | ( | long double | iIn | ) | [virtual] |
Implements lass::io::XmlOStream.
virtual XmlOFile& lass::io::XmlOFile::operator<< | ( | bool | iIn | ) | [virtual] |
Implements lass::io::XmlOStream.
virtual XmlOFile& lass::io::XmlOFile::operator<< | ( | const void * | iIn | ) | [virtual] |
Implements lass::io::XmlOStream.
virtual XmlOFile& lass::io::XmlOFile::operator<< | ( | const char * | iIn | ) | [virtual] |
Implements lass::io::XmlOStream.
virtual XmlOFile& lass::io::XmlOFile::operator<< | ( | const std::string & | iIn | ) | [virtual] |
Implements lass::io::XmlOStream.
XmlOFile & lass::io::XmlOFile::operator<< | ( | std::ostream &(*)(std::ostream &) | iIn | ) | [virtual] |
const bool lass::io::StreamBase::good | ( | ) | const [inline, inherited] |
Definition at line 76 of file stream_base.h.
Referenced by lass::io::BinaryOFile::doFlush(), lass::io::BinaryISocket::doRead(), lass::io::BinaryIMemoryMap::doRead(), lass::io::BinaryIMemoryBlock::doRead(), lass::io::BinaryIFile::doRead(), lass::io::BinaryIMemoryMap::doSeekg(), lass::io::BinaryOSocket::doWrite(), lass::io::BinaryOFile::doWrite(), lass::io::Image::open(), lass::io::BinaryOFile::open(), lass::io::BinaryIStream::operator>>(), lass::io::Image::HeaderPfm::readFrom(), lass::io::Image::HeaderRadianceHdr::readFrom(), lass::io::Image::readLine(), lass::io::BinaryIStream::readValue(), and lass::io::Image::save().
const bool lass::io::StreamBase::eof | ( | ) | const [inline, inherited] |
Definition at line 77 of file stream_base.h.
Referenced by lass::io::Image::open(), and lass::io::Image::save().
const bool lass::io::StreamBase::fail | ( | ) | const [inline, inherited] |
Definition at line 78 of file stream_base.h.
Referenced by lass::io::StreamBase::operator num::SafeBool().
const bool lass::io::StreamBase::bad | ( | ) | const [inline, inherited] |
Definition at line 79 of file stream_base.h.
std::ios_base::iostate lass::io::StreamBase::rdstate | ( | ) | const [inline, inherited] |
void lass::io::StreamBase::clear | ( | std::ios_base::iostate | iState = std::ios_base::goodbit |
) | [inline, inherited] |
Definition at line 81 of file stream_base.h.
Referenced by close(), open(), and lass::io::XmlOElement::XmlOElement().
void lass::io::StreamBase::setstate | ( | std::ios_base::iostate | iState | ) | [inline, inherited] |
Definition at line 82 of file stream_base.h.
Referenced by lass::io::BinaryOFile::close(), lass::io::BinaryIFile::close(), lass::io::BinaryOFile::doFlush(), lass::io::BinaryISocket::doRead(), lass::io::BinaryIMemoryMap::doRead(), lass::io::BinaryIMemoryBlock::doRead(), lass::io::BinaryIFile::doRead(), lass::io::BinaryIMemoryMap::doSeekg(), lass::io::BinaryIFile::doSeekg(), lass::io::BinaryOFile::doSeekp(), lass::io::BinaryOFile::doWrite(), lass::io::BinaryOSocket::flusher(), lass::io::BinaryOFile::open(), lass::io::BinaryIMemoryMap::open(), and lass::io::BinaryIFile::open().
lass::io::StreamBase::operator num::SafeBool | ( | ) | const [inline, inherited] |
Definition at line 83 of file stream_base.h.
References lass::io::StreamBase::fail(), lass::num::safeFalse, and lass::num::safeTrue.
const bool lass::io::StreamBase::operator! | ( | ) | const [inline, inherited] |
Definition at line 84 of file stream_base.h.
void lass::util::NonCopyable::swap | ( | NonCopyable & | ) | [inline, protected, inherited] |
std::ofstream lass::io::XmlOFile::file_ [private] |
std::string lass::io::XmlOFile::root_ [private] |
Generated on Mon Nov 10 14:22:09 2008 for Library of Assembled Shared Sources by 1.5.7.1 |