Changeset 740 for code/branches/FICN/src/tinyxml/tinyxml.cc
- Timestamp:
- Dec 31, 2007, 1:32:53 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/FICN/src/tinyxml/tinyxml.cc
r738 r740 22 22 distribution. 23 23 */ 24 #include "tinyxml.h" 24 25 25 26 #include <ctype.h> … … 29 30 #include <iostream> 30 31 #endif 31 32 #include "tinyxml.h"33 32 34 33 … … 1467 1466 } 1468 1467 1468 TiXmlStylesheetReference::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 1478 TiXmlStylesheetReference::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 1488 TiXmlStylesheetReference::TiXmlStylesheetReference( const TiXmlStylesheetReference& copy ) 1489 : TiXmlNode( TiXmlNode::STYLESHEETREFERENCE ) 1490 { 1491 copy.CopyTo( this ); 1492 } 1493 1494 1495 void TiXmlStylesheetReference::operator=( const TiXmlStylesheetReference& copy ) 1496 { 1497 Clear(); 1498 copy.CopyTo( this ); 1499 } 1500 1501 1502 void 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 1519 void TiXmlStylesheetReference::CopyTo( TiXmlStylesheetReference* target ) const 1520 { 1521 TiXmlNode::CopyTo( target ); 1522 1523 target->type = type; 1524 target->href = href; 1525 } 1526 1527 bool TiXmlStylesheetReference::Accept( TiXmlVisitor* visitor ) const 1528 { 1529 return visitor->Visit( *this ); 1530 } 1531 1532 TiXmlNode* TiXmlStylesheetReference::Clone() const 1533 { 1534 TiXmlStylesheetReference* clone = new TiXmlStylesheetReference(); 1535 1536 if ( !clone ) 1537 return 0; 1538 1539 CopyTo( clone ); 1540 return clone; 1541 } 1469 1542 1470 1543 void TiXmlUnknown::Print( FILE* cfile, int depth ) const
Note: See TracChangeset
for help on using the changeset viewer.