Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

updated tinyxml to the version ticpp uses

File:
1 edited

Legend:

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

    r738 r740  
    838838        // - Comments: <!--
    839839        // - Decleration: <?xml
     840        // - StylesheetReference <?xml-stylesheet
    840841        // - Everthing else is unknown to tinyxml.
    841842        //
    842843
    843844        const char* xmlHeader = { "<?xml" };
     845        const char* xmlSSHeader = { "<?xml-stylesheet" };
    844846        const char* commentHeader = { "<!--" };
    845847        const char* dtdHeader = { "<!" };
    846848        const char* cdataHeader = { "<![CDATA[" };
    847849
    848         if ( StringEqual( p, xmlHeader, true, encoding ) )
     850        if ( StringEqual( p, xmlSSHeader, true, encoding ) )
     851        {
     852                #ifdef DEBUG_PARSER
     853                        TIXML_LOG( "XML parsing Stylesheet Reference\n" );
     854                #endif
     855                returnNode = new TiXmlStylesheetReference();
     856        }
     857        else if ( StringEqual( p, xmlHeader, true, encoding ) )
    849858        {
    850859                #ifdef DEBUG_PARSER
     
    16371646}
    16381647
     1648#ifdef TIXML_USE_STL
     1649void TiXmlStylesheetReference::StreamIn( std::istream * in, TIXML_STRING * tag )
     1650{
     1651        while ( in->good() )
     1652        {
     1653                int c = in->get();
     1654                if ( c <= 0 )
     1655                {
     1656                        TiXmlDocument* document = GetDocument();
     1657                        if ( document )
     1658                                document->SetError( TIXML_ERROR_EMBEDDED_NULL, 0, 0, TIXML_ENCODING_UNKNOWN );
     1659                        return;
     1660                }
     1661                (*tag) += (char) c;
     1662
     1663                if ( c == '>' )
     1664                {
     1665                        // All is well.
     1666                        return;
     1667                }
     1668        }
     1669}
     1670#endif
     1671
     1672const char* TiXmlStylesheetReference::Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding _encoding )
     1673{
     1674        p = SkipWhiteSpace( p, _encoding );
     1675        // Find the beginning, find the end, and look for
     1676        // the stuff in-between.
     1677        TiXmlDocument* document = GetDocument();
     1678        if ( !p || !*p || !StringEqual( p, "<?xml-stylesheet", true, _encoding ) )
     1679        {
     1680                if ( document ) document->SetError( TIXML_ERROR_PARSING_DECLARATION, 0, 0, _encoding );
     1681                return 0;
     1682        }
     1683        if ( data )
     1684        {
     1685                data->Stamp( p, _encoding );
     1686                location = data->Cursor();
     1687        }
     1688        p += 5;
     1689
     1690        type = "";
     1691        href = "";
     1692
     1693        while ( p && *p )
     1694        {
     1695                if ( *p == '>' )
     1696                {
     1697                        ++p;
     1698                        return p;
     1699                }
     1700
     1701                p = SkipWhiteSpace( p, _encoding );
     1702                if ( StringEqual( p, "type", true, _encoding ) )
     1703                {
     1704                        TiXmlAttribute attrib;
     1705                        p = attrib.Parse( p, data, _encoding );
     1706                        type = attrib.Value();
     1707                }
     1708                else if ( StringEqual( p, "href", true, _encoding ) )
     1709                {
     1710                        TiXmlAttribute attrib;
     1711                        p = attrib.Parse( p, data, _encoding );
     1712                        href = attrib.Value();
     1713                }
     1714                else
     1715                {
     1716                        // Read over whatever it is.
     1717                        while( p && *p && *p != '>' && !IsWhiteSpace( *p ) )
     1718                                ++p;
     1719                }
     1720        }
     1721        return 0;
     1722}
Note: See TracChangeset for help on using the changeset viewer.