// Created: 06/01/99
// RCS-ID: $Id$
// Copyright: (c) 1999 VZ
-// Licence: GPL
+// Licence: wxWindows Licence
/////////////////////////////////////////////////////////////////////////////
/*
// wxWidgets
#include "wx/wxprec.h"
+#ifdef __BORLANDC__
+ #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"
#include <stdio.h>
#include <time.h>
-// argh, Windows defines this
-#ifdef GetCurrentTime
-#undef GetCurrentTime
-#endif
-
// -----------------------------------------------------------------------------
// private functions
// -----------------------------------------------------------------------------
// return the label for the given function name (i.e. argument of \label)
-static wxString MakeLabel(const char *classname, const char *funcname = NULL);
+static wxString MakeLabel(const wxChar *classname, const wxChar *funcname = NULL);
// return the whole \helpref{arg}{arg_label} string
-static wxString MakeHelpref(const char *argument);
+static wxString MakeHelpref(const wxChar *argument);
// [un]quote special TeX characters (in place)
static void TeXFilter(wxString* str);
// get the string with current time (returns pointer to static buffer)
// timeFormat is used for the call of strftime(3)
-static const char *GetCurrentTime(const char *timeFormat);
+static const char *GetCurrentTimeFormatted(const char *timeFormat);
// get the string containing the program version
static const wxString GetVersionString();
return 1;
}
- wxString dtorname = wxString('~') + classname;
+ wxString dtorname = wxString(_T("~")) + classname;
// there is only one dtor, so the logic here is simpler
if ( (*pp1)->name == dtorname ) {
}
// two normal methods
- return strcmp((*pp1)->name, (*pp2)->name);
+ return wxStrcmp((*pp1)->name, (*pp2)->name);
}
}
return true;
if ( !Write(m_text) ) {
- wxLogError("Failed to output generated documentation.");
+ wxLogError(_T("Failed to output generated documentation."));
return false;
}
// return true if we ignore this class entirely
bool IgnoreClass(const wxString& classname) const
{
- IgnoreListEntry ignore(classname, "");
+ IgnoreListEntry ignore(classname, _T(""));
return m_ignore.Index(&ignore) != wxNOT_FOUND;
}
// returns the length of 'match' if the string 'str' starts with it or 0
// otherwise
- static size_t TryMatch(const char *str, const char *match);
+ static size_t TryMatch(const wxChar *str, const wxChar *match);
// skip spaces: returns pointer to first non space character (also
// updates the value of m_line)
// information about all functions documented in the TeX file(s)
// -------------------------------------------------------------
+public: // Note: Sun C++ 5.5 requires TypeInfo and ParamInfo to be public
+
// info about a type: for now stored as text string, but must be parsed
// further later (to know that "char *" == "char []" - TODO)
class TypeInfo
}
directoryOut = argv[current];
- if ( !!directoryOut ) {
+ if ( !directoryOut.IsEmpty() ) {
// terminate with a '/' if it doesn't have it
switch ( directoryOut.Last() ) {
case '/':
// create a parser object and a visitor derivation
CJSourceParser parser;
HelpGenVisitor visitor(directoryOut, overwrite);
- if ( !!ignoreFile && mode == Mode_Dump )
+ if ( !ignoreFile.IsEmpty() && mode == Mode_Dump )
visitor.GetIgnoreHandler().AddNamesFromFile(ignoreFile);
spContext *ctxTop = NULL;
}
}
- if ( !!ignoreFile )
+ if ( !ignoreFile.IsEmpty() )
docman.GetIgnoreHandler().AddNamesFromFile(ignoreFile);
docman.DumpDifferences(ctxTop);
{
CloseFunction();
- if ( m_inClass )
+ if ( m_inClass )
{
size_t count = m_arrayFuncDocs.GetCount();
- if ( count )
+ if ( count )
{
size_t n;
FunctionDocEntry::classname = m_classname;
}
wxLogVerbose("%s: finished generating for the current file.",
- GetCurrentTime("%H:%M:%S"));
+ GetCurrentTimeFormatted("%H:%M:%S"));
}
void HelpGenVisitor::VisitFile( spFile& file )
{
m_fileHeader = file.mFileName;
wxLogVerbose("%s: started generating docs for classes from file '%s'...",
- GetCurrentTime("%H:%M:%S"), m_fileHeader.c_str());
+ GetCurrentTimeFormatted("%H:%M:%S"), m_fileHeader.c_str());
}
void HelpGenVisitor::VisitClass( spClass& cl )
"\\section{\\class{%s}}\\label{%s}\n\n",
GetVersionString().c_str(),
m_fileHeader.c_str(),
- GetCurrentTime("%d/%b/%y %H:%M:%S"),
+ GetCurrentTimeFormatted("%d/%b/%y %H:%M:%S"),
name.c_str(),
wxString(name).MakeLower().c_str());
m_line = 1;
wxLogVerbose("%s: starting to parse doc file '%s'.",
- GetCurrentTime("%H:%M:%S"), m_filename.c_str());
+ GetCurrentTimeFormatted("%H:%M:%S"), m_filename.c_str());
// the name of the class from the last "\membersection" command: we assume
// that the following "\func" or "\constfunc" always documents a method of
delete [] buf;
wxLogVerbose("%s: finished parsing doc file '%s'.\n",
- GetCurrentTime("%H:%M:%S"), m_filename.c_str());
+ GetCurrentTimeFormatted("%H:%M:%S"), m_filename.c_str());
return true;
}
spParameter *ctxParam = (spParameter *)ctx;
const ParamInfo& param = method.GetParam(nParam);
if ( m_checkParamNames &&
- (param.GetName() != ctxParam->mName) ) {
+ (param.GetName() != ctxParam->mName.c_str()) ) {
foundDiff = true;
wxLogError("Parameter #%d of '%s::%s' should be "
continue;
}
- if ( param.GetDefValue() != ctxParam->mInitVal ) {
+ if ( param.GetDefValue() != ctxParam->mInitVal.c_str() ) {
wxLogWarning("Default value of parameter '%s' of "
"'%s::%s' should be '%s' and not "
"'%s'.",
return comments;
}
-static const char *GetCurrentTime(const char *timeFormat)
+static const char *GetCurrentTimeFormatted(const char *timeFormat)
{
static char s_timeBuffer[128];
time_t timeNow;
/*
$Log$
+ Revision 1.36 2005/04/07 19:54:58 MW
+ Workarounds to allow compilation by Sun C++ 5.5
+
+ Revision 1.35 2004/12/12 11:03:31 VZ
+ give an error message if we're built in Unicode mode (in response to bug 1079224)
+
+ Revision 1.34 2004/11/23 09:53:31 JS
+ Changed GPL to wxWindows Licence
+
+ Revision 1.33 2004/11/12 03:30:07 RL
+
+ Cruft cleanup from MJW, strip the tabs out of sound.cpp
+
+ Revision 1.32 2004/11/10 21:02:58 VZ
+ new set of fixes for problems due to huge files support: drop wxFileSize_t, use wxFileOffset only, make wxInvalidOffset an int (main part of the patch 1063498)
+
+ Revision 1.31 2004/10/05 15:38:29 ABX
+ Warning fixes found under hardest mode of OpenWatcom. Seems clean in Borland, MinGW and DMC.
+
+ Revision 1.30 2004/06/18 19:25:50 ABX
+ Small step in making HelpGen up to date unicode application.
+
Revision 1.29 2004/06/17 19:00:22 ABX
Warning fixes. Code cleanup. Whitespaces and tabs removed.