X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a7adaedae8ff61356e895c7ddb1a03bd176dcf6c..f2616db56739e4962f683f59ac9e207756efe23c:/utils/HelpGen/src/HelpGen.cpp diff --git a/utils/HelpGen/src/HelpGen.cpp b/utils/HelpGen/src/HelpGen.cpp index 94ddbecc85..6828f79252 100644 --- a/utils/HelpGen/src/HelpGen.cpp +++ b/utils/HelpGen/src/HelpGen.cpp @@ -54,12 +54,12 @@ #ifndef WX_PRECOMP #include #include - #include #include #include #endif // WX_PRECOMP #include +#include // C++ parsing classes #include "cjparser.h" @@ -73,12 +73,6 @@ #undef GetCurrentTime #endif -// ---------------------------------------------------------------------------- -// constants -// ---------------------------------------------------------------------------- - -#define VERSION_STRING "$Revision$" - // ----------------------------------------------------------------------------- // global vars // ----------------------------------------------------------------------------- @@ -117,6 +111,9 @@ static wxString GetAllComments(const spContext& ctx); // timeFormat is used for the call of strftime(3) static const char *GetCurrentTime(const char *timeFormat); +// get the string containing the program version +static const wxString GetVersionString(); + // ----------------------------------------------------------------------------- // private classes // ----------------------------------------------------------------------------- @@ -530,7 +527,7 @@ int HelpGenApp::OnRun() // version requested wxLogMessage("HelpGen version %s\n" "(c) 1999-2001 Vadim Zeitlin\n", - VERSION_STRING); + GetVersionString().c_str()); return 0; case 'i': @@ -851,7 +848,7 @@ void HelpGenVisitor::VisitClass( spClass& cl ) "\n" "\n" "\\section{\\class{%s}}\\label{%s}\n\n", - VERSION_STRING, + GetVersionString().c_str(), m_fileHeader.c_str(), GetCurrentTime("%d/%b/%y %H:%M:%S"), name.c_str(), @@ -1971,8 +1968,18 @@ static const char *GetCurrentTime(const char *timeFormat) return s_timeBuffer; } +static const wxString GetVersionString() +{ + wxString version = "$Revision$"; + wxRegEx("^\\$Revision$$").ReplaceFirst(&version, "\\1"); + return version; +} + /* $Log$ + Revision 1.14 2001/07/19 13:51:29 VZ + fixes to version string + Revision 1.13 2001/07/19 13:44:57 VZ 1. compilation fixes 2. don't quote special characters inside verbatim environment