XS-libgeos
view release on metacpan or search on metacpan
geos-3.7.3/tests/xmltester/tinyxml/tinyxml.h view on Meta::CPAN
/** An XML comment.
*/
class TiXmlComment : public TiXmlNode
{
public:
/// Constructs an empty comment.
TiXmlComment() : TiXmlNode( TiXmlNode::COMMENT ) {}
/// Construct a comment from text.
TiXmlComment( const char* _value ) : TiXmlNode( TiXmlNode::COMMENT ) {
SetValue( _value );
}
TiXmlComment( const TiXmlComment& );
void operator=( const TiXmlComment& base );
~TiXmlComment() override {}
/// Returns a copy of this Comment.
TiXmlNode* Clone() const override;
// Write this Comment to a FILE stream.
void Print( FILE* cfile, int depth ) const override;
/* Attribtue parsing starts: at the ! of the !--
returns: next char past '>'
*/
const char* Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding ) override;
const TiXmlComment* ToComment() const override { return this; } ///< Cast to a more defined type. Will return null not of the requested type.
TiXmlComment* ToComment() override { return this; } ///< Cast to a more defined type. Will return null not of the requested type.
/** Walk the XML tree visiting this node and all of its children.
*/
bool Accept( TiXmlVisitor* visitor ) const override;
protected:
void CopyTo( TiXmlComment* target ) const;
// used to be public
#ifdef TIXML_USE_STL
virtual void StreamIn( std::istream * in, TIXML_STRING * tag );
#endif
// virtual void StreamOut( TIXML_OSTREAM * out ) const;
private:
};
/** XML text. A text node can have 2 ways to output the next. "normal" output
and CDATA. It will default to the mode it was parsed from the XML file and
you generally want to leave it alone, but you can change the output mode with
SetCDATA() and query it with CDATA().
*/
class TiXmlText : public TiXmlNode
{
friend class TiXmlElement;
public:
/** Constructor for text element. By default, it is treated as
normal, encoded text. If you want it be output as a CDATA text
element, set the parameter _cdata to 'true'
*/
TiXmlText (const char * initValue ) : TiXmlNode (TiXmlNode::TEXT)
{
SetValue( initValue );
cdata = false;
}
~TiXmlText() override {}
#ifdef TIXML_USE_STL
/// Constructor.
TiXmlText( const std::string& initValue ) : TiXmlNode (TiXmlNode::TEXT)
{
SetValue( initValue );
cdata = false;
}
#endif
TiXmlText( const TiXmlText& copy ) : TiXmlNode( TiXmlNode::TEXT ) { copy.CopyTo( this ); }
void operator=( const TiXmlText& base ) { base.CopyTo( this ); }
// Write this text object to a FILE stream.
void Print( FILE* cfile, int depth ) const override;
/// Queries whether this represents text using a CDATA section.
bool CDATA() const { return cdata; }
/// Turns on or off a CDATA representation of text.
void SetCDATA( bool _cdata ) { cdata = _cdata; }
const char* Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding ) override;
const TiXmlText* ToText() const override { return this; } ///< Cast to a more defined type. Will return null not of the requested type.
TiXmlText* ToText() override { return this; } ///< Cast to a more defined type. Will return null not of the requested type.
/** Walk the XML tree visiting this node and all of its children.
*/
bool Accept( TiXmlVisitor* content ) const override;
protected :
/// [internal use] Creates a new Element and returns it.
TiXmlNode* Clone() const override;
void CopyTo( TiXmlText* target ) const;
bool Blank() const; // returns true if all white space and new lines
// [internal use]
#ifdef TIXML_USE_STL
virtual void StreamIn( std::istream * in, TIXML_STRING * tag );
#endif
private:
bool cdata; // true if this should be input and output as a CDATA style text element
};
/** In correct XML the declaration is the first entry in the file.
@verbatim
<?xml version="1.0" standalone="yes"?>
@endverbatim
TinyXml will happily read or write files without a declaration,
however. There are 3 possible attributes to the declaration:
version, encoding, and standalone.
Note: In this version of the code, the attributes are
handled as special cases, not generic attributes, simply
because there can only be at most 3 and they are always the same.
*/
class TiXmlDeclaration : public TiXmlNode
{
public:
/// Construct an empty declaration.
TiXmlDeclaration() : TiXmlNode( TiXmlNode::DECLARATION ) {}
#ifdef TIXML_USE_STL
/// Constructor.
TiXmlDeclaration( const std::string& _version,
const std::string& _encoding,
const std::string& _standalone );
#endif
/// Construct.
TiXmlDeclaration( const char* _version,
const char* _encoding,
const char* _standalone );
TiXmlDeclaration( const TiXmlDeclaration& copy );
void operator=( const TiXmlDeclaration& copy );
~TiXmlDeclaration() override {}
/// Version. Will return an empty string if none was found.
const char *Version() const { return version.c_str (); }
/// Encoding. Will return an empty string if none was found.
const char *Encoding() const { return encoding.c_str (); }
/// Is this a standalone document?
const char *Standalone() const { return standalone.c_str (); }
/// Creates a copy of this Declaration and returns it.
TiXmlNode* Clone() const override;
// Print this declaration to a FILE stream.
virtual void Print( FILE* cfile, int depth, TIXML_STRING* str ) const;
void Print( FILE* cfile, int depth ) const override {
Print( cfile, depth, nullptr );
}
const char* Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding ) override;
const TiXmlDeclaration* ToDeclaration() const override { return this; } ///< Cast to a more defined type. Will return null not of the requested type.
TiXmlDeclaration* ToDeclaration() override { return this; } ///< Cast to a more defined type. Will return null not of the requested type.
/** Walk the XML tree visiting this node and all of its children.
( run in 0.461 second using v1.01-cache-2.11-cpan-39bf76dae61 )