X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/33882d153df0e433c9b909fe7929ab61cb426c50..3eeefdf9bdc41618a14a8fff96a016004b030e95:/utils/HelpGen/src/HelpGen.cpp diff --git a/utils/HelpGen/src/HelpGen.cpp b/utils/HelpGen/src/HelpGen.cpp index e2f7fa1009..dbb6b655b8 100644 --- a/utils/HelpGen/src/HelpGen.cpp +++ b/utils/HelpGen/src/HelpGen.cpp @@ -55,10 +55,6 @@ #pragma hdrstop #endif -#if wxUSE_UNICODE - #error "HelpGen doesn't build in Unicode mode" -#endif - #ifndef WX_PRECOMP #include "wx/string.h" #include "wx/log.h" @@ -82,10 +78,10 @@ // ----------------------------------------------------------------------------- // return the label for the given function name (i.e. argument of \label) -static wxString MakeLabel(const wxChar *classname, const wxChar *funcname = NULL); +static wxString MakeLabel(const char *classname, const char *funcname = NULL); // return the whole \helpref{arg}{arg_label} string -static wxString MakeHelpref(const wxChar *argument); +static wxString MakeHelpref(const char *argument); // [un]quote special TeX characters (in place) static void TeXFilter(wxString* str); @@ -385,7 +381,7 @@ protected: // returns the length of 'match' if the string 'str' starts with it or 0 // otherwise - static size_t TryMatch(const wxChar *str, const wxChar *match); + static size_t TryMatch(const char *str, const char *match); // skip spaces: returns pointer to first non space character (also // updates the value of m_line) @@ -677,7 +673,7 @@ int main(int argc, char **argv) directoryOut = argv[current]; if ( !directoryOut.empty() ) { // terminate with a '/' if it doesn't have it - switch ( directoryOut.Last() ) { + switch ( directoryOut.Last().GetValue() ) { case '/': #ifdef __WXMSW__ case '\\': @@ -750,7 +746,7 @@ int main(int argc, char **argv) header.c_str()); } else if ( mode == Mode_Dump ) { - ((spFile *)ctxTop)->mFileName = header; + ((spFile *)ctxTop)->m_FileName = header; visitor.VisitAll(*ctxTop); visitor.EndVisit(); } @@ -902,7 +898,7 @@ void HelpGenVisitor::CloseClass() wxString section(m_arrayFuncDocs[n].text); // Strip leading whitespace - int pos = section.Find("\\membersection"); + int pos = section.Find(_T("\\membersection")); if (pos > -1) { section = section.Mid(pos); @@ -953,7 +949,7 @@ void HelpGenVisitor::EndVisit() void HelpGenVisitor::VisitFile( spFile& file ) { - m_fileHeader = file.mFileName; + m_fileHeader = file.m_FileName; wxLogVerbose("%s: started generating docs for classes from file '%s'...", GetCurrentTimeFormatted("%H:%M:%S"), m_fileHeader.c_str()); } @@ -1068,7 +1064,7 @@ void HelpGenVisitor::VisitClass( spClass& cl ) baseHeaderName.erase(0, 3); for ( index = 0; index < WXSIZEOF(headers); index++ ) { - if ( Stricmp(baseHeaderName, headers[index]) == 0 ) + if ( wxStricmp(baseHeaderName, headers[index]) == 0 ) break; } @@ -1295,13 +1291,19 @@ void HelpGenVisitor::VisitOperation( spOperation& op ) m_classname.c_str(), funcname.c_str(), MakeLabel(m_classname, funcname).c_str()); + wxString constStr; + if(op.mIsConstant) constStr = _T("const"); + + wxString virtualStr; + if(op.mIsVirtual) virtualStr = _T("virtual "); + wxString func; - func.Printf("\n" - "\\%sfunc{%s%s}{%s}{", - op.mIsConstant ? "const" : "", - op.mIsVirtual ? "virtual " : "", - op.m_RetType.c_str(), - funcname.c_str()); + func.Printf(_T("\n") + _T("\\%sfunc{%s%s}{%s}{"), + constStr.c_str(), + virtualStr.c_str(), + op.m_RetType.c_str(), + funcname.c_str()); m_textFunc += func; } @@ -1829,21 +1831,29 @@ bool DocManager::DumpDifferences(spContext *ctxTop) const const MethodInfo& method = *(methods[index]); bool isVirtual = ctxMethod->mIsVirtual; - if ( isVirtual != method.HasFlag(MethodInfo::Virtual) ) { + if ( isVirtual != method.HasFlag(MethodInfo::Virtual) ) + { + wxString virtualStr; + if(isVirtual)virtualStr = _T("not "); + wxLogWarning("'%s::%s' is incorrectly documented as %s" "virtual.", nameClass.c_str(), nameMethod.c_str(), - isVirtual ? "not " : ""); + virtualStr.c_str()); } bool isConst = ctxMethod->mIsConstant; - if ( isConst != method.HasFlag(MethodInfo::Const) ) { + if ( isConst != method.HasFlag(MethodInfo::Const) ) + { + wxString constStr; + if(isConst)constStr = _T("not "); + wxLogWarning("'%s::%s' is incorrectly documented as %s" "constant.", nameClass.c_str(), nameMethod.c_str(), - isConst ? "not " : ""); + constStr.c_str()); } // check that the params match @@ -2197,6 +2207,12 @@ static const wxString GetVersionString() /* $Log$ + Revision 1.45 2007/05/25 20:29:14 VS + compilation fix: can't use wxUniCharRef in switch statement + + Revision 1.44 2005/05/31 17:47:45 ABX + More warning and error fixes (work in progress with Tinderbox). + Revision 1.43 2005/05/31 15:42:43 ABX More warning and error fixes (work in progress with Tinderbox).