// 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.IsEmpty() ) {
+ if ( !directoryOut.empty() ) {
// 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.IsEmpty() && mode == Mode_Dump )
+ if ( !ignoreFile.empty() && mode == Mode_Dump )
visitor.GetIgnoreHandler().AddNamesFromFile(ignoreFile);
spContext *ctxTop = NULL;
}
}
- if ( !ignoreFile.IsEmpty() )
+ if ( !ignoreFile.empty() )
docman.GetIgnoreHandler().AddNamesFromFile(ignoreFile);
docman.DumpDifferences(ctxTop);
m_textFunc << "}\n\n";
- if ( !m_textStoredFunctionComment.IsEmpty() ) {
+ if ( !m_textStoredFunctionComment.empty() ) {
m_textFunc << m_textStoredFunctionComment << '\n';
}
}
else
{
- membersections.Put(ms, & membersections);
+ membersections.Put(ms.c_str(), & membersections);
}
}
wxString enumeration = GetAllComments(en),
enumerationVerb;
- enumerationVerb << "\\begin{verbatim}\n"
- << en.mEnumContent
- << "\n\\end{verbatim}\n";
+ enumerationVerb << _T("\\begin{verbatim}\n")
+ << en.m_EnumContent
+ << _T("\n\\end{verbatim}\n");
// remember for later use if we're not inside a class yet
if ( !m_inClass ) {
}
wxString typedefdoc;
- typedefdoc << "{\\small \\begin{verbatim}\n"
- << "typedef " << td.mOriginalType << ' ' << td.GetName()
- << "\n\\end{verbatim}}\n"
+ typedefdoc << _T("{\\small \\begin{verbatim}\n")
+ << _T("typedef ") << td.m_OriginalType << _T(' ') << td.GetName()
+ << _T("\n\\end{verbatim}}\n")
<< GetAllComments(td);
// remember for later use if we're not inside a class yet
if ( !m_inClass ) {
- if ( !m_textStoredTypedefs.IsEmpty() ) {
+ if ( !m_textStoredTypedefs.empty() ) {
m_textStoredTypedefs << '\n';
}
"\\%sfunc{%s%s}{%s}{",
op.mIsConstant ? "const" : "",
op.mIsVirtual ? "virtual " : "",
- op.mRetType.c_str(),
+ op.m_RetType.c_str(),
funcname.c_str());
m_textFunc += func;
}
m_textFunc << ", ";
}
- m_textFunc << "\\param{" << param.mType << " }{" << param.GetName();
+ m_textFunc << "\\param{" << param.m_Type << " }{" << param.GetName();
wxString defvalue = param.mInitVal;
- if ( !defvalue.IsEmpty() ) {
+ if ( !defvalue.empty() ) {
m_textFunc << " = " << defvalue;
}
if ( !SkipSpaceUntil(pp, '{') ) {
wxLogWarning("file %s(%d): '{' expected after '\\param'",
- m_filename.c_str(), m_line);
+ m_filename.c_str(), (int)m_line);
}
else {
if ( !SkipUntil(pp, '}') ) {
wxLogWarning("file %s(%d): '}' expected after '\\param'",
- m_filename.c_str(), m_line);
+ m_filename.c_str(), (int)m_line);
}
else {
result = wxString(startParam, (*pp)++ - startParam);
if ( !SkipSpaceUntil(¤t, '{') ) {
wxLogWarning("file %s(%d): '{' expected after \\func, "
"\\constfunc or \\membersection.",
- m_filename.c_str(), m_line);
+ m_filename.c_str(), (int)m_line);
continue;
}
const char *startClass = current;
if ( !SkipUntil(¤t, ':') || *(current + 1) != ':' ) {
wxLogWarning("file %s(%d): '::' expected after "
- "\\membersection.", m_filename.c_str(), m_line);
+ "\\membersection.", m_filename.c_str(), (int)m_line);
}
else {
classname = wxString(startClass, current - startClass);
if ( !SkipUntil(¤t, '}') ) {
wxLogWarning("file %s(%d): '}' expected after return type",
- m_filename.c_str(), m_line);
+ m_filename.c_str(), (int)m_line);
continue;
}
current++;
if ( !SkipSpaceUntil(¤t, '{') ) {
wxLogWarning("file %s(%d): '{' expected after return type",
- m_filename.c_str(), m_line);
+ m_filename.c_str(), (int)m_line);
continue;
}
const char *funcEnd = current;
if ( !SkipUntil(&funcEnd, '}') ) {
wxLogWarning("file %s(%d): '}' expected after function name",
- m_filename.c_str(), m_line);
+ m_filename.c_str(), (int)m_line);
continue;
}
size_t len = strlen("\\destruct{");
if ( funcName(0, len) != "\\destruct{" ) {
wxLogWarning("file %s(%d): \\destruct expected",
- m_filename.c_str(), m_line);
+ m_filename.c_str(), (int)m_line);
continue;
}
if ( !SkipSpaceUntil(¤t, '}') ) {
wxLogWarning("file %s(%d): '}' expected after destructor",
- m_filename.c_str(), m_line);
+ m_filename.c_str(), (int)m_line);
continue;
}
if ( !SkipSpaceUntil(¤t, '{') ||
(current++, !SkipSpaceUntil(¤t, '\\')) ) {
wxLogWarning("file %s(%d): '\\param' or '\\void' expected",
- m_filename.c_str(), m_line);
+ m_filename.c_str(), (int)m_line);
continue;
}
// now come {paramtype}{paramname}
wxString paramType = ExtractStringBetweenBraces(¤t);
- if ( !!paramType ) {
+ if ( !paramType.empty() ) {
wxString paramText = ExtractStringBetweenBraces(¤t);
- if ( !!paramText ) {
+ if ( !paramText.empty() ) {
// the param declaration may contain default value
wxString paramName = paramText.BeforeFirst('='),
paramValue = paramText.AfterFirst('=');
}
else {
wxLogWarning("file %s(%d): ',' or '}' expected after "
- "'\\param'", m_filename.c_str(), m_line);
+ "'\\param'", m_filename.c_str(), (int)m_line);
continue;
}
// if we got here there was no '\\void', so must have some params
if ( paramNames.IsEmpty() ) {
wxLogWarning("file %s(%d): '\\param' or '\\void' expected",
- m_filename.c_str(), m_line);
+ m_filename.c_str(), (int)m_line);
continue;
}
paramsAll << paramTypes[param] << ' ' << paramNames[param];
}
+ wxString constStr;
+ if (foundCommand == ConstFunc)
+ constStr = _T(" const");
+
wxLogVerbose("file %s(%d): found '%s %s::%s(%s)%s'",
- m_filename.c_str(), m_line,
+ m_filename.c_str(),
+ (int)m_line,
returnType.c_str(),
classname.c_str(),
funcName.c_str(),
paramsAll.c_str(),
- foundCommand == ConstFunc ? " const" : "");
+ constStr.c_str());
// store the info about the just found function
ArrayMethodInfo *methods;
}
spClass *ctxClass = (spClass *)ctx;
- const wxString& nameClass = ctxClass->mName;
+ const wxString& nameClass = ctxClass->m_Name;
int index = m_classes.Index(nameClass);
if ( index == wxNOT_FOUND ) {
if ( !m_ignoreNames.IgnoreClass(nameClass) ) {
continue;
spOperation *ctxMethod = (spOperation *)ctx;
- const wxString& nameMethod = ctxMethod->mName;
+ const wxString& nameMethod = ctxMethod->m_Name;
// find all functions with the same name
wxArrayInt aMethodsWithSameName;
"in the docs: should be %d instead of %d.",
nameClass.c_str(),
nameMethod.c_str(),
- params.size(), method.GetParamCount());
+ (int)params.size(), (int)method.GetParamCount());
}
else {
size_t nParam = 0;
spParameter *ctxParam = (spParameter *)ctx;
const ParamInfo& param = method.GetParam(nParam);
if ( m_checkParamNames &&
- (param.GetName() != ctxParam->mName) ) {
+ (param.GetName() != ctxParam->m_Name.c_str()) ) {
foundDiff = true;
wxLogError("Parameter #%d of '%s::%s' should be "
"'%s' and not '%s'.",
- nParam + 1,
+ (int)(nParam + 1),
nameClass.c_str(),
nameMethod.c_str(),
- ctxParam->mName.c_str(),
+ ctxParam->m_Name.c_str(),
param.GetName().c_str());
continue;
}
- if ( param.GetType() != ctxParam->mType ) {
+ if ( param.GetType() != ctxParam->m_Type ) {
foundDiff = true;
wxLogError("Type of parameter '%s' of '%s::%s' "
"should be '%s' and not '%s'.",
- ctxParam->mName.c_str(),
+ ctxParam->m_Name.c_str(),
nameClass.c_str(),
nameMethod.c_str(),
- ctxParam->mType.c_str(),
+ ctxParam->m_Type.c_str(),
param.GetType().GetName().c_str());
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'.",
- ctxParam->mName.c_str(),
+ ctxParam->m_Name.c_str(),
nameClass.c_str(),
nameMethod.c_str(),
ctxParam->mInitVal.c_str(),
// don't take comments like "// ----------" &c
comment.Trim(false);
- if ( !!comment &&
+ if ( !comment.empty() &&
comment == wxString(comment[0u], comment.length() - 1) + '\n' )
comments << "\n";
else
/*
$Log$
+ Revision 1.41 2005/05/30 13:06:15 ABX
+ More warning and error fixes (work in progress with Tinderbox).
+
+ Revision 1.40 2005/05/30 11:49:32 ABX
+ More warning and error fixes (work in progress with Tinderbox).
+
+ Revision 1.39 2005/05/30 09:26:42 ABX
+ More warning and error fixes (work in progress with Tinderbox).
+
+ Revision 1.38 2005/05/24 09:06:20 ABX
+ More fixes and wxWidgets coding standards.
+
+ Revision 1.37 2005/05/23 15:22:08 ABX
+ Initial HelpGen source cleaning.
+
+ 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)