]> git.saurik.com Git - wxWidgets.git/commitdiff
Fixes to allow compilation with wxUSE_STD_STRING
authorMichael Wetherell <mike.wetherell@ntlworld.com>
Thu, 7 Apr 2005 19:52:05 +0000 (19:52 +0000)
committerMichael Wetherell <mike.wetherell@ntlworld.com>
Thu, 7 Apr 2005 19:52:05 +0000 (19:52 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33416 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

utils/HelpGen/src/cjparser.cpp
utils/HelpGen/src/ifcontext.cpp
utils/HelpGen/src/scriptbinder.cpp
utils/HelpGen/src/scriptbinder.h
utils/HelpGen/src/sourcepainter.h
utils/HelpGen/src/srcparser.cpp
utils/HelpGen/src/srcparser.h

index 9cbf7f2dfd6ab132f2bd8a92e85f096cde3d3851..3c706cbcf8c79ab0ab7602fcbe8991f5a59004b3 100644 (file)
@@ -1621,7 +1621,11 @@ bool CJSourceParser::ParseNameAndRetVal( char*& cur, bool& isAMacro )
     if ( cur >= start )
     {
         string rettype = string( start, size_t( cur-start ) );
-        rettype.Replace("WXDLLEXPORT ", ""); // FIXME just for now...
+        // FIXME just for now...
+        string::size_type pos = 0; 
+        string toerase("WXDLLEXPORT ");
+        while((pos = rettype.find(toerase, pos)) != string::npos)
+            rettype.erase(pos, toerase.length());
         pOp->mRetType = rettype;
     }
 
@@ -1912,11 +1916,11 @@ void CJSourceParser::ParseMemberVar( char*& cur )
         if ( !pAttr )
             continue;
 
-        if ( !pAttr->mType )
+        if ( pAttr->mType.empty() )
             pAttr->mType = type;
         pAttr->mVisibility = mCurVis;
 
-        if ( !!pAttr->mName )
+        if ( !pAttr->mName.empty() )
             arrange_indirection_tokens_between( pAttr->mType, pAttr->mName );
     }
 
index 79f9c72a44ff903a56f7f14cf48d0a63e848a769..85e73c04aab88f36d71773b162bd7837e85dfb23 100644 (file)
@@ -267,7 +267,7 @@ void spInterFileContext::WriteToFiles()
        {
                FILE* fp = fopen( mFiles[i].c_str(), "w+t" );
 
-               if ( int(fp) > 0 )
+               if ( fp != NULL )
                {
                        fwrite( mContents[i].c_str(), sizeof(char), mContents[i].length(), fp );
 
index 851b30388cf29660e2ffa5f109adf2c709e60856..6a5ed52c575100c457a493e6c948cfe8687380fc 100644 (file)
@@ -591,7 +591,7 @@ bool DocGeneratorBase::SaveDocument( const char*    fname,
 {
     FILE* fp = fopen( fname, fopenOptions );
 
-    if ( (int)fp == -1 ) return 0;
+    if ( !fp ) return 0;
 
     ScriptStream stm;
 
index 3d638e4290a21c22ae1b12ed75ec0fed83c783ec..f95bdcc8d335fb0298053f4936e5321220087d09 100644 (file)
        #include "wxstlvec.h"
        #include "wx/string.h"
        
-       // FIXME:: dirty!
-       typedef wxString string;
+       #ifdef wxUSE_STD_STRING
+               using std::string;
+       #else
+               // FIXME:: dirty!
+               typedef wxString string;
+       #endif
 
 #endif
 
index 333059a03a763f28ab51522725ceaf1a11d44e0f..c2456e4da21b4c337a57a7272bfe1dcb27598160 100644 (file)
        #include "wxstlvec.h"
        #include "wx/string.h"
        
-       // FIXME:: dirty!
-       #define  string wxString
+       #ifdef wxUSE_STD_STRING
+               using std::string;
+       #else
+               // FIXME:: dirty!
+               #define  string wxString
+       #endif
 
        typedef WXSTL_VECTOR_SHALLOW_COPY(int) SPBlockListT;
 
index 98951137514eef51f5fe8a65de3b37b4290754a5..f98154c822f9cdf76839d238092ca03650f0225f 100644 (file)
@@ -533,7 +533,7 @@ spFile* SourceParserBase::ParseFile( const char* fname )
 
     FILE* fp = fopen( fname, "rt" );
 
-    if ( (int)fp == -1 || !fp ) return NULL;
+    if ( !fp ) return NULL;
 
     int sz = fread( mpFileBuf, 1, mFileBufSz, fp );
 
@@ -587,7 +587,7 @@ void spAttribute::DumpThis(const wxString& indent) const
 void spOperation::DumpThis(const wxString& indent) const
 {
     wxString protection;
-    if ( !!mScope ) {
+    if ( !mScope.empty() ) {
         switch ( mVisibility ) {
             case SP_VIS_PUBLIC:
                 protection = "public";
index a6ee4668d3d143f2af921a86049db0b35709e5f3..50376aa206c7add035244c033a3d833eea3b041c 100644 (file)
     #include "wx/string.h"
     #include "wxstlvec.h"
 
-    // FOR NOW:: quick n' dirty:
-
-    #define  string wxString
+    #ifdef wxUSE_STD_STRING
+        using std::string;
+    #else
+        // FOR NOW:: quick n' dirty:
+        #define  string wxString
+    #endif
 
 #endif