Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 31, 2007, 1:32:53 AM (17 years ago)
Author:
landauf
Message:

updated tinyxml to the version ticpp uses

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/FICN/src/tinyxml/tinyxml.cc

    r738 r740  
    2222distribution.
    2323*/
     24#include "tinyxml.h"
    2425
    2526#include <ctype.h>
     
    2930#include <iostream>
    3031#endif
    31 
    32 #include "tinyxml.h"
    3332
    3433
     
    14671466}
    14681467
     1468TiXmlStylesheetReference::TiXmlStylesheetReference( const char * _type,
     1469                                                                                                        const char * _href )
     1470        : TiXmlNode( TiXmlNode::STYLESHEETREFERENCE )
     1471{
     1472        type = _type;
     1473        href = _href;
     1474}
     1475
     1476
     1477#ifdef TIXML_USE_STL
     1478TiXmlStylesheetReference::TiXmlStylesheetReference(     const std::string& _type,
     1479                                                                                                        const std::string& _href )
     1480        : TiXmlNode( TiXmlNode::STYLESHEETREFERENCE )
     1481{
     1482        type = _type;
     1483        href = _href;
     1484}
     1485#endif
     1486
     1487
     1488TiXmlStylesheetReference::TiXmlStylesheetReference( const TiXmlStylesheetReference& copy )
     1489        : TiXmlNode( TiXmlNode::STYLESHEETREFERENCE )
     1490{
     1491        copy.CopyTo( this );
     1492}
     1493
     1494
     1495void TiXmlStylesheetReference::operator=( const TiXmlStylesheetReference& copy )
     1496{
     1497        Clear();
     1498        copy.CopyTo( this );
     1499}
     1500
     1501
     1502void TiXmlStylesheetReference::Print( FILE* cfile, int /*depth*/, TIXML_STRING* str ) const
     1503{
     1504        if ( cfile ) fprintf( cfile, "<?xml-stylesheet " );
     1505        if ( str )       (*str) += "<?xml-stylesheet ";
     1506
     1507        if ( !type.empty() ) {
     1508                if ( cfile ) fprintf (cfile, "type=\"%s\" ", type.c_str ());
     1509                if ( str ) { (*str) += "type=\""; (*str) += type; (*str) += "\" "; }
     1510        }
     1511        if ( !href.empty() ) {
     1512                if ( cfile ) fprintf (cfile, "href=\"%s\" ", href.c_str ());
     1513                if ( str ) { (*str) += "href=\""; (*str) += href; (*str) += "\" "; }
     1514        }
     1515        if ( cfile ) fprintf (cfile, "?>");
     1516        if ( str )       (*str) += "?>";
     1517}
     1518
     1519void TiXmlStylesheetReference::CopyTo( TiXmlStylesheetReference* target ) const
     1520{
     1521        TiXmlNode::CopyTo( target );
     1522
     1523        target->type = type;
     1524        target->href = href;
     1525}
     1526
     1527bool TiXmlStylesheetReference::Accept( TiXmlVisitor* visitor ) const
     1528{
     1529        return visitor->Visit( *this );
     1530}
     1531
     1532TiXmlNode* TiXmlStylesheetReference::Clone() const
     1533{
     1534        TiXmlStylesheetReference* clone = new TiXmlStylesheetReference();
     1535
     1536        if ( !clone )
     1537                return 0;
     1538
     1539        CopyTo( clone );
     1540        return clone;
     1541}
    14691542
    14701543void TiXmlUnknown::Print( FILE* cfile, int depth ) const
Note: See TracChangeset for help on using the changeset viewer.