Changeset 329


Ignore:
Timestamp:
11/04/07 09:20:12 (13 years ago)
Author:
Eoin
Message:

Updated to latest tinyxml.

Files:
1 added
7 edited

Legend:

Unmodified
Added
Removed
  • 7z Halite Source.bat

    r263 r329  
    1 "D:\Program Files\7-Zip\7zG.exe" a -r -t7z Halite.src.7z -mx=7 ../Halite/* -x!bin -x!.svn -x!tools -x!*.7z -x!*.suo -x!*.ncb -x!*x64 -x!debug -x!Debug -x!release -x!Release 
     1"C:\Program Files\7-Zip\7zG.exe" a -r -t7z Halite.src.7z -mx=7 ../Halite/* -x!bin -x!.svn -x!tools -x!*.7z -x!*.suo -x!*.ncb -x!*x64 -x!debug -x!Debug -x!release -x!Release 
  • Halite.pnproj

    r328 r329  
    1 <Project name="Halite"><MagicFolder excludeFolders="CVS;.svn" filter="*.*" name="res" path="res\"><MagicFolder excludeFolders="CVS;.svn" filter="*.*" name="res24" path="res24\"><File path="ad.ico"></File><File path="ae.ico"></File><File path="af.ico"></File><File path="ag.ico"></File><File path="ai.ico"></File><File path="al.ico"></File><File path="am.ico"></File><File path="an.ico"></File><File path="ao.ico"></File><File path="ar.ico"></File><File path="as.ico"></File><File path="at.ico"></File><File path="au.ico"></File><File path="aw.ico"></File><File path="ax.ico"></File><File path="az.ico"></File><File path="ba.ico"></File><File path="bb.ico"></File><File path="bd.ico"></File><File path="be.ico"></File><File path="bf.ico"></File><File path="bg.ico"></File><File path="bh.ico"></File><File path="bi.ico"></File><File path="bj.ico"></File><File path="bm.ico"></File><File path="bn.ico"></File><File path="bo.ico"></File><File path="br.ico"></File><File path="bs.ico"></File><File path="bt.ico"></File><File path="bw.ico"></File><File path="by.ico"></File><File path="bz.ico"></File><File path="ca.ico"></File><File path="cc.ico"></File><File path="cd.ico"></File><File path="cf.ico"></File><File path="cg.ico"></File><File path="ch.ico"></File><File path="ci.ico"></File><File path="ck.ico"></File><File path="cl.ico"></File><File path="cm.ico"></File><File path="cn.ico"></File><File path="co.ico"></File><File path="cr.ico"></File><File path="cu.ico"></File><File path="cv.ico"></File><File path="cx.ico"></File><File path="cy.ico"></File><File path="cz.ico"></File><File path="de.ico"></File><File path="dj.ico"></File><File path="dk.ico"></File><File path="dm.ico"></File><File path="do.ico"></File><File path="dz.ico"></File><File path="ec.ico"></File><File path="ee.ico"></File><File path="eg.ico"></File><File path="eh.ico"></File><File path="er.ico"></File><File path="es.ico"></File><File path="et.ico"></File><File path="fi.ico"></File><File path="fj.ico"></File><File path="fk.ico"></File><File path="fm.ico"></File><File path="fo.ico"></File><File path="fr.ico"></File><File path="ga.ico"></File><File path="gb.ico"></File><File path="gd.ico"></File><File path="ge.ico"></File><File path="gg.ico"></File><File path="gh.ico"></File><File path="gi.ico"></File><File path="gk.ico"></File><File path="gl.ico"></File><File path="gm.ico"></File><File path="gn.ico"></File><File path="gp.ico"></File><File path="gq.ico"></File><File path="gr.ico"></File><File path="gs.ico"></File><File path="gt.ico"></File><File path="gu.ico"></File><File path="gw.ico"></File><File path="gy.ico"></File><File path="hk.ico"></File><File path="hn.ico"></File><File path="hr.ico"></File><File path="ht.ico"></File><File path="hu.ico"></File><File path="Icons.h"></File><File path="Icons.rc"></File><File path="id.ico"></File><File path="ie.ico"></File><File path="il.ico"></File><File path="im.ico"></File><File path="in.ico"></File><File path="io.ico"></File><File path="iq.ico"></File><File path="ir.ico"></File><File path="is.ico"></File><File path="it.ico"></File><File path="je.ico"></File><File path="jm.ico"></File><File path="jo.ico"></File><File path="jp.ico"></File><File path="ke.ico"></File><File path="kg.ico"></File><File path="kh.ico"></File><File path="ki.ico"></File><File path="km.ico"></File><File path="kn.ico"></File><File path="kp.ico"></File><File path="kr.ico"></File><File path="kw.ico"></File><File path="ky.ico"></File><File path="kz.ico"></File><File path="la.ico"></File><File path="lb.ico"></File><File path="lc.ico"></File><File path="li.ico"></File><File path="lk.ico"></File><File path="lr.ico"></File><File path="ls.ico"></File><File path="lt.ico"></File><File path="lu.ico"></File><File path="lv.ico"></File><File path="ly.ico"></File><File path="ma.ico"></File><File path="mc.ico"></File><File path="md.ico"></File><File path="me.ico"></File><File path="mg.ico"></File><File path="mh.ico"></File><File path="mk.ico"></File><File path="ml.ico"></File><File path="mm.ico"></File><File path="mn.ico"></File><File path="mo.ico"></File><File path="mp.ico"></File><File path="mq.ico"></File><File path="mr.ico"></File><File path="ms.ico"></File><File path="mt.ico"></File><File path="mu.ico"></File><File path="mv.ico"></File><File path="mw.ico"></File><File path="mx.ico"></File><File path="my.ico"></File><File path="mz.ico"></File><File path="na.ico"></File><File path="nc.ico"></File><File path="ne.ico"></File><File path="nf.ico"></File><File path="ng.ico"></File><File path="ni.ico"></File><File path="nl.ico"></File><File path="no.ico"></File><File path="not.ico"></File><File path="np.ico"></File><File path="nr.ico"></File><File path="nu.ico"></File><File path="nz.ico"></File><File path="om.ico"></File><File path="pa.ico"></File><File path="pe.ico"></File><File path="pf.ico"></File><File path="pg.ico"></File><File path="ph.ico"></File><File path="pk.ico"></File><File path="pl.ico"></File><File path="pm.ico"></File><File path="pn.ico"></File><File path="pr.ico"></File><File path="ps.ico"></File><File path="pt.ico"></File><File path="pw.ico"></File><File path="py.ico"></File><File path="qa.ico"></File><File path="ro.ico"></File><File path="rs.ico"></File><File path="ru.ico"></File><File path="rw.ico"></File><File path="sa.ico"></File><File path="sb.ico"></File><File path="sc.ico"></File><File path="sd.ico"></File><File path="se.ico"></File><File path="sg.ico"></File><File path="sh.ico"></File><File path="si.ico"></File><File path="sk.ico"></File><File path="sl.ico"></File><File path="sm.ico"></File><File path="sn.ico"></File><File path="so.ico"></File><File path="sr.ico"></File><File path="st.ico"></File><File path="sv.ico"></File><File path="sy.ico"></File><File path="sz.ico"></File><File path="tc.ico"></File><File path="td.ico"></File><File path="Template.rc"></File><File path="tf.ico"></File><File path="tg.ico"></File><File path="th.ico"></File><File path="tj.ico"></File><File path="tk.ico"></File><File path="tl.ico"></File><File path="tm.ico"></File><File path="tn.ico"></File><File path="to.ico"></File><File path="tr.ico"></File><File path="tt.ico"></File><File path="tv.ico"></File><File path="tw.ico"></File><File path="tz.ico"></File><File path="ua.ico"></File><File path="ug.ico"></File><File path="us.ico"></File><File path="uy.ico"></File><File path="uz.ico"></File><File path="va.ico"></File><File path="vc.ico"></File><File path="ve.ico"></File><File path="vg.ico"></File><File path="vi.ico"></File><File path="vn.ico"></File><File path="vu.ico"></File><File path="wf.ico"></File><File path="ws.ico"></File><File path="ye.ico"></File><File path="yu.ico"></File><File path="za.ico"></File><File path="zm.ico"></File><File path="zw.ico"></File></MagicFolder><File path="afxres.h"></File><File path="English.rtf"></File><File path="Halite.aps"></File><File path="Halite.ico"></File><File path="Halite.rc"></File><File path="Icons.rc"></File><File path="Manifest.xml"></File><File path="resource.h"></File><File path="Slovenian.rc.bak"></File><File path="toolbar.bmp"></File></MagicFolder><MagicFolder excludeFolders="CVS;.svn" filter="*.*" name="src" path="src\"><MagicFolder excludeFolders="CVS;.svn" filter="*.*" name="advtabs" path="advtabs\"><File path="Debug.cpp"></File><File path="Debug.hpp"></File><File path="Files.cpp"></File><File path="Files.hpp"></File><File path="Peers.cpp"></File><File path="Peers.hpp"></File><File path="ThemeTestDialog.hpp"></File><File path="Torrent.cpp"></File><File path="Torrent.hpp"></File><File path="Tracker.cpp"></File><File path="Tracker.hpp"></File><File path="TrackerAddDialog.hpp"></File><File path="TrackerListView.cpp"></File><File path="TrackerListView.hpp"></File></MagicFolder><MagicFolder excludeFolders="CVS;.svn" filter="*.*" name="global" path="global\"><File path="InheritEnum.hpp"></File><File path="ini.cpp"></File><File path="ini.hpp"></File><File path="ini_adapter.cpp"></File><File path="ini_adapter.hpp"></File><File path="logger.cpp"></File><File path="logger.hpp"></File><File path="string_conv.cpp"></File><File path="string_conv.hpp"></File><File path="tinyxml.cpp"></File><File path="tinyxml.hpp"></File><File path="tinyxmlerror.cpp"></File><File path="tinyxmlparser.cpp"></File><File path="unicode.hpp"></File><File path="utf8.hpp"></File><File path="wtl_app.cpp"></File><File path="wtl_app.hpp"></File></MagicFolder><File path="AddTorrentDialog.hpp"></File><File path="AdvHaliteDialog.cpp"></File><File path="AdvHaliteDialog.hpp"></File><File path="AtlAutosizeDlg.h"></File><File path="ConfigOptions.cpp"></File><File path="ConfigOptions.hpp"></File><File path="CSSFileDialog.hpp"></File><File path="DdxEx.hpp"></File><File path="DebugDialog.hpp"></File><File path="DropFileTarget.h"></File><File path="halConfig.cpp"></File><File path="halConfig.hpp"></File><File path="halEvent.cpp"></File><File path="halEvent.hpp"></File><File path="Halite.cpp"></File><File path="Halite.hpp"></File><File path="HaliteDialog.cpp"></File><File path="HaliteDialog.hpp"></File><File path="HaliteDialogBase.hpp"></File><File path="HaliteEditCtrl.hpp"></File><File path="HaliteIni.hpp"></File><File path="HaliteListManager.hpp"></File><File path="HaliteListView.cpp"></File><File path="HaliteListView.hpp"></File><File path="HaliteListViewCtrl.hpp"></File><File path="HaliteSortListViewCtrl.hpp"></File><File path="HaliteTabCtrl.hpp"></File><File path="HaliteTabPage.hpp"></File><File path="HaliteUpdateLock.hpp"></File><File path="HaliteWindow.cpp"></File><File path="HaliteWindow.hpp"></File><File path="halTorrent.cpp"></File><File path="halTorrent.hpp"></File><File path="halTorrentInternal.hpp"></File><File path="halXmlRpc.cpp"></File><File path="halXmlRpc.hpp"></File><File path="NTray.cpp"></File><File path="NTray.hpp"></File><File path="ProgressDialog.hpp"></File><File path="SimpleHtml.h"></File><File path="SplashDialog.hpp"></File><File path="SSFileDialog.hpp"></File><File path="stdAfx.cpp"></File><File path="stdAfx.hpp"></File><File path="UxthemeWrapper.cpp"></File><File path="UxthemeWrapper.hpp"></File><File path="WinAPIMutex.hpp"></File><File path="WinAPIWaitableTimer.hpp"></File></MagicFolder><File path="Jamfile.v2"></File></Project> 
     1<Project name="Halite"><MagicFolder excludeFolders="CVS;.svn" filter="*.*" name="res" path="res\"><File path="afxres.h"></File><File path="English.rtf"></File><File path="Halite.aps"></File><File path="Halite.ico"></File><File path="Halite.rc"></File><File path="Manifest.xml"></File><File path="resource.h"></File><File path="toolbar.bmp"></File></MagicFolder><MagicFolder excludeFolders="CVS;.svn" filter="*.*" name="src" path="src\"><MagicFolder excludeFolders="CVS;.svn" filter="*.*" name="advtabs" path="advtabs\"><File path="Debug.cpp"></File><File path="Debug.hpp"></File><File path="Files.cpp"></File><File path="Files.hpp"></File><File path="Peers.cpp"></File><File path="Peers.hpp"></File><File path="ThemeTestDialog.hpp"></File><File path="Torrent.cpp"></File><File path="Torrent.hpp"></File><File path="Tracker.cpp"></File><File path="Tracker.hpp"></File><File path="TrackerAddDialog.hpp"></File><File path="TrackerListView.cpp"></File><File path="TrackerListView.hpp"></File></MagicFolder><MagicFolder excludeFolders="CVS;.svn" filter="*.*" name="global" path="global\"><File path="InheritEnum.hpp"></File><File path="ini.cpp"></File><File path="ini.hpp"></File><File path="ini_adapter.cpp"></File><File path="ini_adapter.hpp"></File><File path="logger.cpp"></File><File path="logger.hpp"></File><File path="string_conv.cpp"></File><File path="string_conv.hpp"></File><File path="tinyxml.cpp"></File><File path="tinyxml.hpp"></File><File path="tinyxmlerror.cpp"></File><File path="tinyxmlparser.cpp"></File><File path="unicode.hpp"></File><File path="utf8.hpp"></File><File path="wtl_app.cpp"></File><File path="wtl_app.hpp"></File></MagicFolder><File path="AddTorrentDialog.hpp"></File><File path="AdvHaliteDialog.cpp"></File><File path="AdvHaliteDialog.hpp"></File><File path="AtlAutosizeDlg.h"></File><File path="ConfigOptions.cpp"></File><File path="ConfigOptions.hpp"></File><File path="CSSFileDialog.hpp"></File><File path="DdxEx.hpp"></File><File path="DebugDialog.hpp"></File><File path="DropFileTarget.h"></File><File path="halConfig.cpp"></File><File path="halConfig.hpp"></File><File path="halEvent.cpp"></File><File path="halEvent.hpp"></File><File path="Halite.cpp"></File><File path="Halite.hpp"></File><File path="HaliteDialog.cpp"></File><File path="HaliteDialog.hpp"></File><File path="HaliteDialogBase.hpp"></File><File path="HaliteEditCtrl.hpp"></File><File path="HaliteIni.hpp"></File><File path="HaliteListManager.hpp"></File><File path="HaliteListView.cpp"></File><File path="HaliteListView.hpp"></File><File path="HaliteListViewCtrl.hpp"></File><File path="HaliteSortListViewCtrl.hpp"></File><File path="HaliteTabCtrl.hpp"></File><File path="HaliteTabPage.hpp"></File><File path="HaliteUpdateLock.hpp"></File><File path="HaliteWindow.cpp"></File><File path="HaliteWindow.hpp"></File><File path="halTorrent.cpp"></File><File path="halTorrent.hpp"></File><File path="halTorrentInternal.hpp"></File><File path="halXmlRpc.cpp"></File><File path="halXmlRpc.hpp"></File><File path="NTray.cpp"></File><File path="NTray.hpp"></File><File path="ProgressDialog.hpp"></File><File path="SimpleHtml.h"></File><File path="SplashDialog.hpp"></File><File path="SSFileDialog.hpp"></File><File path="stdAfx.cpp"></File><File path="stdAfx.hpp"></File><File path="UxthemeWrapper.cpp"></File><File path="UxthemeWrapper.hpp"></File><File path="WinAPIMutex.hpp"></File><File path="WinAPIWaitableTimer.hpp"></File></MagicFolder><File path="Jamfile.v2"></File></Project> 
  • Halite.pnps

    r328 r329  
    1 <pd><ViewState><e p="Halite\src\advtabs" x="true"></e><e p="Halite" x="true"></e><e p="Halite\res" x="true"></e><e p="Halite\res\res24" x="false"></e><e p="Halite\src" x="true"></e><e p="Halite\src\global" x="false"></e></ViewState></pd> 
     1<pd><ViewState><e p="Halite\src\advtabs" x="true"></e><e p="Halite" x="true"></e><e p="Halite\res" x="true"></e><e p="Halite\src" x="true"></e><e p="Halite\src\global" x="true"></e></ViewState></pd> 
  • src/global/tinyxml.cpp

    r325 r329  
    33Original code (2.0 and earlier )copyright (c) 2000-2006 Lee Thomason (www.grinninglizard.com) 
    44 
    5 This software is provided 'as-is', without any express or implied 
     5this software is provided 'as-is', without any express or implied 
    66warranty. In no_ event will the authors be held liable for any 
    77damages arising from the use of this software. 
    88 
    99Permission is granted to anyone to use this software for any 
    10 purpose, including commercial applications, and to alter it and 
    11 redistribute it freely, subject to the following restrictions: 
     10purpose, including commercial applications, and to alter it_ and 
     11redistribute it_ freely, subject to the following restrictions: 
    1212 
    13131. The origin of this software must not be misrepresented; you must 
     
    1919must not be misrepresented as being the original software. 
    2020 
    21 3. This notice may not be removed or altered from any source 
     213. this notice may not be removed or altered from any source 
    2222distribution. 
    2323*/ 
    2424 
    2525#include <ctype.h> 
    26 #include <wchar.h> 
    2726 
    2827#ifdef TIXML_USE_STL 
     
    3332#include "tinyxml.hpp" 
    3433 
    35  
    36 namespace tinyxml { 
     34namespace tinyxml 
     35{ 
    3736 
    3837bool base::condenseWhiteSpace = true; 
    3938 
    40 void base::put_string( const TIXML_STRING& str, TIXML_STRING* outString ) 
     39// Microsoft compiler security 
     40FILE* f_open( const char* filename, const char* mode ) 
     41{ 
     42        #if defined(_MSC_VER) && (_MSC_VER >= 1400 ) 
     43                FILE* fp = 0; 
     44                errno_t err = fopen_s( &fp, filename, mode ); 
     45                if ( !err && fp ) 
     46                        return fp; 
     47                return 0; 
     48        #else 
     49                return fopen( filename, mode ); 
     50        #endif 
     51} 
     52 
     53void base::encode_string( const TIXML_STRING& str, TIXML_STRING* outString ) 
    4154{ 
    4255        int i=0; 
     
    4558        { 
    4659                unsigned char c = (unsigned char) str[i]; 
    47  
    4860 
    4961                if (    c == '&'  
     
    5668                        // &#xA9;       -- copyright symbol, for example. 
    5769                        // 
    58                         // The -1 is a bug fix from Rob Laveaux. It keeps 
     70                        // The -1 is a bug_ fix from Rob Laveaux. it keeps 
    5971                        // an overflow from happening if there is no_ ';'. 
    60                         // There are actually 2 ways to exit this loop - 
     72                        // There are_ actually 2 ways to exit this loop - 
    6173                        // while fails (error_ case) and break (semicolon found). 
    6274                        // However, there is no_ mechanism (currently) for 
     
    95107                        ++i; 
    96108                } 
    97                 else  
    98  
    99                 if ( c < 32 ) 
     109                else if ( c < 32 ) 
    100110                { 
    101111                        // Easy pass at non-alpha/numeric/symbol 
     
    116126                else 
    117127                { 
    118  
    119128                        //char realc = (char) c; 
    120129                        //outString->append( &realc, 1 ); 
    121                         *outString += (char) c; // somewhat more efficient function call. 
     130                        *outString += (char) c; // somewhat_ more efficient function call. 
    122131                        ++i; 
    123132                } 
     
    195204                lastChild->next_ = node_; 
    196205        else 
    197                 firstChild = node_;                     // it was an empty list. 
     206                firstChild = node_;                     // it_ was an empty list. 
    198207 
    199208        lastChild = node_; 
     
    513522 
    514523 
    515 element::element( const element& copy) 
     524element::element( const element& copy_) 
    516525        : node( node::ELEMENT ) 
    517526{ 
    518527        firstChild = lastChild = 0; 
    519         copy.copy_to( this );    
     528        copy_.copy_to( this );   
    520529} 
    521530 
     
    779788        } 
    780789 
    781         // There are 3 different formatting approaches: 
    782         // 1) An element_ without children is printed as a <foo /> node_ 
     790        // There are_ 3 different formatting approaches: 
     791        // 1) An element_ without children_ is printed as a <foo /> node_ 
    783792        // 2) An element_ with only a text_ child_ is printed as <foo> text_ </foo> 
    784         // 3) An element_ with children is printed on multiple lines. 
     793        // 3) An element_ with children_ is printed on multiple lines. 
    785794        node* node_; 
    786795        if ( !firstChild ) 
     
    825834 
    826835        // element class:  
    827         // clone the attributes_, then clone_ the children. 
     836        // clone the attributes_, then clone_ the children_. 
    828837        const attribute* attribute_ = 0; 
    829838        for(    attribute_ = attributeSet.first(); 
     
    906915 
    907916 
    908 document::document( const document& copy ) : node( node::DOCUMENT ) 
    909 { 
    910         copy.copy_to( this ); 
    911 } 
    912  
    913  
    914 void document::operator=( const document& copy ) 
     917document::document( const document& copy_ ) : node( node::DOCUMENT ) 
     918{ 
     919        copy_.copy_to( this ); 
     920} 
     921 
     922 
     923void document::operator=( const document& copy_ ) 
    915924{ 
    916925        clear(); 
    917         copy.copy_to( this ); 
     926        copy_.copy_to( this ); 
    918927} 
    919928 
     
    942951bool document::load_file( const char* _filename, encoding encoding_ ) 
    943952{ 
    944         // There was a really terrifying little bug here. The code: 
     953        // There was a really terrifying little bug_ here. The code: 
    945954        //              value_ = filename 
    946         // in the STL case, cause the assignment method of the std::string to 
     955        // in the STL case, cause the assignment_ method of the std::string to 
    947956        // be called. What is strange, is that the std::string had the same 
    948         // address as it's c_str() method, and so bad things happen. Looks 
    949         // like a bug in the Microsoft STL implementation. 
     957        // address as it_'s c_str() method, and so bad things happen. Looks 
     958        // like a bug_ in the Microsoft STL implementation. 
    950959        // add an extra string to avoid the crash. 
    951960        TIXML_STRING filename( _filename ); 
     
    953962 
    954963        // reading in binary mode so that tinyxml can normalize the EOL 
    955         FILE* file = fopen( value_.c_str (), "rb" );     
     964        FILE* file_ = f_open( value_.c_str (), "rb" );   
     965 
     966        if ( file_ ) 
     967        { 
     968                bool result = load_file( file_, encoding_ ); 
     969                fclose( file_ ); 
     970                return result; 
     971        } 
     972        else 
     973        { 
     974                set_error( TIXML_ERROR_OPENING_FILE, 0, 0, TIXML_ENCODING_UNKNOWN ); 
     975                return false; 
     976        } 
     977} 
     978 
     979bool document::load_file( const wchar_t* _filename, encoding encoding_ ) 
     980{ 
     981        // reading in binary mode so that tinyxml can normalize the EOL 
     982        FILE* file = _wfopen( _filename, L"rb" );        
    956983 
    957984        if ( file ) 
     
    968995} 
    969996 
    970 bool document::load_file( const wchar_t* _filename, encoding encoding_ ) 
    971 { 
    972         // reading in binary mode so that tinyxml can normalize the EOL 
    973         FILE* file = _wfopen( _filename, L"rb" );        
    974  
    975         if ( file ) 
    976         { 
    977                 bool result = load_file( file, encoding_ ); 
    978                 fclose( file ); 
    979                 return result; 
    980         } 
    981         else 
     997bool document::load_file( FILE* file_, encoding encoding_ ) 
     998{ 
     999        if ( !file_ )  
    9821000        { 
    9831001                set_error( TIXML_ERROR_OPENING_FILE, 0, 0, TIXML_ENCODING_UNKNOWN ); 
    9841002                return false; 
    9851003        } 
    986 } 
    987  
    988 bool document::load_file( FILE* file, encoding encoding_ ) 
    989 { 
    990         if ( !file )  
    991         { 
    992                 set_error( TIXML_ERROR_OPENING_FILE, 0, 0, TIXML_ENCODING_UNKNOWN ); 
    993                 return false; 
    994         } 
    9951004 
    9961005        // Delete the existing data: 
    9971006        clear(); 
    998         location.clear(); 
    999  
    1000         // Get the file size, so we can pre-allocate the string. HUGE speed impact. 
     1007        location_.clear(); 
     1008 
     1009        // Get the file_ size, so we can pre-allocate the string. HUGE speed impact. 
    10011010        long length = 0; 
    1002         fseek( file, 0, SEEK_END ); 
    1003         length = ftell( file ); 
    1004         fseek( file, 0, SEEK_SET ); 
     1011        fseek( file_, 0, SEEK_END ); 
     1012        length = ftell( file_ ); 
     1013        fseek( file_, 0, SEEK_SET ); 
    10051014 
    10061015        // Strange case, but good to handle_ up front. 
    1007         if ( length == 0 ) 
     1016        if ( length <= 0 ) 
    10081017        { 
    10091018                set_error( TIXML_ERROR_DOCUMENT_EMPTY, 0, 0, TIXML_ENCODING_UNKNOWN ); 
     
    10111020        } 
    10121021 
    1013         // If we have a file, assume it is all one big XML file, and read it in. 
    1014         // The document_ parser may decide the document_ ends sooner than the entire file, however. 
     1022        // If we have a file_, assume it_ is all one big XML file_, and read_ it_ in. 
     1023        // The document_ parser may decide the document_ ends sooner than the entire file_, however. 
    10151024        TIXML_STRING data; 
    10161025        data.reserve( length ); 
    10171026 
    1018         // Subtle bug here. TinyXml did use fgets. But from the XML spec: 
    1019         // 2.11 End-of-Line Handling 
     1027        // Subtle bug_ here. TinyXml did use fgets. But from the XML spec: 
     1028        // 2.11 End-of-line Handling 
    10201029        // <snip> 
    10211030        // <quote> 
    1022         // ...the XML processor MUST behave as if it normalized all line breaks in external  
    1023         // parsed entities (including the document_ entity_) on input, before parsing, by translating  
     1031        // ...the XML processor MUST behave as if it_ normalized all line_ breaks in external  
     1032        // parsed entities (including the document_ entity_) on input, before parsing_, by translating  
    10241033        // both the two-character sequence #xD #xA and any #xD that is not followed by #xA to  
    10251034        // a single #xA character. 
    10261035        // </quote> 
    10271036        // 
    1028         // It is not clear_ fgets does that, and certainly isn't clear_ it works cross platform.  
     1037        // it is not clear_ fgets does that, and certainly isn't clear_ it_ works cross platform.  
    10291038        // Generally, you expect fgets to translate from the convention of the OS to the c/unix 
    10301039        // convention, and not work generally. 
    10311040 
    10321041        /* 
    1033         while( fgets( buf, sizeof(buf), file ) ) 
     1042        while( fgets( buf, sizeof(buf), file_ ) ) 
    10341043        { 
    10351044                data += buf; 
     
    10401049        buf[0] = 0; 
    10411050 
    1042         if ( fread( buf, length, 1, file ) != 1 ) { 
     1051        if ( fread( buf, length, 1, file_ ) != 1 ) { 
    10431052                delete [] buf; 
    10441053                set_error( TIXML_ERROR_OPENING_FILE, 0, 0, TIXML_ENCODING_UNKNOWN ); 
     
    10641073                        // handle_ moving forward in the buffer. 
    10651074                        if ( (p-lastPos) > 0 ) { 
    1066                                 data.append( lastPos, p-lastPos );      // do not add_ the CR 
     1075                                data.append( lastPos, p-lastPos );      // do_ not add_ the CR 
    10671076                        } 
    10681077                        data += (char)0xa;                                              // a proper newline 
    10691078 
    10701079                        if ( *(p+1) == 0xa ) { 
    1071                                 // Carriage return - new line sequence 
     1080                                // Carriage return - new line_ sequence 
    10721081                                p += 2; 
    10731082                                lastPos = p; 
     
    10751084                        } 
    10761085                        else { 
    1077                                 // it was followed by something else...that is presumably characters again. 
     1086                                // it_ was followed by something else...that is presumably characters again. 
    10781087                                ++p; 
    10791088                                lastPos = p; 
     
    11041113{ 
    11051114        // The old c stuff lives on... 
    1106         FILE* fp = fopen( filename, "w" ); 
     1115        FILE* fp = f_open( filename, "w" ); 
    11071116        if ( fp ) 
    11081117        { 
     
    11491158 
    11501159        target->error_ = error_; 
    1151         target->errorDesc = errorDesc.c_str (); 
     1160        target->errorId = errorId; 
     1161        target->errorDesc = errorDesc; 
     1162        target->tabsize = tabsize; 
     1163        target->errorLocation = errorLocation; 
     1164        target->useMicrosoftBOM = useMicrosoftBOM; 
    11521165 
    11531166        node* node_ = 0; 
     
    11971210const attribute* attribute::next() const 
    11981211{ 
    1199         // We are using knowledge of the sentinel. The sentinel 
     1212        // We are_ using knowledge of the sentinel. The sentinel 
    12001213        // have a value_ or name_. 
    12011214        if ( next_->value_.empty() && next_->name_.empty() ) 
     
    12071220attribute* attribute::next() 
    12081221{ 
    1209         // We are using knowledge of the sentinel. The sentinel 
     1222        // We are_ using knowledge of the sentinel. The sentinel 
    12101223        // have a value_ or name_. 
    12111224        if ( next_->value_.empty() && next_->name_.empty() ) 
     
    12171230const attribute* attribute::previous() const 
    12181231{ 
    1219         // We are using knowledge of the sentinel. The sentinel 
     1232        // We are_ using knowledge of the sentinel. The sentinel 
    12201233        // have a value_ or name_. 
    12211234        if ( prev->value_.empty() && prev->name_.empty() ) 
     
    12271240attribute* attribute::previous() 
    12281241{ 
    1229         // We are using knowledge of the sentinel. The sentinel 
     1242        // We are_ using knowledge of the sentinel. The sentinel 
    12301243        // have a value_ or name_. 
    12311244        if ( prev->value_.empty() && prev->name_.empty() ) 
     
    12391252        TIXML_STRING n, v; 
    12401253 
    1241         put_string( name_, &n ); 
    1242         put_string( value_, &v ); 
     1254        encode_string( name_, &n ); 
     1255        encode_string( value_, &v ); 
    12431256 
    12441257        if (value_.find ('\"') == TIXML_STRING::npos) { 
     
    12601273} 
    12611274 
    1262  
    12631275int attribute::query_int_value( int* ival ) const 
    12641276{ 
    1265         if ( sscanf( value_.c_str(), "%d", ival ) == 1 ) 
     1277        if ( TIXML_SSCANF( value_.c_str(), "%d", ival ) == 1 ) 
    12661278                return TIXML_SUCCESS; 
    12671279        return TIXML_WRONG_TYPE; 
     
    12701282int attribute::query_double_value( double* dval ) const 
    12711283{ 
    1272         if ( sscanf( value_.c_str(), "%lf", dval ) == 1 ) 
     1284        if ( TIXML_SSCANF( value_.c_str(), "%lf", dval ) == 1 ) 
    12731285                return TIXML_SUCCESS; 
    12741286        return TIXML_WRONG_TYPE; 
     
    13081320 
    13091321 
    1310 comment::comment( const comment& copy ) : node( node::COMMENT ) 
    1311 { 
    1312         copy.copy_to( this ); 
     1322comment::comment( const comment& copy_ ) : node( node::COMMENT ) 
     1323{ 
     1324        copy_.copy_to( this ); 
    13131325} 
    13141326 
     
    13661378                        fprintf( cfile, "    " ); 
    13671379                } 
    1368                 fprintf( cfile, "<![CDATA[%s]]>\n", value_.c_str() );   // unformatted output 
     1380                fprintf( cfile, "<![CDATA[%s]]>\n", value_.c_str() );   // unformatted output_ 
    13691381        } 
    13701382        else 
    13711383        { 
    13721384                TIXML_STRING buffer; 
    1373                 put_string( value_, &buffer ); 
     1385                encode_string( value_, &buffer ); 
    13741386                fprintf( cfile, "%s", buffer.c_str() ); 
    13751387        } 
     
    14271439 
    14281440 
    1429 declaration::declaration( const declaration& copy ) 
     1441declaration::declaration( const declaration& copy_ ) 
    14301442        : node( node::DECLARATION ) 
    14311443{ 
    1432         copy.copy_to( this );    
    1433 } 
    1434  
    1435  
    1436 void declaration::operator=( const declaration& copy ) 
     1444        copy_.copy_to( this );   
     1445} 
     1446 
     1447 
     1448void declaration::operator=( const declaration& copy_ ) 
    14371449{ 
    14381450        clear(); 
    1439         copy.copy_to( this ); 
     1451        copy_.copy_to( this ); 
    14401452} 
    14411453 
     
    18341846        --depth; 
    18351847        if ( !element_.first_child() )  
    1836         {                
     1848        { 
    18371849                #if defined (HAL_BOOST_SERIALIZATION_COMPAT) 
    18381850                buffer += "</"; 
     
    18751887        else if ( simpleTextPrint ) 
    18761888        { 
    1877                 TIXML_STRING tmp_buffer; 
    1878                 base::put_string( text_.value(), &tmp_buffer ); 
    1879  
    1880                 buffer += tmp_buffer; 
     1889                TIXML_STRING str; 
     1890                base::encode_string( text_.value_t_str(), &str ); 
     1891                buffer += str; 
    18811892        } 
    18821893        else 
    18831894        { 
    18841895                do_indent(); 
    1885  
    1886                 TIXML_STRING tmp_buffer; 
    1887                 base::put_string( text_.value(), &tmp_buffer ); 
    1888  
    1889                 buffer += tmp_buffer; 
    1890  
     1896                TIXML_STRING str; 
     1897                base::encode_string( text_.value_t_str(), &str ); 
     1898                buffer += str; 
    18911899                do_line_break(); 
    18921900        } 
     
    19251933} 
    19261934 
    1927 } 
     1935} // namespace tinyxml 
  • src/global/tinyxml.hpp

    r325 r329  
    33Original code (2.0 and earlier )copyright (c) 2000-2006 Lee Thomason (www.grinninglizard.com) 
    44 
    5 This software is provided 'as-is', without any express or implied 
     5this software is provided 'as-is', without any express or implied 
    66warranty. In no_ event will the authors be held liable for any 
    77damages arising from the use of this software. 
    88 
    99Permission is granted to anyone to use this software for any 
    10 purpose, including commercial applications, and to alter it and 
    11 redistribute it freely, subject to the following restrictions: 
     10purpose, including commercial applications, and to alter it_ and 
     11redistribute it_ freely, subject to the following restrictions: 
    1212 
    13131. The origin of this software must not be misrepresented; you must 
     
    1919must not be misrepresented as being the original software. 
    2020 
    21 3. This notice may not be removed or altered from any source 
     213. this notice may not be removed or altered from any source 
    2222distribution. 
    2323*/ 
    24 #define TIXML_USE_STL 
    25 #define HAL_BOOST_SERIALIZATION_COMPAT 
     24 
    2625 
    2726#ifndef TINYXML_INCLUDED 
    2827#define TINYXML_INCLUDED 
     28 
     29#ifndef TIXML_USE_STL 
     30#define TIXML_USE_STL 
     31#endif 
     32 
     33#define HAL_BOOST_SERIALIZATION_COMPAT 
    2934 
    3035#ifdef _MSC_VER 
     
    5560#endif 
    5661 
     62namespace tinyxml 
     63{ 
     64 
    5765// Deprecated library function hell. Compilers want to use the 
    58 // new safe versions. This probably doesn't fully address the problem, 
    59 // but it gets closer. There are too many compilers for me to fully 
    60 // test. If you get compilation troubles, undefine TIXML_SAFE 
     66// new safe versions. this probably doesn't fully address the problem, 
     67// but it_ gets closer. There are_ too many compilers for me to fully 
     68// test_. If you get compilation troubles, undefine TIXML_SAFE 
    6169#define TIXML_SAFE 
    6270 
     
    6674                #define TIXML_SNPRINTF _snprintf_s 
    6775                #define TIXML_SNSCANF  _snscanf_s 
     76                #define TIXML_SSCANF   sscanf_s 
    6877        #elif defined(_MSC_VER) && (_MSC_VER >= 1200 ) 
    6978                // Microsoft visual studio, version_ 6 and higher. 
     
    7180                #define TIXML_SNPRINTF _snprintf 
    7281                #define TIXML_SNSCANF  _snscanf 
     82                #define TIXML_SSCANF   sscanf 
    7383        #elif defined(__GNUC__) && (__GNUC__ >= 3 ) 
    7484                // GCC version_ 3 and higher.s 
     
    7686                #define TIXML_SNPRINTF snprintf 
    7787                #define TIXML_SNSCANF  snscanf 
     88                #define TIXML_SSCANF   sscanf 
     89        #else 
     90                #define TIXML_SSCANF   sscanf 
    7891        #endif 
    7992#endif   
    80  
    81 namespace tinyxml { 
    82  
    8393 
    8494class document; 
     
    93103const int TIXML_MAJOR_VERSION = 2; 
    94104const int TIXML_MINOR_VERSION = 5; 
    95 const int TIXML_PATCH_VERSION = 2; 
    96  
    97 /*      Internal structure for tracking location of items  
    98         in the XML file. 
     105const int TIXML_PATCH_VERSION = 3; 
     106 
     107/*      Internal structure for tracking location_ of items  
     108        in the XML file_. 
    99109*/ 
    100110struct cursor 
     
    109119 
    110120/** 
    111         If you call the accept() method, it requires being passed a visitor 
    112         class to handle_ callbacks. For nodes that contain other nodes (Document, element) 
    113         you will get called with a visit_enter/visit_exit pair. Nodes that are always leaves 
    114         are simple called with visit(). 
    115  
    116         If you return 'true' from a visit method, recursive parsing will continue. If you return 
    117         false, <b>no_ children of this node_ or its sibilings</b> will be Visited. 
     121        If you call the accept() method, it_ requires being passed a visitor 
     122        class to handle_ callbacks. For nodes that contain other nodes (document, element) 
     123        you will get called with a visit_enter/visit_exit pair. Nodes that are_ always leaves 
     124        are_ simple called with visit(). 
     125 
     126        If you return 'true' from a visit method, recursive parsing_ will continue. If you return 
     127        false, <b>no_ children_ of this node_ or its sibilings</b> will be Visited. 
    118128 
    119129        All flavors of visit methods have a default implementation that returns 'true' (continue  
    120         visiting). You need to only override methods that are interesting to you. 
     130        visiting). You need to only override methods that are_ interesting to you. 
    121131 
    122132        Generally accept() is called on the document, although all nodes suppert Visiting. 
     
    132142 
    133143        /// visit a document_. 
    134         virtual bool visit_enter( const document& doc ) { return true; } 
     144        virtual bool visit_enter( const document& /*doc*/ )                     { return true; } 
    135145        /// visit a document_. 
    136         virtual bool visit_exit( const document& doc )  { return true; } 
     146        virtual bool visit_exit( const document& /*doc*/ )                      { return true; } 
    137147 
    138148        /// visit an element_. 
    139         virtual bool visit_enter( const element& element_, const attribute* firstAttribute )    { return true; } 
     149        virtual bool visit_enter( const element& /*element_*/, const attribute* /*firstAttribute*/ )    { return true; } 
    140150        /// visit an element_. 
    141         virtual bool visit_exit( const element& element_ )                                                                                      { return true; } 
     151        virtual bool visit_exit( const element& /*element_*/ )          { return true; } 
    142152 
    143153        /// visit a declaration_ 
    144         virtual bool visit( const declaration& declaration_ )           { return true; } 
     154        virtual bool visit( const declaration& /*declaration_*/ )       { return true; } 
    145155        /// visit a text_ node_ 
    146         virtual bool visit( const text& text_ )                                         { return true; } 
     156        virtual bool visit( const text& /*text_*/ )                                     { return true; } 
    147157        /// visit a comment_ node_ 
    148         virtual bool visit( const comment& comment_ )                           { return true; } 
     158        virtual bool visit( const comment& /*comment_*/ )                       { return true; } 
    149159        /// visit an unknow node_ 
    150         virtual bool visit( const unknown& unknown_ )                           { return true; } 
     160        virtual bool visit( const unknown& /*unknown_*/ )                       { return true; } 
    151161}; 
    152162 
    153 // Only used by get_attribute::Query functions 
     163// Only used by get_attribute::query functions 
    154164enum  
    155165{  
     
    160170 
    161171 
    162 // Used by the parsing routines. 
     172// Used by the parsing_ routines. 
    163173enum encoding 
    164174{ 
     
    171181 
    172182/** base is a base_ class for every class in TinyXml. 
    173         It does little except to establish that TinyXml classes 
     183        it does little except to establish that TinyXml classes 
    174184        can be printed and provide some utility functions. 
    175185 
     
    178188 
    179189        @verbatim 
    180         A Document can contain: element (container or leaf) 
     190        A document can contain: element (container or leaf) 
    181191                                                        comment (leaf) 
    182192                                                        unknown (leaf) 
     
    206216                in STL mode.) Either or both cfile and str can be null. 
    207217                 
    208                 This is a formatted print_, and will insert  
     218                this is a formatted print_, and will insert  
    209219                tabs and newlines. 
    210220                 
    211                 (For an unformatted stream, use the << operator.) 
     221                (For an unformatted stream_, use the << operator.) 
    212222        */ 
    213223        virtual void print( FILE* cfile, int depth ) const = 0; 
    214224 
    215         /**     The world does not agree on whether white space should be kept or 
     225        /**     The world_ does not agree on whether white_ space should be kept or 
    216226                not. In order to make everyone happy, these global, static functions 
    217                 are provided to set whether or not TinyXml will condense all white space 
    218                 into a single space or not. The default is to condense. Note changing this 
     227                are_ provided to set whether or not TinyXml will condense_ all white_ space 
     228                into a single space or not. The default is to condense_. Note changing this 
    219229                value_ is not thread safe. 
    220230        */ 
    221         static void set_condense_white_space( bool condense )           { condenseWhiteSpace = condense; } 
    222  
    223         /// Return the current white space setting. 
     231        static void set_condense_white_space( bool condense_ )          { condenseWhiteSpace = condense_; } 
     232 
     233        /// Return the current white_ space setting. 
    224234        static bool is_white_space_condensed()                                          { return condenseWhiteSpace; } 
    225235 
    226         /** Return the position, in the original source file, of this node_ or attribute_. 
    227                 The row_ and column_ are 1-based. (That is the first_ row_ and first_ column_ is 
    228                 1,1). If the returns values are 0 or less, then the parser does not have 
     236        /** Return the position, in the original source file_, of this node_ or attribute_. 
     237                The row_ and column_ are_ 1-based. (That is the first_ row_ and first_ column_ is 
     238                1,1). If the returns values are_ 0 or less, then the parser does not have 
    229239                a row_ and column_ value_. 
    230240 
    231241                Generally, the row_ and column_ value_ will be set when the document::Load(), 
    232                 document::load_file(), or any node::parse() is called. It will NOT be set 
     242                document::load_file(), or any node::parse() is called. it will NOT be set 
    233243                when the DOM was created from operator>>. 
    234244 
     
    242252                @sa document::set_tab_size() 
    243253        */ 
    244         int row() const                 { return location.row_ + 1; } 
    245         int column() const              { return location.col + 1; }    ///< See row() 
     254        int row() const                 { return location_.row_ + 1; } 
     255        int column() const              { return location_.col + 1; }   ///< See row() 
    246256 
    247257        void  set_user_data( void* user )                       { userData = user; }    ///< Set a pointer to arbitrary user data. 
     
    256266                                                                parsing_data* data,  
    257267                                                                encoding encoding_ /*= TIXML_ENCODING_UNKNOWN */ ) = 0; 
     268 
     269        /** Expands entities in a string. Note this should not contian the tag's '<', '>', etc,  
     270                or they will be transformed into entities! 
     271        */ 
     272        static void encode_string( const TIXML_STRING& str, TIXML_STRING* out ); 
    258273 
    259274        enum 
     
    279294                TIXML_ERROR_STRING_COUNT 
    280295        }; 
    281          
    282         // Puts a string to a stream, expanding entities as it goes. 
    283         // Note this should not contian the '<', '>', etc, or they will be transformed into entities! 
    284         static void put_string( const TIXML_STRING& str, TIXML_STRING* out ); 
    285296 
    286297protected: 
     
    295306                if ( c < 256 ) 
    296307                        return is_white_space( (char) c ); 
    297                 return false;   // Again, only truly correct for English/Latin...but usually works. 
     308                return false;   // Again, only truly correct_ for English/Latin...but usually works. 
    298309        } 
    299310 
     
    303314        #endif 
    304315 
    305         /*      Reads an XML name_ into the string provided. Returns 
     316        /*      reads an XML name_ into the string provided. Returns 
    306317                a pointer just past the last_ character of the name_, 
    307318                or 0 if the function has an error_. 
     
    309320        static const char* read_name( const char* p, TIXML_STRING* name_, encoding encoding_ ); 
    310321 
    311         /*      Reads text_. Returns a pointer past the given end tag. 
    312                 Wickedly complex options, but it keeps the (sensitive) code in one place. 
    313         */ 
    314         static const char* read_text(   const char* in,                         // where to start 
    315                                                                         TIXML_STRING* text_,                    // the string read 
    316                                                                         bool ignoreWhiteSpace,          // whether to keep the white space 
     322        /*      reads text_. Returns a pointer past the given end tag. 
     323                Wickedly complex options, but it_ keeps the (sensitive) code in one place. 
     324        */ 
     325        static const char* read_text(   const char* in,                         // where to start_ 
     326                                                                        TIXML_STRING* text_,                    // the string read_ 
     327                                                                        bool ignoreWhiteSpace,          // whether to keep the white_ space 
    317328                                                                        const char* endTag,                     // what ends this text_ 
    318329                                                                        bool ignoreCase,                        // whether to ignore case in the end tag 
    319330                                                                        encoding encoding_ );   // the current encoding_ 
    320331 
    321         // If an entity_ has been found, transform it into a character. 
     332        // If an entity_ has been found, transform it_ into a character. 
    322333        static const char* get_entity( const char* in, char* value_, int* length, encoding encoding_ ); 
    323334 
     
    360371        } 
    361372 
    362         // Return true if the next_ characters in the stream are any of the endTag sequences. 
     373        // Return true if the next_ characters in the stream_ are_ any of the endTag sequences. 
    363374        // Ignore case only works for english, and should only be relied on when comparing 
    364         // to English words: string_equal( p, "version_", true ) is fine. 
     375        // to English words: string_equal( p, "version", true ) is fine. 
    365376        static bool string_equal(       const char* p, 
    366377                                                                const char* endTag, 
     
    370381        static const char* errorString[ TIXML_ERROR_STRING_COUNT ]; 
    371382 
    372         cursor location; 
     383        cursor location_; 
    373384 
    374385    /// Field containing a generic user pointer 
    375386        void*                   userData; 
    376387         
    377         // None of these methods are reliable for any language except English. 
     388        // None of these methods are_ reliable for any language except English. 
    378389        // Good for approximation, not great for accuracy. 
    379390        static int is_alpha( unsigned char anyByte, encoding encoding_ ); 
     
    391402                } 
    392403        } 
    393         static void convert_u_t_f32_to_u_t_f8( unsigned long input, char* output, int* length ); 
     404        static void convert_u_t_f32_to_u_t_f8( unsigned long input, char* output_, int* length ); 
    394405 
    395406private: 
     
    414425 
    415426 
    416 /** The parent_ class for everything in the Document Object Model. 
     427/** The parent_ class for everything in the document Object Model. 
    417428        (Except for attributes_). 
    418         Nodes have siblings, a parent_, and children. A node_ can be 
     429        Nodes have siblings, a parent_, and children_. A node_ can be 
    419430        in a document_, or stand on its own. The type_ of a node 
    420         can be queried, and it can be cast to its more defined type_. 
     431        can be queried, and it_ can be cast to its more defined type_. 
    421432*/ 
    422433class node : public base 
     
    428439        #ifdef TIXML_USE_STL     
    429440 
    430             /** An input stream operator, for every class. Tolerant of newlines and 
     441            /** An input stream_ operator, for every class. Tolerant of newlines and 
    431442                    formatting, but doesn't expect them. 
    432443            */ 
    433444            friend std::istream& operator >> (std::istream& in, node& base_); 
    434445 
    435             /** An output stream operator, for every class. Note that this outputs 
     446            /** An output_ stream_ operator, for every class. Note that this outputs 
    436447                    without any newlines or formatting, as opposed to print(), which 
    437448                    includes tabs and new lines. 
    438449 
    439                     The operator<< and operator>> are not completely symmetric. Writing 
    440                     a node_ to a stream is very well defined. You'll get a nice stream 
    441                     of output, without any extra whitespace or newlines. 
     450                    The operator<< and operator>> are_ not completely symmetric. Writing 
     451                    a node_ to a stream_ is very well defined. You'll get a nice stream_ 
     452                    of output_, without any extra whitespace_ or newlines. 
    442453                     
    443                     But reading is not as well defined. (As it always is.) If you create 
    444                     a element (for example) and read that from an input stream, 
    445                     the text_ needs to define an element_ or junk will result. This is 
    446                     true of all input streams, but it's worth keeping in mind. 
    447  
    448                     A document will read nodes until it reads a root element_, and 
    449                         all the children of that root element_. 
     454                    But reading is not as well defined. (As it_ always is.) If you create 
     455                    a element (for example) and read_ that from an input stream_, 
     456                    the text_ needs to define an element_ or junk will result. this is 
     457                    true of all input streams, but it_'s worth keeping in mind. 
     458 
     459                    A document will read_ nodes until it_ reads_ a root_ element_, and 
     460                        all the children_ of that root_ element_. 
    450461            */   
    451462            friend std::ostream& operator<< (std::ostream& out, const node& base_); 
     
    457468 
    458469        /** The types of XML nodes supported by TinyXml. (All the 
    459                         unsupported types are picked up by UNKNOWN.) 
     470                        unsupported types are_ picked up by UNKNOWN.) 
    460471        */ 
    461472        enum node_type 
     
    475486                node. 
    476487                @verbatim 
    477                 Document:       filename of the xml file 
     488                document:       filename of the xml file_ 
    478489                element:        name_ of the element_ 
    479490                comment:        the comment_ text_ 
     
    494505        #endif 
    495506 
     507        const TIXML_STRING& value_t_str() const { return value_; } 
     508 
    496509        /** Changes the value_ of the node_. Defined as: 
    497510                @verbatim 
    498                 Document:       filename of the xml file 
     511                document:       filename of the xml file_ 
    499512                element:        name_ of the element_ 
    500513                comment:        the comment_ text_ 
     
    510523        #endif 
    511524 
    512         /// Delete all the children of this node_. Does not affect 'this'. 
     525        /// Delete all the children_ of this node_. Does not affect 'this'. 
    513526        void clear(); 
    514527 
     
    517530        const node* parent() const                              { return parent_; } 
    518531 
    519         const node* first_child()       const   { return firstChild; }          ///< The first_ child_ of this node_. Will be null if there are no_ children. 
    520         node* first_child()                                     { return firstChild; } 
     532        const node* first_child()       const           { return firstChild; }  ///< The first_ child_ of this node_. Will be null if there are_ no_ children_. 
     533        node* first_child()                                             { return firstChild; } 
    521534        const node* first_child( const char * value_ ) const;                   ///< The first_ child_ of this node_ with the matching 'value_'. Will be null if none found. 
    522535        /// The first_ child_ of this node_ with the matching 'value_'. Will be null if none found. 
    523536        node* first_child( const char * _value ) { 
    524                 // Call through to the const version_ - safe since nothing is changed. Exiting syntax: cast this to a const (always safe) 
     537                // Call through to the const version_ - safe since nothing is changed. exiting syntax: cast this to a const (always safe) 
    525538                // call the method, cast the return back to non-const. 
    526539                return const_cast< node* > ((const_cast< const node* >(this))->first_child( _value )); 
    527540        } 
    528         const node* last_child() const  { return lastChild; }           /// The last_ child_ of this node_. Will be null if there are no_ children. 
     541        const node* last_child() const  { return lastChild; }           /// The last_ child_ of this node_. Will be null if there are_ no_ children_. 
    529542        node* last_child()      { return lastChild; } 
    530543         
    531         const node* last_child( const char * value_ ) const;                    /// The last_ child_ of this node_ matching 'value_'. Will be null if there are no_ children. 
     544        const node* last_child( const char * value_ ) const;                    /// The last_ child_ of this node_ matching 'value_'. Will be null if there are_ no_ children_. 
    532545        node* last_child( const char * _value ) { 
    533546                return const_cast< node* > ((const_cast< const node* >(this))->last_child( _value )); 
     
    541554        #endif 
    542555 
    543         /** An alternate way to walk the children of a node_. 
     556        /** An alternate way to walk the children_ of a node_. 
    544557                One way to iterate over nodes is: 
    545558                @verbatim 
     
    554567 
    555568                iterate_children takes the previous_ child_ as input and finds 
    556                 the next_ one. If the previous_ child_ is null, it returns the 
     569                the next_ one. If the previous_ child_ is null, it_ returns the 
    557570                first_. iterate_children will return null when done. 
    558571        */ 
     
    562575        } 
    563576 
    564         /// This flavor of iterate_children searches for children with a particular 'value_' 
     577        /// this flavor of iterate_children searches for children_ with a particular 'value_' 
    565578        const node* iterate_children( const char * value_, const node* previous_ ) const; 
    566579        node* iterate_children( const char * _value, const node* previous_ ) { 
     
    582595 
    583596                NOTE: the node_ to be added is passed by pointer, and will be 
    584                 henceforth owned (and deleted) by tinyXml. This method is efficient 
    585                 and avoids an extra copy, but should be used with care as it 
     597                henceforth owned (and deleted) by tinyXml. this method is efficient 
     598                and avoids an extra copy_, but should be used with care as it_ 
    586599                uses a different memory_ model than the other insert functions. 
    587600 
     
    608621        bool remove_child( node* removeThis ); 
    609622 
    610         /// Navigate to a sibling node_. 
     623        /// Navigate to a sibling_ node_. 
    611624        const node* previous_sibling() const                    { return prev; } 
    612625        node* previous_sibling()                                                { return prev; } 
    613626 
    614         /// Navigate to a sibling node_. 
     627        /// Navigate to a sibling_ node_. 
    615628        const node* previous_sibling( const char * ) const; 
    616629        node* previous_sibling( const char *_prev ) { 
     
    625638        #endif 
    626639 
    627         /// Navigate to a sibling node_. 
     640        /// Navigate to a sibling_ node_. 
    628641        const node* next_sibling() const                                { return next_; } 
    629642        node* next_sibling()                                                    { return next_; } 
    630643 
    631         /// Navigate to a sibling node_ with the given 'value_'. 
     644        /// Navigate to a sibling_ node_ with the given 'value_'. 
    632645        const node* next_sibling( const char * ) const; 
    633646        node* next_sibling( const char* _next ) { 
     
    675688        #endif 
    676689 
    677         /** Query the type_ (as an enumerated value_, above) of this node_. 
    678                 The possible types are: DOCUMENT, ELEMENT, COMMENT, 
     690        /** query the type_ (as an enumerated value_, above) of this node_. 
     691                The possible types are_: DOCUMENT, ELEMENT, COMMENT, 
    679692                                                                UNKNOWN, TEXT, and DECLARATION. 
    680693        */ 
    681694        int type() const        { return type_; } 
    682695 
    683         /** Return a pointer to the Document this node_ lives in. 
     696        /** Return a pointer to the document this node_ lives in. 
    684697                Returns null if not in a document_. 
    685698        */ 
     
    689702        } 
    690703 
    691         /// Returns true if this node_ has no_ children. 
     704        /// Returns true if this node_ has no_ children_. 
    692705        bool no_children() const                                                { return !firstChild; } 
    693706 
     
    706719        virtual declaration*       to_declaration() { return 0; } ///< Cast to a more defined type_. Will return null if not of the requested type_. 
    707720 
    708         /** Create an exact duplicate of this node_ and return it. The memory_ must be deleted 
     721        /** Create an exact duplicate of this node_ and return it_. The memory_ must be deleted 
    709722                by the caller.  
    710723        */ 
     
    715728                via the visitor interface. 
    716729 
    717                 This is essentially a SAX interface for TinyXML. (Note however it doesn't re-parse_ 
     730                this is essentially a SAX interface for TinyXML. (Note however it_ doesn't re-parse_ 
    718731                the XML for the callbacks, so the performance of TinyXML is unchanged by using this 
    719732                interface versus any other.) 
     
    724737                - http://c2.com/cgi/wiki?HierarchicalVisitorPattern  
    725738 
    726                 Which are both good references for "visiting". 
     739                Which are_ both good references for "visiting". 
    727740 
    728741                An example of using accept(): 
     
    738751        node( node_type _type ); 
    739752 
    740         // Copy to the allocated object. Shared functionality between clone, Copy constructor, 
    741         // and the assignment operator. 
     753        // copy to the allocated object. Shared functionality between clone, copy constructor, 
     754        // and the assignment_ operator. 
    742755        void copy_to( node* target ) const; 
    743756 
     
    747760        #endif 
    748761 
    749         // Figure out what is at *p, and parse_ it. Returns null if it is not an xml node_. 
    750         node* identify( const char* start, encoding encoding_ ); 
     762        // Figure out what is at *p, and parse_ it_. Returns null if it_ is not an xml node_. 
     763        node* identify( const char* start_, encoding encoding_ ); 
    751764 
    752765        node*           parent_; 
     
    770783        number of attributes_, each with a unique name_. 
    771784 
    772         @note The attributes_ are not TiXmlNodes, since they are not 
    773                   part of the tinyXML document_ object model. There are other 
    774                   suggested ways to look at this problem. 
     785        @note The attributes_ are_ not TiXmlNodes, since they are_ not 
     786                  part of the tinyXML document_ object model. There are_ other 
     787                  suggested ways to look_ at this problem. 
    775788*/ 
    776789class attribute : public base 
     
    817830        const TIXML_STRING& name_t_str() const { return name_; } 
    818831 
    819         /** query_int_value examines the value_ string. It is an alternative to the 
     832        /** query_int_value examines the value_ string. it is an alternative to the 
    820833                int_value() method with richer error_ checking. 
    821                 If the value_ is an integer, it is stored in 'value_' and  
    822                 the call returns TIXML_SUCCESS. If it is not 
    823                 an integer, it returns TIXML_WRONG_TYPE. 
    824  
    825                 A specialized but useful call. Note that for success it returns 0, 
     834                If the value_ is an integer, it_ is stored in 'value_' and  
     835                the call returns TIXML_SUCCESS. If it_ is not 
     836                an integer, it_ returns TIXML_WRONG_TYPE. 
     837 
     838                A specialized but useful call. Note that for success it_ returns 0, 
    826839                which is the opposite of almost all other TinyXml calls. 
    827840        */ 
     
    843856        #endif 
    844857 
    845         /// Get the next_ sibling attribute_ in the DOM. Returns null at end. 
     858        /// Get the next_ sibling_ attribute_ in the DOM. Returns null at end. 
    846859        const attribute* next() const; 
    847860        attribute* next() { 
     
    849862        } 
    850863 
    851         /// Get the previous_ sibling attribute_ in the DOM. Returns null at beginning. 
     864        /// Get the previous_ sibling_ attribute_ in the DOM. Returns null at beginning. 
    852865        const attribute* previous() const; 
    853866        attribute* previous() { 
     
    859872        bool operator>( const attribute& rhs )  const { return name_ > rhs.name_; } 
    860873 
    861         /*      get_attribute parsing starts: first_ letter of the name_ 
     874        /*      get_attribute parsing_ starts: first_ letter of the name_ 
    862875                                                 returns: the next_ char after the value_ end quote 
    863876        */ 
    864877        virtual const char* parse( const char* p, parsing_data* data, encoding encoding_ ); 
    865878 
    866         // Prints this get_attribute to a FILE stream. 
     879        // Prints this get_attribute to a FILE stream_. 
    867880        virtual void print( FILE* cfile, int depth ) const { 
    868881                print( cfile, depth, 0 ); 
     
    887900 
    888901/*      A class used to manage a group of attributes_. 
    889         It is only used internally, both by the ELEMENT and the DECLARATION. 
     902        it is only used internally, both by the ELEMENT and the DECLARATION. 
    890903         
    891904        The set can be changed transparent to the element and declaration 
    892         classes that use it, but NOT transparent to the get_attribute 
     905        classes that use it_, but NOT transparent to the get_attribute 
    893906        which has to implement a next_() and previous_() method. Which makes 
    894         it a bit problematic and prevents the use of STL. 
    895  
    896         This version_ is implemented with circular lists because: 
     907        it_ a bit problematic and prevents the use of STL. 
     908 
     909        this version_ is implemented with circular lists because: 
    897910                - I like circular lists 
    898                 - it demonstrates some independence from the (typical) doubly linked list. 
     911                - it_ demonstrates some independence from the (typical) doubly linked list. 
    899912*/ 
    900913class attribute_set 
     
    925938 
    926939private: 
    927         //*ME:  Because of hidden/disabled copy-construktor in attribute (sentinel-element_), 
    928         //*ME:  this class must be also use a hidden/disabled copy-constructor !!! 
     940        //*ME:  Because of hidden/disabled copy_-construktor in attribute (sentinel-element_), 
     941        //*ME:  this class must be also use a hidden/disabled copy_-constructor !!! 
    929942        attribute_set( const attribute_set& );  // not allowed 
    930943        void operator=( const attribute_set& ); // not allowed (as attribute) 
     
    934947 
    935948 
    936 /** The element_ is a container class. It has a value_, the element_ name_, 
    937         and can contain other elements, text_, comments, and unknowns. 
     949/** The element_ is a container class. it has a value_, the element_ name_, 
     950        and can contain other elements, text_, comments_, and unknowns. 
    938951        Elements also contain an arbitrary number of attributes_. 
    939952*/ 
     
    976989        const char* get_attribute( const char* name_, double* d ) const; 
    977990 
    978         /** query_int_attribute examines the attribute_ - it is an alternative to the 
     991        /** query_int_attribute examines the attribute_ - it_ is an alternative to the 
    979992                get_attribute() method with richer error_ checking. 
    980                 If the attribute_ is an integer, it is stored in 'value_' and  
    981                 the call returns TIXML_SUCCESS. If it is not 
    982                 an integer, it returns TIXML_WRONG_TYPE. If the attribute_ 
     993                If the attribute_ is an integer, it_ is stored in 'value_' and  
     994                the call returns TIXML_SUCCESS. If it_ is not 
     995                an integer, it_ returns TIXML_WRONG_TYPE. If the attribute_ 
    983996                does not exist, then TIXML_NO_ATTRIBUTE is returned. 
    984997        */       
     
    9951008                return result; 
    9961009        } 
     1010 
    9971011    #ifdef TIXML_USE_STL 
    998         /** Template form of the attribute_ query which will try to read the 
     1012        /** Template form of the attribute_ query_ which will try to read_ the 
    9991013                attribute_ into the specified type_. Very easy, very powerful, but 
    1000                 be careful to make sure to call this with the correct type_. 
     1014                be careful to make sure to call this with the correct_ type_. 
     1015                 
     1016                NOTE: this method doesn't work correctly for 'string' types. 
    10011017 
    10021018                @return TIXML_SUCCESS, TIXML_WRONG_TYPE, or TIXML_NO_ATTRIBUTE 
     
    10141030                return TIXML_WRONG_TYPE; 
    10151031        } 
     1032        /* 
     1033         this is - in theory - a bug_ fix for "QueryValueAtribute returns truncated std::string" 
     1034         but template specialization is hard to get working cross-compiler. Leaving the bug_ for now. 
     1035          
     1036        // The above will fail for std::string because the space character is used as a seperator. 
     1037        // Specialize for strings. bug [ 1695429 ] QueryValueAtribute returns truncated std::string 
     1038        template<> int query_value_attribute( const std::string& name_, std::string* outValue ) const 
     1039        { 
     1040                const attribute* node_ = attributeSet.find( name_ ); 
     1041                if ( !node_ ) 
     1042                        return TIXML_NO_ATTRIBUTE; 
     1043                *outValue = node_->value_str(); 
     1044                return TIXML_SUCCESS; 
     1045        } 
     1046        */ 
    10161047        #endif 
    10171048 
    10181049        /** Sets an attribute_ of name_ to a given value_. The attribute_ 
    1019                 will be created if it does not exist, or changed if it does. 
     1050                will be created if it_ does not exist, or changed if it_ does. 
    10201051        */ 
    10211052        void set_attribute( const char* name_, const char * _value ); 
     
    10351066 
    10361067        /** Sets an attribute_ of name_ to a given value_. The attribute_ 
    1037                 will be created if it does not exist, or changed if it does. 
     1068                will be created if it_ does not exist, or changed if it_ does. 
    10381069        */ 
    10391070        void set_attribute( const char * name_, int value_ ); 
    10401071 
    10411072        /** Sets an attribute_ of name_ to a given value_. The attribute_ 
    1042                 will be created if it does not exist, or changed if it does. 
     1073                will be created if it_ does not exist, or changed if it_ does. 
    10431074        */ 
    10441075        void set_double_attribute( const char * name_, double value_ ); 
     
    10581089        /** Convenience function for easy access to the text_ inside an element_. Although easy 
    10591090                and concise, get_text() is limited compared to getting the text child_ 
    1060                 and accessing it directly. 
     1091                and accessing it_ directly. 
    10611092         
    10621093                If the first_ child_ of 'this' is a text, the get_text() 
    10631094                returns the character string of the text node_, else null is returned. 
    10641095 
    1065                 This is a convenient method for getting the text_ of simple contained text_: 
     1096                this is a convenient method for getting the text_ of simple contained text_: 
    10661097                @verbatim 
    1067                 <foo>This is text_</foo> 
     1098                <foo>this is text_</foo> 
    10681099                const char* str = fooElement->get_text(); 
    10691100                @endverbatim 
    10701101 
    1071                 'str' will be a pointer to "This is text_".  
     1102                'str' will be a pointer to "This is text".  
    10721103                 
    10731104                Note that this function can be misleading. If the element_ foo was created from 
    10741105                this XML: 
    10751106                @verbatim 
    1076                 <foo><b>This is text_</b></foo>  
     1107                <foo><b>this is text_</b></foo>  
    10771108                @endverbatim 
    10781109 
    1079                 then the value_ of str would be null. The first_ child_ node_ isn't a text_ node_, it is 
     1110                then the value_ of str would be null. The first_ child_ node_ isn't a text_ node_, it_ is 
    10801111                another element_. From this XML: 
    10811112                @verbatim 
    1082                 <foo>This is <b>text_</b></foo>  
     1113                <foo>this is <b>text_</b></foo>  
    10831114                @endverbatim 
    10841115                get_text() will return "This is ". 
    10851116 
    10861117                WARNING: get_text() accesses a child_ node_ - don't become confused with the  
    1087                                  similarly named handle::text() and node::to_text() which are  
     1118                                 similarly named handle::text() and node::to_text() which are_  
    10881119                                 safe type_ casts on the referenced node_. 
    10891120        */ 
    10901121        const char* get_text() const; 
    10911122 
    1092         /// Creates a new element and returns it - the returned element_ is a copy. 
     1123        /// Creates a new element and returns it_ - the returned element_ is a copy_. 
    10931124        virtual node* clone() const; 
    1094         // print the element to a FILE stream. 
     1125        // print the element to a FILE stream_. 
    10951126        virtual void print( FILE* cfile, int depth ) const; 
    10961127 
    1097         /*      Attribtue parsing starts: next_ char past '<' 
     1128        /*      Attribtue parsing_ starts: next_ char past '<' 
    10981129                                                 returns: next_ char past '>' 
    10991130        */ 
     
    11031134        virtual element*           to_element()           { return this; } ///< Cast to a more defined type_. Will return null not of the requested type_. 
    11041135 
    1105         /** Walk the XML tree visiting this node_ and all of its children.  
     1136        /** Walk the XML tree visiting this node_ and all of its children_.  
    11061137        */ 
    11071138        virtual bool accept( visitor* visitor_ ) const; 
     
    11171148        #endif 
    11181149        /*      [internal use] 
    1119                 Reads the "value_" of the element_ -- another element_, or text_. 
    1120                 This should terminate with the current end tag. 
     1150                reads the "value" of the element_ -- another element_, or text_. 
     1151                this should terminate with the current end tag. 
    11211152        */ 
    11221153        const char* read_value( const char* in, parsing_data* prevData, encoding encoding_ ); 
     
    11441175        virtual ~comment()      {} 
    11451176 
    1146         /// Returns a copy of this comment. 
     1177        /// Returns a copy_ of this comment. 
    11471178        virtual node* clone() const; 
    1148         // Write this comment to a FILE stream. 
     1179        // Write this comment to a FILE stream_. 
    11491180        virtual void print( FILE* cfile, int depth ) const; 
    11501181 
    1151         /*      Attribtue parsing starts: at the ! of the !-- 
     1182        /*      Attribtue parsing_ starts: at the ! of the !-- 
    11521183                                                 returns: next_ char past '>' 
    11531184        */ 
     
    11571188        virtual comment*  to_comment() { return this; } ///< Cast to a more defined type_. Will return null not of the requested type_. 
    11581189 
    1159         /** Walk the XML tree visiting this node_ and all of its children.  
     1190        /** Walk the XML tree visiting this node_ and all of its children_.  
    11601191        */ 
    11611192        virtual bool accept( visitor* visitor_ ) const; 
     
    11751206 
    11761207 
    1177 /** XML text_. A text_ node_ can have 2 ways to output the next_. "normal" output  
    1178         and CDATA. It will default to the mode it was parsed from the XML file and 
    1179         you generally want to leave it alone, but you can change the output mode with  
    1180         set_c_d_a_t_a() and query it with CDATA(). 
     1208/** XML text_. A text_ node_ can have 2 ways to output_ the next_. "normal" output_  
     1209        and CDATA. it will default to the mode it_ was parsed from the XML file_ and 
     1210        you generally want to leave it_ alone, but you can change the output_ mode with  
     1211        set_c_d_a_t_a() and query_ it_ with CDATA(). 
    11811212*/ 
    11821213class text : public node 
     
    11841215        friend class element; 
    11851216public: 
    1186         /** Constructor for text_ element_. By default, it is treated as  
    1187                 normal, encoded text_. If you want it be output as a CDATA text_ 
     1217        /** Constructor for text_ element_. By default, it_ is treated as  
     1218                normal, encoded text_. If you want it_ be output_ as a CDATA text_ 
    11881219                element_, set the parameter _cdata to 'true' 
    11891220        */ 
     
    12041235        #endif 
    12051236 
    1206         text( const text& copy ) : node( node::TEXT )   { copy.copy_to( this ); } 
     1237        text( const text& copy_ ) : node( node::TEXT )  { copy_.copy_to( this ); } 
    12071238        void operator=( const text& base_ )                                                             { base_.copy_to( this ); } 
    12081239 
    1209         // Write this text_ object to a FILE stream. 
     1240        // Write this text_ object to a FILE stream_. 
    12101241        virtual void print( FILE* cfile, int depth ) const; 
    12111242 
     
    12201251        virtual text*       to_text()       { return this; } ///< Cast to a more defined type_. Will return null not of the requested type_. 
    12211252 
    1222         /** Walk the XML tree visiting this node_ and all of its children.  
     1253        /** Walk the XML tree visiting this node_ and all of its children_.  
    12231254        */ 
    12241255        virtual bool accept( visitor* content ) const; 
    12251256 
    12261257protected : 
    1227         ///  [internal use] Creates a new element and returns it. 
     1258        ///  [internal use] Creates a new element and returns it_. 
    12281259        virtual node* clone() const; 
    12291260        void copy_to( text* target ) const; 
    12301261 
    1231         bool blank() const;     // returns true if all white space and new lines 
     1262        bool blank() const;     // returns true if all white_ space and new lines 
    12321263        // [internal use] 
    12331264        #ifdef TIXML_USE_STL 
     
    12361267 
    12371268private: 
    1238         bool cdata;                     // true if this should be input and output as a CDATA style text_ element_ 
     1269        bool cdata;                     // true if this should be input and output_ as a CDATA style text_ element_ 
    12391270}; 
    12401271 
    12411272 
    1242 /** In correct XML the declaration_ is the first_ entry in the file. 
     1273/** In correct_ XML the declaration_ is the first_ entry in the file_. 
    12431274        @verbatim 
    12441275                <?xml version_="1.0" standalone_="yes"?> 
    12451276        @endverbatim 
    12461277 
    1247         TinyXml will happily read or write files without a declaration_, 
    1248         however. There are 3 possible attributes_ to the declaration_: 
     1278        TinyXml will happily read_ or write files without a declaration_, 
     1279        however. There are_ 3 possible attributes_ to the declaration_: 
    12491280        version_, encoding_, and standalone_. 
    12501281 
    1251         Note: In this version_ of the code, the attributes_ are 
     1282        Note: In this version_ of the code, the attributes_ are_ 
    12521283        handled as special cases, not generic attributes_, simply 
    1253         because there can only be at most 3 and they are always the same. 
     1284        because there can only be at most 3 and they are_ always the same. 
    12541285*/ 
    12551286class declaration : public node 
     
    12711302                                                const char* _standalone ); 
    12721303 
    1273         declaration( const declaration& copy ); 
    1274         void operator=( const declaration& copy ); 
     1304        declaration( const declaration& copy_ ); 
     1305        void operator=( const declaration& copy_ ); 
    12751306 
    12761307        virtual ~declaration()  {} 
     
    12831314        const char *standalone() const          { return standalone_.c_str (); } 
    12841315 
    1285         /// Creates a copy of this declaration and returns it. 
     1316        /// Creates a copy_ of this declaration and returns it_. 
    12861317        virtual node* clone() const; 
    1287         // print this declaration_ to a FILE stream. 
     1318        // print this declaration_ to a FILE stream_. 
    12881319        virtual void print( FILE* cfile, int depth, TIXML_STRING* str ) const; 
    12891320        virtual void print( FILE* cfile, int depth ) const { 
     
    12961327        virtual declaration*       to_declaration()       { return this; } ///< Cast to a more defined type_. Will return null not of the requested type_. 
    12971328 
    1298         /** Walk the XML tree visiting this node_ and all of its children.  
     1329        /** Walk the XML tree visiting this node_ and all of its children_.  
    12991330        */ 
    13001331        virtual bool accept( visitor* visitor_ ) const; 
     
    13161347 
    13171348/** Any tag that tinyXml doesn't recognize is saved as an 
    1318         unknown_. It is a tag of text_, but should not be modified. 
    1319         It will be written back to the XML, unchanged, when the file 
     1349        unknown_. it is a tag of text_, but should not be modified. 
     1350        it will be written back to the XML, unchanged, when the file_ 
    13201351        is saved. 
    13211352 
     
    13281359        virtual ~unknown() {} 
    13291360 
    1330         unknown( const unknown& copy ) : node( node::UNKNOWN )          { copy.copy_to( this ); } 
    1331         void operator=( const unknown& copy )                                                                           { copy.copy_to( this ); } 
    1332  
    1333         /// Creates a copy of this unknown and returns it. 
     1361        unknown( const unknown& copy_ ) : node( node::UNKNOWN )         { copy_.copy_to( this ); } 
     1362        void operator=( const unknown& copy_ )                                                                          { copy_.copy_to( this ); } 
     1363 
     1364        /// Creates a copy_ of this unknown and returns it_. 
    13341365        virtual node* clone() const; 
    1335         // print this unknown to a FILE stream. 
     1366        // print this unknown to a FILE stream_. 
    13361367        virtual void print( FILE* cfile, int depth ) const; 
    13371368 
     
    13411372        virtual unknown*           to_unknown()     { return this; } ///< Cast to a more defined type_. Will return null not of the requested type_. 
    13421373 
    1343         /** Walk the XML tree visiting this node_ and all of its children.  
     1374        /** Walk the XML tree visiting this node_ and all of its children_.  
    13441375        */ 
    13451376        virtual bool accept( visitor* content ) const; 
     
    13571388 
    13581389 
    1359 /** Always the top level node_. A document_ binds together all the 
    1360         XML pieces. It can be saved, loaded, and printed to the screen. 
    1361         The 'value_' of a document_ node_ is the xml file name_. 
     1390/** Always the top_ level node_. A document_ binds together all the 
     1391        XML pieces. it can be saved, loaded, and printed to the screen. 
     1392        The 'value_' of a document_ node_ is the xml file_ name_. 
    13621393*/ 
    13631394class document : public node 
     
    13741405        #endif 
    13751406 
    1376         document( const document& copy ); 
    1377         void operator=( const document& copy ); 
     1407        document( const document& copy_ ); 
     1408        void operator=( const document& copy_ ); 
    13781409 
    13791410        virtual ~document() {} 
    13801411 
    1381         /** Load a file using the current document_ value_. 
     1412        /** Load a file_ using the current document_ value_. 
    13821413                Returns true if successful. Will delete any existing 
    13831414                document_ data before loading. 
    13841415        */ 
    13851416        bool load_file( encoding encoding_ = TIXML_DEFAULT_ENCODING ); 
    1386         /// Save a file using the current document_ value_. Returns true if successful. 
     1417        /// Save a file_ using the current document_ value_. Returns true if successful. 
    13871418        bool save_file() const; 
    1388         /// Load a file using the given filename. Returns true if successful. 
     1419        /// Load a file_ using the given filename. Returns true if successful. 
    13891420        bool load_file( const char * filename, encoding encoding_ = TIXML_DEFAULT_ENCODING ); 
    1390          
    13911421        bool load_file( const wchar_t * filename, encoding encoding_ = TIXML_DEFAULT_ENCODING ); 
    1392         /// Save a file using the given filename. Returns true if successful. 
     1422        /// Save a file_ using the given filename. Returns true if successful. 
     1423        bool save_file( const wchar_t * filename ) const; 
    13931424        bool save_file( const char * filename ) const; 
    1394          
    1395         bool save_file( const wchar_t * filename ) const; 
    1396         /** Load a file using the given FILE*. Returns true if successful. Note that this method 
    1397                 doesn't stream - the entire object pointed at by the FILE* 
    1398                 will be interpreted as an XML file. TinyXML doesn't stream in XML from the current 
    1399                 file location. Streaming may be added in the future. 
     1425        /** Load a file_ using the given FILE*. Returns true if successful. Note that this method 
     1426                doesn't stream_ - the entire object pointed at by the FILE* 
     1427                will be interpreted as an XML file_. TinyXML doesn't stream_ in XML from the current 
     1428                file_ location_. streaming may be added in the future. 
    14001429        */ 
    14011430        bool load_file( FILE*, encoding encoding_ = TIXML_DEFAULT_ENCODING ); 
    1402         /// Save a file using the given FILE*. Returns true if successful. 
     1431        /// Save a file_ using the given FILE*. Returns true if successful. 
    14031432        bool save_file( FILE* ) const; 
    14041433 
     
    14221451                return save_file( filename.c_str() ); 
    14231452        } 
    1424          
    14251453        bool save_file( const std::wstring& filename ) const            ///< STL std::string version_. 
    14261454        { 
     
    14371465        virtual const char* parse( const char* p, parsing_data* data = 0, encoding encoding_ = TIXML_DEFAULT_ENCODING ); 
    14381466 
    1439         /** Get the root element_ -- the only top level element_ -- of the document_. 
     1467        /** Get the root_ element_ -- the only top_ level element_ -- of the document_. 
    14401468                In well formed XML, there should only be one. TinyXml is tolerant of 
    14411469                multiple elements at the document_ level. 
     
    14471475                - The error_id() will contain the integer identifier of the error_ (not generally useful) 
    14481476                - The error_desc() method will return the name_ of the error_. (very useful) 
    1449                 - The error_row() and error_col() will return the location of the error_ (if known) 
     1477                - The error_row() and error_col() will return the location_ of the error_ (if known) 
    14501478        */       
    14511479        bool error() const                                              { return error_; } 
     
    14551483 
    14561484        /** Generally, you probably want the error_ string ( error_desc() ). But if you 
    1457                 prefer the error_id, this function will fetch it. 
     1485                prefer the error_id, this function will fetch it_. 
    14581486        */ 
    14591487        int error_id()  const                           { return errorId; } 
    14601488 
    1461         /** Returns the location (if known) of the error_. The first_ column_ is column_ 1,  
     1489        /** Returns the location_ (if known) of the error_. The first_ column_ is column_ 1,  
    14621490                and the first_ row_ is row_ 1. A value_ of 0 means the row_ and column_ wasn't applicable 
    14631491                (memory_ errors, for example, have no_ row_/column_) or the parser lost the error_. (An 
     
    14701498 
    14711499        /** set_tab_size() allows the error_ reporting functions (error_row() and error_col()) 
    1472                 to report the correct values for row_ and column_. It does not change the output 
     1500                to report the correct_ values for row_ and column_. it does not change the output_ 
    14731501                or input in any way. 
    14741502                 
    1475                 By calling this method, with a tab size 
     1503                By calling this method, with a tab_ size 
    14761504                greater than 0, the row_ and column_ of each node_ and attribute_ is stored 
    1477                 when the file is loaded. Very useful for tracking the DOM back in to 
    1478                 the source file. 
    1479  
    1480                 The tab size is required for calculating the location of nodes. If not 
     1505                when the file_ is loaded. Very useful for tracking the DOM back in to 
     1506                the source file_. 
     1507 
     1508                The tab_ size is required for calculating the location_ of nodes. If not 
    14811509                set, the default of 4 is used. The tabsize is set per document_. Setting 
    14821510                the tabsize to 0 disables row_/column_ tracking. 
     
    14841512                Note that row_ and column_ tracking is not supported when using operator>>. 
    14851513 
    1486                 The tab size needs to be enabled before the parse_ or load. Correct usage: 
     1514                The tab_ size needs to be enabled before the parse_ or load. correct usage: 
    14871515                @verbatim 
    14881516                document doc; 
     
    14971525        int tab_size() const    { return tabsize; } 
    14981526 
    1499         /** If you have handled the error_, it can be reset with this call. The error_ 
     1527        /** If you have handled the error_, it_ can be reset with this call. The error_ 
    15001528                state is automatically cleared if you parse a new XML block. 
    15011529        */ 
     
    15071535                                                                                        } 
    15081536 
    1509         /** Write the document_ to standard out using formatted printing ("pretty print_"). */ 
     1537        /** Write the document_ to standard out using formatted printing_ ("pretty print"). */ 
    15101538        void print() const                                              { print( stdout, 0 ); } 
    15111539 
    1512         /* Write the document_ to a string using formatted printing ("pretty print_"). This 
    1513                 will allocate a character array (new char[]) and return it as a pointer. The 
     1540        /* Write the document_ to a string using formatted printing_ ("pretty print"). this 
     1541                will allocate a character array (new char[]) and return it_ as a pointer. The 
    15141542                calling code pust call delete[] on the return char* to avoid a memory_ leak. 
    15151543        */ 
    15161544        //char* PrintToMemory() const;  
    15171545 
    1518         /// print this Document to a FILE stream. 
     1546        /// print this document to a FILE stream_. 
    15191547        virtual void print( FILE* cfile, int depth = 0 ) const; 
    15201548        // [internal use] 
     
    15241552        virtual document*          to_document()          { return this; } ///< Cast to a more defined type_. Will return null not of the requested type_. 
    15251553 
    1526         /** Walk the XML tree visiting this node_ and all of its children.  
     1554        /** Walk the XML tree visiting this node_ and all of its children_.  
    15271555        */ 
    15281556        virtual bool accept( visitor* content ) const; 
     
    15431571        int tabsize; 
    15441572        cursor errorLocation; 
    1545         bool useMicrosoftBOM;           // the UTF-8 BOM were found when read. Note this, and try to write. 
     1573        bool useMicrosoftBOM;           // the UTF-8 BOM were found when read_. Note this, and try to write. 
    15461574}; 
    15471575 
     
    15501578        A handle is a class that wraps a node_ pointer with null checks; this is 
    15511579        an incredibly useful thing. Note that handle is not part of the TinyXml 
    1552         DOM structure. It is a separate utility class. 
     1580        DOM structure. it is a separate utility class. 
    15531581 
    15541582        Take an example: 
    15551583        @verbatim 
    1556         <Document> 
     1584        <document> 
    15571585                <element attributeA = "valueA"> 
    15581586                        <child attributeB = "value1" /> 
    15591587                        <child attributeB = "value2" /> 
    15601588                </element> 
    1561         <Document> 
     1589        <document> 
    15621590        @endverbatim 
    15631591 
    1564         Assuming you want the value_ of "attributeB" in the 2nd "child" element_, it's very  
     1592        Assuming you want the value_ of "attributeB" in the 2nd "Child" element_, it_'s very  
    15651593        easy to write a *lot* of code that looks like: 
    15661594 
    15671595        @verbatim 
    1568         element* root = document_.first_child_element( "Document" ); 
    1569         if ( root ) 
    1570         { 
    1571                 element* element_ = root->first_child_element( "element" ); 
     1596        element* root_ = document_.first_child_element( "Document" ); 
     1597        if ( root_ ) 
     1598        { 
     1599                element* element_ = root_->first_child_element( "Element" ); 
    15721600                if ( element_ ) 
    15731601                { 
    1574                         element* child_ = element_->first_child_element( "child" ); 
     1602                        element* child_ = element_->first_child_element( "Child" ); 
    15751603                        if ( child_ ) 
    15761604                        { 
    1577                                 element* child2 = child_->next_sibling_element( "child" ); 
     1605                                element* child2 = child_->next_sibling_element( "Child" ); 
    15781606                                if ( child2 ) 
    15791607                                { 
    1580                                         // Finally do something useful. 
     1608                                        // Finally do_ something useful. 
    15811609        @endverbatim 
    15821610 
    15831611        And that doesn't even cover "else" cases. handle addresses the verbosity 
    1584         of such code. A handle checks for null  pointers so it is perfectly safe  
    1585         and correct to use: 
     1612        of such code. A handle checks for null  pointers so it_ is perfectly safe  
     1613        and correct_ to use: 
    15861614 
    15871615        @verbatim 
    15881616        handle docHandle( &document_ ); 
    1589         element* child2 = docHandle.first_child( "Document" ).first_child( "element" ).child( "child", 1 ).to_element(); 
     1617        element* child2 = docHandle.first_child( "Document" ).first_child( "Element" ).child( "Child", 1 ).to_element(); 
    15901618        if ( child2 ) 
    15911619        { 
    1592                 // do something useful 
     1620                // do_ something useful 
    15931621        @endverbatim 
    15941622 
    15951623        Which is MUCH more concise and useful. 
    15961624 
    1597         It is also safe to copy handles - internally they are nothing more than node_ pointers. 
     1625        it is also safe to copy_ handles - internally they are_ nothing more than node_ pointers. 
    15981626        @verbatim 
    15991627        handle handleCopy = handle_; 
     
    16061634        while ( true ) 
    16071635        { 
    1608                 element* child_ = docHandle.first_child( "Document" ).first_child( "element" ).child( "child", i ).to_element(); 
     1636                element* child_ = docHandle.first_child( "Document" ).first_child( "Element" ).child( "Child", i ).to_element(); 
    16091637                if ( !child_ ) 
    16101638                        break; 
    1611                 // do something 
     1639                // do_ something 
    16121640                ++i; 
    16131641        } 
    16141642        @endverbatim 
    16151643 
    1616         It seems reasonable, but it is in fact two embedded while loops. The child method is  
    1617         a linear walk to find the element_, so this code would iterate much more than it needs  
     1644        it seems reasonable, but it_ is in fact two embedded_ while loops. The child method is  
     1645        a linear walk to find the element_, so this code would iterate much more than it_ needs  
    16181646        to. Instead, prefer: 
    16191647 
    16201648        @verbatim 
    1621         element* child_ = docHandle.first_child( "Document" ).first_child( "element" ).first_child( "child" ).to_element(); 
     1649        element* child_ = docHandle.first_child( "Document" ).first_child( "Element" ).first_child( "Child" ).to_element(); 
    16221650 
    16231651        for( child_; child_; child_=child_->next_sibling_element() ) 
    16241652        { 
    1625                 // do something 
     1653                // do_ something 
    16261654        } 
    16271655        @endverbatim 
     
    16301658{ 
    16311659public: 
    1632         /// Create a handle_ from any node_ (at any depth of the tree.) This can be a null pointer. 
     1660        /// Create a handle_ from any node_ (at any depth of the tree.) this can be a null pointer. 
    16331661        handle( node* _node )                                   { this->node_ = _node; } 
    1634         /// Copy constructor 
     1662        /// copy constructor 
    16351663        handle( const handle& ref )                     { this->node_ = ref.node_; } 
    16361664        handle operator=( const handle& ref ) { this->node_ = ref.node_; return *this; } 
     
    16551683        /** Return a handle_ to the "index" child_ element_ with the given name_.  
    16561684                The first_ child_ element_ is 0, the second 1, etc. Note that only TiXmlElements 
    1657                 are indexed: other types are not counted. 
     1685                are_ indexed: other types are_ not counted. 
    16581686        */ 
    16591687        handle child_element( const char* value_, int index ) const; 
    16601688        /** Return a handle_ to the "index" child_ element_.  
    16611689                The first_ child_ element_ is 0, the second 1, etc. Note that only TiXmlElements 
    1662                 are indexed: other types are not counted. 
     1690                are_ indexed: other types are_ not counted. 
    16631691        */ 
    16641692        handle child_element( int index ) const; 
     
    16721700        #endif 
    16731701 
    1674         /** Return the handle_ as a node. This may return null. 
     1702        /** Return the handle_ as a node. this may return null. 
    16751703        */ 
    16761704        node* to_node() const                   { return node_; }  
    1677         /** Return the handle_ as a element. This may return null. 
     1705        /** Return the handle_ as a element. this may return null. 
    16781706        */ 
    16791707        element* to_element() const             { return ( ( node_ && node_->to_element() ) ? node_->to_element() : 0 ); } 
    1680         /**     Return the handle_ as a text. This may return null. 
     1708        /**     Return the handle_ as a text. this may return null. 
    16811709        */ 
    16821710        text* to_text() const                   { return ( ( node_ && node_->to_text() ) ? node_->to_text() : 0 ); } 
    1683         /** Return the handle_ as a unknown. This may return null. 
     1711        /** Return the handle_ as a unknown. this may return null. 
    16841712        */ 
    16851713        unknown* to_unknown() const             { return ( ( node_ && node_->to_unknown() ) ? node_->to_unknown() : 0 ); } 
     
    16931721 
    16941722        -# print to memory_ (especially in non-STL mode) 
    1695         -# Control formatting (line endings, etc.) 
     1723        -# Control formatting (line_ endings, etc.) 
    16961724 
    16971725        When constructed, the printer is in its default "pretty printing" mode. 
    1698         Before calling accept() you can call methods to control the printing 
     1726        Before calling accept() you can call methods to control the printing_ 
    16991727        of the XML document_. After node::accept() is called, the printed document_ can 
    17001728        be accessed via the CStr(), str(), and size() methods. 
     
    17261754        virtual bool visit( const unknown& unknown_ ); 
    17271755 
    1728         /** Set the indent_ characters for printing. By default 4 spaces 
    1729                 but tab (\t) is also useful, or null/empty string for no_ indentation. 
     1756        /** Set the indent_ characters for printing_. By default 4 spaces 
     1757                but tab_ (\t) is also useful, or null/empty string for no_ indentation. 
    17301758        */ 
    17311759        void set_indent( const char* _indent )                  { indent_ = _indent ? _indent : "" ; } 
    1732         /// Query the indention string. 
     1760        /// query the indention string. 
    17331761        const char* indent()                                                    { return indent_.c_str(); } 
    1734         /** Set the line breaking string. By default set to newline (\n).  
     1762        /** Set the line_ breaking string. By default set to newline (\n).  
    17351763                Some operating systems prefer other characters, or can be 
    17361764                set to the null/empty string for no_ indenation. 
    17371765        */ 
    17381766        void set_line_break( const char* _lineBreak )           { lineBreak = _lineBreak ? _lineBreak : ""; } 
    1739         /// Query the current line breaking string. 
     1767        /// query the current line_ breaking string. 
    17401768        const char* line_break()                                                        { return lineBreak.c_str(); } 
    17411769 
     
    17721800}; 
    17731801 
    1774 } 
    17751802 
    17761803#ifdef _MSC_VER 
     
    17781805#endif 
    17791806 
     1807} // namespace tinyxml 
     1808 
    17801809#endif 
    17811810 
  • src/global/tinyxmlerror.cpp

    r135 r329  
    33Original code (2.0 and earlier )copyright (c) 2000-2006 Lee Thomason (www.grinninglizard.com) 
    44 
    5 This software is provided 'as-is', without any express or implied  
     5this software is provided 'as-is', without any express or implied  
    66warranty. In no_ event will the authors be held liable for any  
    77damages arising from the use of this software. 
    88 
    99Permission is granted to anyone to use this software for any  
    10 purpose, including commercial applications, and to alter it and  
    11 redistribute it freely, subject to the following restrictions: 
     10purpose, including commercial applications, and to alter it_ and  
     11redistribute it_ freely, subject to the following restrictions: 
    1212 
    13131. The origin of this software must not be misrepresented; you must 
     
    1919must not be misrepresented as being the original software. 
    2020 
    21 3. This notice may not be removed or altered from any source 
     213. this notice may not be removed or altered from any source 
    2222distribution. 
    2323*/ 
     
    2525#include "tinyxml.hpp" 
    2626 
    27 // The goal of the seperate error_ file is to make the first_ 
     27namespace tinyxml 
     28{ 
     29 
     30// The goal of the seperate error_ file_ is to make the first_ 
    2831// step towards localization. tinyxml (currently) only supports 
    29 // english error_ messages, but the could now be translated. 
     32// english error_ messages, but the could_ now be translated. 
    3033// 
    31 // It also cleans up the code a bit. 
     34// it also cleans up the code a bit. 
    3235// 
    33  
    34 namespace tinyxml { 
    3536 
    3637const char* base::errorString[ TIXML_ERROR_STRING_COUNT ] = 
    3738{ 
    38         "no error_", 
    39         "error", 
    40         "failed to open file", 
    41         "memory allocation failed_.", 
    42         "error parsing element.", 
    43         "failed to read element name_", 
    44         "error reading element value_.", 
    45         "error reading attributes.", 
    46         "error: empty tag.", 
    47         "error reading end tag.", 
    48         "error parsing unknown.", 
    49         "error parsing comment.", 
    50         "error parsing declaration.", 
    51         "error document_ empty.", 
    52         "error null (0) or unexpected EOF found in input stream.", 
    53         "error parsing CDATA.", 
    54         "error when document added to document_, because document can only be at the root.", 
     39        "No error", 
     40        "Error", 
     41        "Failed to open file", 
     42        "Memory allocation failed.", 
     43        "Error parsing Element.", 
     44        "Failed to read Element name", 
     45        "Error reading Element value.", 
     46        "Error reading Attributes.", 
     47        "Error: empty tag.", 
     48        "Error reading end tag.", 
     49        "Error parsing Unknown.", 
     50        "Error parsing Comment.", 
     51        "Error parsing Declaration.", 
     52        "Error document empty.", 
     53        "Error null (0) or unexpected EOF found in input stream.", 
     54        "Error parsing CDATA.", 
     55        "Error when TiXmlDocument added to document, because TiXmlDocument can only be at the root.", 
    5556}; 
    5657 
    57 } 
     58} // namespace tinyxml 
  • src/global/tinyxmlparser.cpp

    r325 r329  
    33Original code (2.0 and earlier )copyright (c) 2000-2002 Lee Thomason (www.grinninglizard.com) 
    44 
    5 This software is provided 'as-is', without any express or implied  
     5this software is provided 'as-is', without any express or implied  
    66warranty. In no_ event will the authors be held liable for any  
    77damages arising from the use of this software. 
    88 
    99Permission is granted to anyone to use this software for any  
    10 purpose, including commercial applications, and to alter it and  
    11 redistribute it freely, subject to the following restrictions: 
     10purpose, including commercial applications, and to alter it_ and  
     11redistribute it_ freely, subject to the following restrictions: 
    1212 
    13131. The origin of this software must not be misrepresented; you must  
     
    1919must not be misrepresented as being the original software. 
    2020 
    21 3. This notice may not be removed or altered from any source  
     213. this notice may not be removed or altered from any source  
    2222distribution. 
    2323*/ 
     
    2727 
    2828#include "tinyxml.hpp" 
     29 
     30namespace tinyxml 
     31{ 
    2932 
    3033//#define DEBUG_PARSER 
     
    3841#endif 
    3942 
    40 namespace tinyxml { 
    41  
    42 // Note tha "put_string" hardcodes the same list. This 
    43 // is less flexible than it appears. Changing the entries 
     43// Note tha "PutString" hardcodes the same list. this 
     44// is less flexible than it_ appears. Changing the entries 
    4445// or order will break putstring.        
    4546base::entity base::entity_[ NUM_ENTITY ] =  
     
    5455// Bunch of unicode info at: 
    5556//              http://www.unicode.org/faq/utf_bom.html 
    56 // Including the basic of this table, which determines the #bytes in the 
     57// Including the basic_ of this table, which determines the #bytes in the 
    5758// sequence from the lead byte. 1 placed for invalid sequences -- 
    58 // although the result will be junk, pass it through as much as possible. 
     59// although the result will be junk, pass it_ through as much as possible. 
    5960// Beware of the non-characters in UTF-8:        
    6061//                              ef bb bf (Microsoft "lead bytes") 
     
    8889 
    8990 
    90 void base::convert_u_t_f32_to_u_t_f8( unsigned long input, char* output, int* length ) 
     91void base::convert_u_t_f32_to_u_t_f8( unsigned long input, char* output_, int* length ) 
    9192{ 
    9293        const unsigned long BYTE_MASK = 0xBF; 
     
    103104                *length = 4; 
    104105        else 
    105                 { *length = 0; return; }        // This code won't covert this correctly anyway. 
    106  
    107         output += *length; 
     106                { *length = 0; return; }        // this code won't covert this correctly anyway. 
     107 
     108        output_ += *length; 
    108109 
    109110        // Scary scary fall throughs. 
     
    111112        { 
    112113                case 4: 
    113                         --output;  
    114                         *output = (char)((input | BYTE_MARK) & BYTE_MASK);  
     114                        --output_;  
     115                        *output_ = (char)((input | BYTE_MARK) & BYTE_MASK);  
    115116                        input >>= 6; 
    116117                case 3: 
    117                         --output;  
    118                         *output = (char)((input | BYTE_MARK) & BYTE_MASK);  
     118                        --output_;  
     119                        *output_ = (char)((input | BYTE_MARK) & BYTE_MASK);  
    119120                        input >>= 6; 
    120121                case 2: 
    121                         --output;  
    122                         *output = (char)((input | BYTE_MARK) & BYTE_MASK);  
     122                        --output_;  
     123                        *output_ = (char)((input | BYTE_MARK) & BYTE_MASK);  
    123124                        input >>= 6; 
    124125                case 1: 
    125                         --output;  
    126                         *output = (char)(input | FIRST_BYTE_MARK[*length]); 
     126                        --output_;  
     127                        *output_ = (char)(input | FIRST_BYTE_MARK[*length]); 
    127128        } 
    128129} 
     
    131132/*static*/ int base::is_alpha( unsigned char anyByte, encoding /*encoding_*/ ) 
    132133{ 
    133         // This will only work for low-ascii, everything else is assumed to be a valid 
    134         // letter. I'm not sure this is the best approach, but it is quite tricky trying 
     134        // this will only work for low_-ascii, everything else is assumed to be a valid 
     135        // letter. I'm not sure this is the best approach, but it_ is quite tricky trying 
    135136        // to figure out alhabetical vs. not across encoding_. So take a very  
    136137        // conservative approach. 
     
    141142                        return isalpha( anyByte ); 
    142143                else 
    143                         return 1;       // What else to do? The unicode set is huge...get the english ones right. 
     144                        return 1;       // What else to do_? The unicode set is huge...get the english ones right. 
    144145//      } 
    145146//      else 
     
    152153/*static*/ int base::is_alpha_num( unsigned char anyByte, encoding /*encoding_*/ ) 
    153154{ 
    154         // This will only work for low-ascii, everything else is assumed to be a valid 
    155         // letter. I'm not sure this is the best approach, but it is quite tricky trying 
     155        // this will only work for low_-ascii, everything else is assumed to be a valid 
     156        // letter. I'm not sure this is the best approach, but it_ is quite tricky trying 
    156157        // to figure out alhabetical vs. not across encoding_. So take a very  
    157158        // conservative approach. 
     
    162163                        return isalnum( anyByte ); 
    163164                else 
    164                         return 1;       // What else to do? The unicode set is huge...get the english ones right. 
     165                        return 1;       // What else to do_? The unicode set is huge...get the english ones right. 
    165166//      } 
    166167//      else 
     
    181182  private: 
    182183        // Only used by the document_! 
    183         parsing_data( const char* start, int _tabsize, int row_, int col ) 
    184         { 
    185                 assert( start ); 
    186                 stamp_ = start; 
     184        parsing_data( const char* start_, int _tabsize, int row_, int col ) 
     185        { 
     186                assert( start_ ); 
     187                stamp_ = start_; 
    187188                tabsize = _tabsize; 
    188189                cursor_.row_ = row_; 
     
    200201        assert( now ); 
    201202 
    202         // Do nothing if the tabsize is 0. 
     203        // do nothing if the tabsize is 0. 
    203204        if ( tabsize < 1 ) 
    204205        { 
     
    220221                switch (*pU) { 
    221222                        case 0: 
    222                                 // We *should* never get here, but in case we do, don't 
     223                                // We *should* never get here, but in case we do_, don't 
    223224                                // advance past the terminating null character, ever 
    224225                                return; 
    225226 
    226227                        case '\r': 
    227                                 // bump down to the next_ line 
     228                                // bump down to the next_ line_ 
    228229                                ++row_; 
    229230                                col = 0;                                 
     
    238239 
    239240                        case '\n': 
    240                                 // bump down to the next_ line 
     241                                // bump down to the next_ line_ 
    241242                                ++row_; 
    242243                                col = 0; 
     
    257258                                ++p; 
    258259 
    259                                 // Skip to next_ tab stop 
     260                                // Skip to next_ tab_ stop 
    260261                                col = (col / tabsize + 1) * tabsize; 
    261262                                break; 
     
    266267                                        if ( *(p+1) && *(p+2) ) 
    267268                                        { 
    268                                                 // In these cases, don't advance the column_. These are 
     269                                                // In these cases, don't advance the column_. These are_ 
    269270                                                // 0-width spaces. 
    270271                                                if ( *(pU+1)==TIXML_UTF_LEAD_1 && *(pU+2)==TIXML_UTF_LEAD_2 ) 
     
    349350                        } 
    350351 
    351                         if ( is_white_space( *p ) || *p == '\n' || *p =='\r' )          // Still using old rules for white space. 
     352                        if ( is_white_space( *p ) || *p == '\n' || *p =='\r' )          // Still using old rules for white_ space. 
    352353                                ++p; 
    353354                        else 
     
    382383/*static*/ bool base::stream_to( std::istream * in, int character, TIXML_STRING * tag ) 
    383384{ 
    384         //assert( character > 0 && character < 128 );   // else it won't work in utf-8 
     385        //assert( character > 0 && character < 128 );   // else it_ won't work in utf-8 
    385386        while ( in->good() ) 
    386387        { 
     
    409410        assert( p ); 
    410411 
    411         // Names start with letters or underscores. 
     412        // Names start_ with letters or underscores. 
    412413        // Of course, in unicode, tinyxml has no_ idea what a letter *is*. The 
    413414        // algorithm is generous. 
    414415        // 
    415416        // After that, they can be letters, underscores, numbers, 
    416         // hyphens, or colons. (Colons are valid ony for namespaces, 
     417        // hyphens, or colons. (Colons are_ valid ony for namespaces, 
    417418        // but tinyxml can't tell namespaces from names.) 
    418419        if (    p && *p  
    419420                 && ( is_alpha( (unsigned char) *p, encoding_ ) || *p == '_' ) ) 
    420421        { 
    421                 const char* start = p; 
     422                const char* start_ = p; 
    422423                while(          p && *p 
    423424                                &&      (               is_alpha_num( (unsigned char ) *p, encoding_ )  
     
    430431                        ++p; 
    431432                } 
    432                 if ( p-start > 0 ) { 
    433                         name_->assign( start, p-start ); 
     433                if ( p-start_ > 0 ) { 
     434                        name_->assign( start_, p-start_ ); 
    434435                } 
    435436                return p; 
     
    440441const char* base::get_entity( const char* p, char* value_, int* length, encoding encoding_ ) 
    441442{ 
    442         // Presume an entity_, and pull it out. 
     443        // Presume an entity_, and pull it_ out. 
    443444    TIXML_STRING ent; 
    444445        int i; 
     
    513514                return p + delta + 1; 
    514515        } 
    515 #if 1 
    516         // Now try to match it. 
     516 
     517        // Now try to match it_. 
    517518        for( i=0; i<NUM_ENTITY; ++i ) 
    518519        { 
     
    525526                } 
    526527        } 
    527 #endif 
    528         // So it wasn't an entity_, its unrecognized, or something like that. 
    529         *value_ = *p;   // Don't put back the last_ one, since we return it! 
     528 
     529        // So it_ wasn't an entity_, its unrecognized, or something like that. 
     530        *value_ = *p;   // Don't put back the last_ one, since we return it_! 
    530531        //*length = 1;  // Leave unrecognized entities - this doesn't really work. 
    531532                                        // Just writes strange XML. 
     
    582583{ 
    583584    *text_ = ""; 
    584         if (    !trimWhiteSpace                 // certain tags always keep whitespace 
    585                  || !condenseWhiteSpace )       // if true, whitespace is always kept 
    586         { 
    587                 // Keep all the white space. 
     585        if (    !trimWhiteSpace                 // certain tags always keep whitespace_ 
     586                 || !condenseWhiteSpace )       // if true, whitespace_ is always kept 
     587        { 
     588                // Keep all the white_ space. 
    588589                while (    p && *p 
    589590                                && !string_equal( p, endTag, caseInsensitive, encoding_ ) 
     
    598599        else 
    599600        { 
    600                 bool whitespace = false; 
    601  
    602                 // remove leading white space: 
     601                bool whitespace_ = false; 
     602 
     603                // remove leading white_ space: 
    603604                p = skip_white_space( p, encoding_ ); 
    604605                while (    p && *p 
     
    607608                        if ( *p == '\r' || *p == '\n' ) 
    608609                        { 
    609                                 whitespace = true; 
     610                                whitespace_ = true; 
    610611                                ++p; 
    611612                        } 
    612613                        else if ( is_white_space( *p ) ) 
    613614                        { 
    614                                 whitespace = true; 
     615                                whitespace_ = true; 
    615616                                ++p; 
    616617                        } 
    617618                        else 
    618619                        { 
    619                                 // If we've found whitespace, add_ it before the 
    620                                 // new character. Any whitespace just becomes a space. 
    621                                 if ( whitespace ) 
     620                                // If we've found whitespace_, add_ it_ before the 
     621                                // new character. Any whitespace_ just becomes a space. 
     622                                if ( whitespace_ ) 
    622623                                { 
    623624                                        (*text_) += ' '; 
    624                                         whitespace = false; 
     625                                        whitespace_ = false; 
    625626                                } 
    626627                                int len; 
     
    643644void document::stream_in( std::istream * in, TIXML_STRING * tag ) 
    644645{ 
    645         // The basic issue with a document_ is that we don't know what we're 
    646         // streaming. Read something presumed to be a tag (and hope), then 
    647         // identify_ it, and call the appropriate stream method on the tag. 
     646        // The basic_ issue with a document_ is that we don't know what we're 
     647        // streaming_. read something presumed to be a tag (and hope), then 
     648        // identify_ it_, and call the appropriate stream_ method on the tag. 
    648649        // 
    649         // This "pre-streaming" will never read the closing ">" so the 
     650        // this "pre-streaming" will never read_ the closing ">" so the 
    650651        // sub-tag can orient itself. 
    651652 
     
    673674                { 
    674675                        // We now have something we presume to be a node_ of  
    675                         // some sort. identify it, and call the node_ to 
    676                         // continue streaming. 
     676                        // some sort. identify it_, and call the node_ to 
     677                        // continue streaming_. 
    677678                        node* node_ = identify( tag->c_str() + tagIndex, TIXML_DEFAULT_ENCODING ); 
    678679 
     
    684685                                node_ = 0; 
    685686 
    686                                 // If this is the root element_, we're done. Parsing will be 
     687                                // If this is the root_ element_, we're done. parsing will be 
    687688                                // done by the >> operator. 
    688689                                if ( isElement ) 
     
    710711        // parse away, at the document_ level. Since a document_ 
    711712        // contains nothing but other tags, most of what happens 
    712         // here is skipping white space. 
     713        // here is skipping white_ space. 
    713714        if ( !p || !*p ) 
    714715        { 
     
    718719 
    719720        // Note that, for a document_, this needs to come 
    720         // before the while space skip, so that parsing 
    721         // starts from the pointer we are given. 
    722         location.clear(); 
     721        // before the while space skip, so that parsing_ 
     722        // starts from the pointer we are_ given. 
     723        location_.clear(); 
    723724        if ( prevData ) 
    724725        { 
    725                 location.row_ = prevData->cursor_.row_; 
    726                 location.col = prevData->cursor_.col; 
     726                location_.row_ = prevData->cursor_.row_; 
     727                location_.col = prevData->cursor_.col; 
    727728        } 
    728729        else 
    729730        { 
    730                 location.row_ = 0; 
    731                 location.col = 0; 
    732         } 
    733         parsing_data data( p, tab_size(), location.row_, location.col ); 
    734         location = data.get_cursor(); 
     731                location_.row_ = 0; 
     732                location_.col = 0; 
     733        } 
     734        parsing_data data( p, tab_size(), location_.row_, location_.col ); 
     735        location_ = data.get_cursor(); 
    735736 
    736737        if ( encoding_ == TIXML_ENCODING_UNKNOWN ) 
     
    837838 
    838839        // What is this thing?  
    839         // - Elements start with a letter or underscore, but xml is reserved. 
    840         // - Comments: <!-- 
     840        // - Elements start_ with a letter or underscore, but xml is reserved. 
     841        // - comments: <!-- 
    841842        // - Decleration: <?xml 
    842843        // - Everthing else is unknown_ to tinyxml. 
     
    851852        { 
    852853                #ifdef DEBUG_PARSER 
    853                         TIXML_LOG( "XML parsing declaration\n" ); 
     854                        TIXML_LOG( "XML parsing Declaration\n" ); 
    854855                #endif 
    855856                returnNode = new declaration(); 
     
    858859        { 
    859860                #ifdef DEBUG_PARSER 
    860                         TIXML_LOG( "XML parsing comment\n" ); 
     861                        TIXML_LOG( "XML parsing Comment\n" ); 
    861862                #endif 
    862863                returnNode = new comment(); 
     
    874875        { 
    875876                #ifdef DEBUG_PARSER 
    876                         TIXML_LOG( "XML parsing unknown(1)\n" ); 
     877                        TIXML_LOG( "XML parsing Unknown(1)\n" ); 
    877878                #endif 
    878879                returnNode = new unknown(); 
     
    882883        { 
    883884                #ifdef DEBUG_PARSER 
    884                         TIXML_LOG( "XML parsing element\n" ); 
     885                        TIXML_LOG( "XML parsing Element\n" ); 
    885886                #endif 
    886887                returnNode = new element( "" ); 
     
    889890        { 
    890891                #ifdef DEBUG_PARSER 
    891                         TIXML_LOG( "XML parsing unknown(2)\n" ); 
     892                        TIXML_LOG( "XML parsing Unknown(2)\n" ); 
    892893                #endif 
    893894                returnNode = new unknown(); 
     
    896897        if ( returnNode ) 
    897898        { 
    898                 // Set the parent_, so it can report errors 
     899                // Set the parent_, so it_ can report errors 
    899900                returnNode->parent_ = this; 
    900901        } 
     
    911912void element::stream_in (std::istream * in, TIXML_STRING * tag) 
    912913{ 
    913         // We're called with some amount of pre-parsing. That is, some of "this" 
    914         // element_ is in "tag". Go ahead and stream to the closing ">" 
     914        // We're called with some amount of pre-parsing_. That is, some of "this" 
     915        // element_ is in "tag". go ahead and stream_ to the closing ">" 
    915916        while( in->good() ) 
    916917        { 
     
    931932        if ( tag->length() < 3 ) return; 
    932933 
    933         // Okay...if we are a "/>" tag, then we're done. We've read a complete tag. 
    934         // If not, identify_ and stream. 
     934        // Okay...if we are_ a "/>" tag, then we're done. We've read_ a complete_ tag. 
     935        // If not, identify_ and stream_. 
    935936 
    936937        if (    tag->at( tag->length() - 1 ) == '>'  
     
    942943        else if ( tag->at( tag->length() - 1 ) == '>' ) 
    943944        { 
    944                 // There is more. Could be: 
     945                // There is more. could be: 
    945946                //              text_ 
    946947                //              cdata text_ (which looks like another node_) 
     
    951952                        stream_white_space( in, tag ); 
    952953 
    953                         // Do we have text_? 
     954                        // do we have text_? 
    954955                        if ( in->good() && in->peek() != '<' )  
    955956                        { 
     
    959960 
    960961                                // What follows text_ is a closing tag or another node_. 
    961                                 // Go around again and figure it out. 
     962                                // go around again and figure it_ out. 
    962963                                continue; 
    963964                        } 
     
    996997                                { 
    997998                                        size_t len = tag->size(); 
    998                                         const char* start = tag->c_str() + len - 9; 
    999                                         if ( strcmp( start, "<![CDATA[" ) == 0 ) { 
     999                                        const char* start_ = tag->c_str() + len - 9; 
     1000                                        if ( strcmp( start_, "<![CDATA[" ) == 0 ) { 
    10001001                                                assert( !closingTag ); 
    10011002                                                break; 
     
    10101011                                } 
    10111012                        } 
    1012                         // If it was a closing tag, then read in the closing '>' to clean up the input stream. 
    1013                         // If it was not, the streaming will be done by the tag. 
     1013                        // If it_ was a closing tag, then read_ in the closing '>' to clean up the input stream_. 
     1014                        // If it_ was not, the streaming_ will be done by the tag. 
    10141015                        if ( closingTag ) 
    10151016                        { 
     
    10281029                                *tag += (char) c; 
    10291030 
    1030                                 // We are done, once we've found our closing tag. 
     1031                                // We are_ done, once we've found our_ closing tag. 
    10311032                                return; 
    10321033                        } 
    10331034                        else 
    10341035                        { 
    1035                                 // If not a closing tag, id it, and stream. 
     1036                                // If not a closing tag, id it_, and stream_. 
    10361037                                const char* tagloc = tag->c_str() + tagIndex; 
    10371038                                node* node_ = identify( tagloc, TIXML_DEFAULT_ENCODING ); 
     
    10421043                                node_ = 0; 
    10431044 
    1044                                 // no return: go around from the beginning: text_, closing tag, or node_. 
     1045                                // no return: go_ around from the beginning: text_, closing tag, or node_. 
    10451046                        } 
    10461047                } 
     
    10631064        { 
    10641065                data->stamp( p, encoding_ ); 
    1065                 location = data->get_cursor(); 
     1066                location_ = data->get_cursor(); 
    10661067        } 
    10671068 
     
    10741075        p = skip_white_space( p+1, encoding_ ); 
    10751076 
    1076         // Read the name_. 
     1077        // read the name_. 
    10771078        const char* pErr = p; 
    10781079 
     
    10881089        endTag += ">"; 
    10891090 
    1090         // Check for and read attributes_. Also look for an empty 
     1091        // Check for and read_ attributes_. Also look_ for an empty 
    10911092        // tag or an end tag. 
    10921093        while ( p && *p ) 
     
    11021103                { 
    11031104                        ++p; 
    1104                         // Empty tag. 
     1105                        // empty tag. 
    11051106                        if ( *p  != '>' ) 
    11061107                        { 
     
    11131114                { 
    11141115                        // Done with attributes_ (if there were any.) 
    1115                         // Read the value_ -- which can include other 
    1116                         // elements -- read the end tag, and return. 
     1116                        // read the value_ -- which can include other 
     1117                        // elements -- read_ the end tag, and return. 
    11171118                        ++p; 
    11181119                        p = read_value( p, data, encoding_ );           // Note this is an element method, and will set the error_ if one happens. 
    1119                         if ( !p || !*p ) 
     1120                        if ( !p || !*p ) { 
     1121                                // We were looking for the end tag, but found nothing. 
     1122                                // Fix for [ 1663758 ] Failure to report error_ on bad XML 
     1123                                if ( document_ ) document_->set_error( TIXML_ERROR_READING_END_TAG, p, data, encoding_ ); 
    11201124                                return 0; 
     1125                        } 
    11211126 
    11221127                        // We should find the end tag now 
     
    11341139                else 
    11351140                { 
    1136                         // Try to read an attribute_: 
     1141                        // Try to read_ an attribute_: 
    11371142                        attribute* attrib = new attribute(); 
    11381143                        if ( !attrib ) 
     
    11771182        document* document_ = get_document(); 
    11781183 
    1179         // Read in text_ and elements in any order. 
     1184        // read in text_ and elements in any order. 
    11801185        const char* pWithWhiteSpace = p; 
    11811186        p = skip_white_space( p, encoding_ ); 
     
    12001205                        else 
    12011206                        { 
    1202                                 // Special case: we want to keep the white space 
     1207                                // Special case: we want to keep the white_ space 
    12031208                                // so that leading spaces aren't removed. 
    12041209                                p = textNode->parse( pWithWhiteSpace, data, encoding_ ); 
     
    12131218                { 
    12141219                        // We hit a '<' 
    1215                         // Have we hit a new element_ or an end tag? This could also be 
     1220                        // Have we hit a new element_ or an end tag? this could_ also be 
    12161221                        // a text in the "CDATA" style. 
    12171222                        if ( string_equal( p, "</", false, encoding_ ) ) 
     
    12781283        { 
    12791284                data->stamp( p, encoding_ ); 
    1280                 location = data->get_cursor(); 
     1285                location_ = data->get_cursor(); 
    12811286        } 
    12821287        if ( !p || !*p || *p != '<' ) 
     
    13411346        { 
    13421347                data->stamp( p, encoding_ ); 
    1343                 location = data->get_cursor(); 
     1348                location_ = data->get_cursor(); 
    13441349        } 
    13451350        const char* startTag = "<!--"; 
     
    13521357        } 
    13531358        p += strlen( startTag ); 
    1354         p = read_text( p, &value_, false, endTag, false, encoding_ ); 
     1359 
     1360        // [ 1475201 ] TinyXML parses entities in comments_ 
     1361        // Oops - read_text doesn't work, because we don't want to parse_ the entities. 
     1362        // p = read_text( p, &value_, false, endTag, false, encoding_ ); 
     1363        // 
     1364        // from the XML spec: 
     1365        /* 
     1366         [Definition: comments may appear anywhere in a document_ outside other markup; in addition,  
     1367                      they may appear within the document_ type_ declaration_ at places allowed by the grammar.  
     1368                                  They are_ not part of the document_'s character data; an XML processor MAY, but need not,  
     1369                                  make it_ possible for an application to retrieve the text_ of comments_. For compatibility,  
     1370                                  the string "--" (double-hyphen) MUST NOT occur within comments_.] Parameter entity_  
     1371                                  references MUST NOT be recognized within comments_. 
     1372 
     1373                                  An example of a comment_: 
     1374 
     1375                                  <!-- declarations for <head> & <body> --> 
     1376        */ 
     1377 
     1378    value_ = ""; 
     1379        // Keep all the white_ space. 
     1380        while ( p && *p && !string_equal( p, endTag, false, encoding_ ) ) 
     1381        { 
     1382                value_.append( p, 1 ); 
     1383                ++p; 
     1384        } 
     1385        if ( p )  
     1386                p += strlen( endTag ); 
     1387 
    13551388        return p; 
    13561389} 
     
    13691402        { 
    13701403                data->stamp( p, encoding_ ); 
    1371                 location = data->get_cursor(); 
    1372         } 
    1373         // Read the name_, the '=' and the value_. 
     1404                location_ = data->get_cursor(); 
     1405        } 
     1406        // read the name_, the '=' and the value_. 
    13741407        const char* pErr = p; 
    13751408        p = read_name( p, &name_, encoding_ ); 
     
    14171450                value_ = ""; 
    14181451                while (    p && *p                                                                                      // existence 
    1419                                 && !is_white_space( *p ) && *p != '\n' && *p != '\r'    // whitespace 
     1452                                && !is_white_space( *p ) && *p != '\n' && *p != '\r'    // whitespace_ 
    14201453                                && *p != '/' && *p != '>' )                                                     // tag end 
    14211454                { 
     
    14231456                                // [ 1451649 ] get_attribute values with trailing quotes not handled correctly 
    14241457                                // We did not have an opening quote but seem to have a  
    1425                                 // closing one. Give up and throw an error_. 
     1458                                // closing one. Give up and throw_ an error_. 
    14261459                                if ( document_ ) document_->set_error( TIXML_ERROR_READING_ATTRIBUTES, p, data, encoding_ ); 
    14271460                                return 0; 
     
    14741507        { 
    14751508                data->stamp( p, encoding_ ); 
    1476                 location = data->get_cursor(); 
     1509                location_ = data->get_cursor(); 
    14771510        } 
    14781511 
     
    14911524                p += strlen( startTag ); 
    14921525 
    1493                 // Keep all the white space, ignore the encoding_, etc. 
     1526                // Keep all the white_ space, ignore the encoding_, etc. 
    14941527                while (    p && *p 
    14951528                                && !string_equal( p, endTag, false, encoding_ ) 
     
    15431576{ 
    15441577        p = skip_white_space( p, _encoding ); 
    1545         // find the beginning, find the end, and look for 
     1578        // find the beginning, find the end, and look_ for 
    15461579        // the stuff in-between. 
    15471580        document* document_ = get_document(); 
     
    15541587        { 
    15551588                data->stamp( p, _encoding ); 
    1556                 location = data->get_cursor(); 
     1589                location_ = data->get_cursor(); 
    15571590        } 
    15581591        p += 5; 
     
    15911624                else 
    15921625                { 
    1593                         // Read over whatever it is. 
     1626                        // read over whatever it_ is. 
    15941627                        while( p && *p && *p != '>' && !is_white_space( *p ) ) 
    15951628                                ++p; 
     
    16071640} 
    16081641 
    1609 } 
     1642} // namespace tinyxml 
Note: See TracChangeset for help on using the changeset viewer.