Initial HelpGen source cleaning.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34298 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Włodzimierz Skiba
2005-05-23 15:22:10 +00:00
parent 6131340355
commit 8bc17f14f4
7 changed files with 338 additions and 336 deletions

View File

@@ -675,7 +675,7 @@ int main(int argc, char **argv)
} }
directoryOut = argv[current]; directoryOut = argv[current];
if ( !directoryOut.IsEmpty() ) { if ( !directoryOut.empty() ) {
// terminate with a '/' if it doesn't have it // terminate with a '/' if it doesn't have it
switch ( directoryOut.Last() ) { switch ( directoryOut.Last() ) {
case '/': case '/':
@@ -735,7 +735,7 @@ int main(int argc, char **argv)
// create a parser object and a visitor derivation // create a parser object and a visitor derivation
CJSourceParser parser; CJSourceParser parser;
HelpGenVisitor visitor(directoryOut, overwrite); HelpGenVisitor visitor(directoryOut, overwrite);
if ( !ignoreFile.IsEmpty() && mode == Mode_Dump ) if ( !ignoreFile.empty() && mode == Mode_Dump )
visitor.GetIgnoreHandler().AddNamesFromFile(ignoreFile); visitor.GetIgnoreHandler().AddNamesFromFile(ignoreFile);
spContext *ctxTop = NULL; spContext *ctxTop = NULL;
@@ -781,7 +781,7 @@ int main(int argc, char **argv)
} }
} }
if ( !ignoreFile.IsEmpty() ) if ( !ignoreFile.empty() )
docman.GetIgnoreHandler().AddNamesFromFile(ignoreFile); docman.GetIgnoreHandler().AddNamesFromFile(ignoreFile);
docman.DumpDifferences(ctxTop); docman.DumpDifferences(ctxTop);
@@ -869,7 +869,7 @@ void HelpGenVisitor::CloseFunction()
m_textFunc << "}\n\n"; m_textFunc << "}\n\n";
if ( !m_textStoredFunctionComment.IsEmpty() ) { if ( !m_textStoredFunctionComment.empty() ) {
m_textFunc << m_textStoredFunctionComment << '\n'; m_textFunc << m_textStoredFunctionComment << '\n';
} }
@@ -1201,7 +1201,7 @@ void HelpGenVisitor::VisitTypeDef( spTypeDef& td )
// remember for later use if we're not inside a class yet // remember for later use if we're not inside a class yet
if ( !m_inClass ) { if ( !m_inClass ) {
if ( !m_textStoredTypedefs.IsEmpty() ) { if ( !m_textStoredTypedefs.empty() ) {
m_textStoredTypedefs << '\n'; m_textStoredTypedefs << '\n';
} }
@@ -1319,7 +1319,7 @@ void HelpGenVisitor::VisitParameter( spParameter& param )
m_textFunc << "\\param{" << param.mType << " }{" << param.GetName(); m_textFunc << "\\param{" << param.mType << " }{" << param.GetName();
wxString defvalue = param.mInitVal; wxString defvalue = param.mInitVal;
if ( !defvalue.IsEmpty() ) { if ( !defvalue.empty() ) {
m_textFunc << " = " << defvalue; m_textFunc << " = " << defvalue;
} }
@@ -1615,9 +1615,9 @@ bool DocManager::ParseTeXFile(const wxString& filename)
// now come {paramtype}{paramname} // now come {paramtype}{paramname}
wxString paramType = ExtractStringBetweenBraces(&current); wxString paramType = ExtractStringBetweenBraces(&current);
if ( !!paramType ) { if ( !paramType.empty() ) {
wxString paramText = ExtractStringBetweenBraces(&current); wxString paramText = ExtractStringBetweenBraces(&current);
if ( !!paramText ) { if ( !paramText.empty() ) {
// the param declaration may contain default value // the param declaration may contain default value
wxString paramName = paramText.BeforeFirst('='), wxString paramName = paramText.BeforeFirst('='),
paramValue = paramText.AfterFirst('='); paramValue = paramText.AfterFirst('=');
@@ -1750,7 +1750,7 @@ bool DocManager::DumpDifferences(spContext *ctxTop) const
} }
spClass *ctxClass = (spClass *)ctx; spClass *ctxClass = (spClass *)ctx;
const wxString& nameClass = ctxClass->mName; const wxString& nameClass = ctxClass->m_Name;
int index = m_classes.Index(nameClass); int index = m_classes.Index(nameClass);
if ( index == wxNOT_FOUND ) { if ( index == wxNOT_FOUND ) {
if ( !m_ignoreNames.IgnoreClass(nameClass) ) { if ( !m_ignoreNames.IgnoreClass(nameClass) ) {
@@ -1786,7 +1786,7 @@ bool DocManager::DumpDifferences(spContext *ctxTop) const
continue; continue;
spOperation *ctxMethod = (spOperation *)ctx; spOperation *ctxMethod = (spOperation *)ctx;
const wxString& nameMethod = ctxMethod->mName; const wxString& nameMethod = ctxMethod->m_Name;
// find all functions with the same name // find all functions with the same name
wxArrayInt aMethodsWithSameName; wxArrayInt aMethodsWithSameName;
@@ -1864,7 +1864,7 @@ bool DocManager::DumpDifferences(spContext *ctxTop) const
spParameter *ctxParam = (spParameter *)ctx; spParameter *ctxParam = (spParameter *)ctx;
const ParamInfo& param = method.GetParam(nParam); const ParamInfo& param = method.GetParam(nParam);
if ( m_checkParamNames && if ( m_checkParamNames &&
(param.GetName() != ctxParam->mName.c_str()) ) { (param.GetName() != ctxParam->m_Name.c_str()) ) {
foundDiff = true; foundDiff = true;
wxLogError("Parameter #%d of '%s::%s' should be " wxLogError("Parameter #%d of '%s::%s' should be "
@@ -1872,7 +1872,7 @@ bool DocManager::DumpDifferences(spContext *ctxTop) const
nParam + 1, nParam + 1,
nameClass.c_str(), nameClass.c_str(),
nameMethod.c_str(), nameMethod.c_str(),
ctxParam->mName.c_str(), ctxParam->m_Name.c_str(),
param.GetName().c_str()); param.GetName().c_str());
continue; continue;
@@ -1883,7 +1883,7 @@ bool DocManager::DumpDifferences(spContext *ctxTop) const
wxLogError("Type of parameter '%s' of '%s::%s' " wxLogError("Type of parameter '%s' of '%s::%s' "
"should be '%s' and not '%s'.", "should be '%s' and not '%s'.",
ctxParam->mName.c_str(), ctxParam->m_Name.c_str(),
nameClass.c_str(), nameClass.c_str(),
nameMethod.c_str(), nameMethod.c_str(),
ctxParam->mType.c_str(), ctxParam->mType.c_str(),
@@ -1896,7 +1896,7 @@ bool DocManager::DumpDifferences(spContext *ctxTop) const
wxLogWarning("Default value of parameter '%s' of " wxLogWarning("Default value of parameter '%s' of "
"'%s::%s' should be '%s' and not " "'%s::%s' should be '%s' and not "
"'%s'.", "'%s'.",
ctxParam->mName.c_str(), ctxParam->m_Name.c_str(),
nameClass.c_str(), nameClass.c_str(),
nameMethod.c_str(), nameMethod.c_str(),
ctxParam->mInitVal.c_str(), ctxParam->mInitVal.c_str(),
@@ -2159,7 +2159,7 @@ static wxString GetAllComments(const spContext& ctx)
// don't take comments like "// ----------" &c // don't take comments like "// ----------" &c
comment.Trim(false); comment.Trim(false);
if ( !!comment && if ( !comment.empty() &&
comment == wxString(comment[0u], comment.length() - 1) + '\n' ) comment == wxString(comment[0u], comment.length() - 1) + '\n' )
comments << "\n"; comments << "\n";
else else
@@ -2192,6 +2192,9 @@ static const wxString GetVersionString()
/* /*
$Log$ $Log$
Revision 1.37 2005/05/23 15:22:08 ABX
Initial HelpGen source cleaning.
Revision 1.36 2005/04/07 19:54:58 MW Revision 1.36 2005/04/07 19:54:58 MW
Workarounds to allow compilation by Sun C++ 5.5 Workarounds to allow compilation by Sun C++ 5.5

View File

@@ -1304,7 +1304,7 @@ void CJSourceParser::AddMacroNode( char*& cur )
get_next_token( tok ); get_next_token( tok );
pPL->mName = get_token_str( tok ); pPL->m_Name = get_token_str( tok );
skip_token( tok ); skip_token( tok );
get_next_token( tok); get_next_token( tok);
@@ -1576,7 +1576,7 @@ bool CJSourceParser::ParseNameAndRetVal( char*& cur, bool& isAMacro )
pOp->mSrcOffset = int( start - _gSrcStart ); pOp->mSrcOffset = int( start - _gSrcStart );
pOp->mHeaderLength = int( bracketPos - start ); pOp->mHeaderLength = int( bracketPos - start );
if ( mpCurCtx->GetContextType() == SP_CTX_CLASS ) if ( mpCurCtx->GetContextType() == SP_CTX_CLASS )
pOp->mScope = mpCurCtx->mName; pOp->mScope = mpCurCtx->m_Name;
mpCurCtx->AddMember( pOp ); mpCurCtx->AddMember( pOp );
pOp->mVisibility = mCurVis; pOp->mVisibility = mCurVis;
@@ -1588,10 +1588,10 @@ bool CJSourceParser::ParseNameAndRetVal( char*& cur, bool& isAMacro )
// go backwards to method name // go backwards to method name
skip_token_back( cur ); skip_token_back( cur );
pOp->mName = get_token_str( cur ); pOp->m_Name = get_token_str( cur );
// checker whether it's not an operator // checker whether it's not an operator
char chFirst = *pOp->mName.c_str(); char chFirst = *pOp->m_Name.c_str();
if ( !isalpha(chFirst) && chFirst != '_' && chFirst != '~' ) { if ( !isalpha(chFirst) && chFirst != '_' && chFirst != '~' ) {
// skip 'operator' // skip 'operator'
skip_next_token_back( cur ); skip_next_token_back( cur );
@@ -1599,20 +1599,20 @@ bool CJSourceParser::ParseNameAndRetVal( char*& cur, bool& isAMacro )
string lastToken = get_token_str( cur ); string lastToken = get_token_str( cur );
if ( lastToken == "operator" ) { if ( lastToken == "operator" ) {
lastToken += pOp->mName; lastToken += pOp->m_Name;
pOp->mName = lastToken; pOp->m_Name = lastToken;
} }
else { else {
// ok, it wasn't an operator after all // ok, it wasn't an operator after all
skip_token( cur ); skip_token( cur );
} }
} }
else if ( pOp->mName == "operator" ) { else if ( pOp->m_Name == "operator" ) {
skip_token( cur ); skip_token( cur );
get_next_token( cur ); get_next_token( cur );
string oper = get_token_str( cur ); string oper = get_token_str( cur );
pOp->mName += oper; pOp->m_Name += oper;
} }
// go backwards to method return type // go backwards to method return type
@@ -1622,14 +1622,14 @@ bool CJSourceParser::ParseNameAndRetVal( char*& cur, bool& isAMacro )
{ {
string rettype = string( start, size_t( cur-start ) ); string rettype = string( start, size_t( cur-start ) );
// FIXME just for now... // FIXME just for now...
string::size_type pos = 0; string::size_type pos = 0;
string toerase("WXDLLEXPORT "); string toerase("WXDLLEXPORT ");
while((pos = rettype.find(toerase, pos)) != string::npos) while((pos = rettype.find(toerase, pos)) != string::npos)
rettype.erase(pos, toerase.length()); rettype.erase(pos, toerase.length());
pOp->mRetType = rettype; pOp->mRetType = rettype;
} }
arrange_indirection_tokens_between( pOp->mRetType, pOp->mName ); arrange_indirection_tokens_between( pOp->mRetType, pOp->m_Name );
cur = savedPos; cur = savedPos;
restore_line_no( tmpLnNo ); restore_line_no( tmpLnNo );
@@ -1746,7 +1746,7 @@ bool CJSourceParser::ParseArguments( char*& cur )
AttachComments( *pPar, blocks[nameBlock] ); AttachComments( *pPar, blocks[nameBlock] );
// retrieve argument name // retrieve argument name
pPar->mName = string( blocks[nameBlock], blockSizes[nameBlock] ); pPar->m_Name = string( blocks[nameBlock], blockSizes[nameBlock] );
// retreive argument type // retreive argument type
@@ -1755,7 +1755,7 @@ bool CJSourceParser::ParseArguments( char*& cur )
pPar->mType = string( blocks[0], len ); pPar->mType = string( blocks[0], len );
arrange_indirection_tokens_between( pPar->mType, pPar->mName ); arrange_indirection_tokens_between( pPar->mType, pPar->m_Name );
if ( *cur == ')' ) if ( *cur == ')' )
{ {
@@ -1871,7 +1871,7 @@ void CJSourceParser::ParseMemberVar( char*& cur )
// attach comments about the attribute // attach comments about the attribute
AttachComments( *pAttr, cur ); AttachComments( *pAttr, cur );
pAttr->mName = get_token_str( cur ); pAttr->m_Name = get_token_str( cur );
// guessing that this going to be variable type // guessing that this going to be variable type
skip_next_token_back( cur ); skip_next_token_back( cur );
@@ -1887,13 +1887,13 @@ void CJSourceParser::ParseMemberVar( char*& cur )
// yes, we've mistaken, it was not a identifier, // yes, we've mistaken, it was not a identifier,
// but it's default value // but it's default value
pAttr->mInitVal = pAttr->mInitVal =
pAttr->mName; pAttr->m_Name;
// skip default value and '=' symbol // skip default value and '=' symbol
skip_next_token_back( cur ); skip_next_token_back( cur );
skip_token_back( cur ); skip_token_back( cur );
pAttr->mName = get_token_str( cur ); pAttr->m_Name = get_token_str( cur );
skip_next_token_back( cur ); skip_next_token_back( cur );
skip_token_back( cur ); skip_token_back( cur );
@@ -1920,8 +1920,8 @@ void CJSourceParser::ParseMemberVar( char*& cur )
pAttr->mType = type; pAttr->mType = type;
pAttr->mVisibility = mCurVis; pAttr->mVisibility = mCurVis;
if ( !pAttr->mName.empty() ) if ( !pAttr->m_Name.empty() )
arrange_indirection_tokens_between( pAttr->mType, pAttr->mName ); arrange_indirection_tokens_between( pAttr->mType, pAttr->m_Name );
} }
cur = savedPos; cur = savedPos;
@@ -1984,15 +1984,15 @@ void CJSourceParser::SkipFunctionBody( char*& cur )
// separate scope resolution token from the name of operation // separate scope resolution token from the name of operation
for( size_t i = 0; i != op.mName.length(); ++i ) for( size_t i = 0; i != op.m_Name.length(); ++i )
{ {
if ( op.mName[i] == ':' && op.mName[i+1] == ':' ) if ( op.m_Name[i] == ':' && op.m_Name[i+1] == ':' )
{ {
string unscoped( op.mName, i+2, op.mName.length() - ( i + 2 ) ); string unscoped( op.m_Name, i+2, op.m_Name.length() - ( i + 2 ) );
op.mScope = string( op.mName, 0, i ); op.mScope = string( op.m_Name, 0, i );
op.mName = unscoped; op.m_Name = unscoped;
break; break;
} }
@@ -2075,7 +2075,7 @@ void CJSourceParser::AddClassNode( char*& cur )
pClass->mSrcOffset = int( ctxStart - _gSrcStart ); pClass->mSrcOffset = int( ctxStart - _gSrcStart );
char* nameTok = cur; char* nameTok = cur;
pClass->mName = get_token_str( cur ); pClass->m_Name = get_token_str( cur );
bool isDerived = 0; bool isDerived = 0;
@@ -2106,7 +2106,7 @@ void CJSourceParser::AddClassNode( char*& cur )
if ( nameTok != tok ) if ( nameTok != tok )
{ {
pClass->mName = get_token_str( tok ); pClass->m_Name = get_token_str( tok );
} }
} }
@@ -2180,7 +2180,7 @@ void CJSourceParser::AddClassNode( char*& cur )
skip_next_token_back( tok ); skip_next_token_back( tok );
skip_token_back( tok ); skip_token_back( tok );
pClass->mName = get_token_str( tok ); pClass->m_Name = get_token_str( tok );
restore_line_no( tmpLn ); restore_line_no( tmpLn );
} }
@@ -2215,7 +2215,7 @@ void CJSourceParser::AddEnumNode( char*& cur )
// check if enumeration has got it's identifier // check if enumeration has got it's identifier
if ( *cur != '{' ) if ( *cur != '{' )
{ {
pEnum->mName = get_token_str( cur ); pEnum->m_Name = get_token_str( cur );
} }
if ( !skip_imp_block( cur ) ) return; if ( !skip_imp_block( cur ) ) return;
@@ -2227,7 +2227,7 @@ void CJSourceParser::AddEnumNode( char*& cur )
// check if the identifier if after the {...} block // check if the identifier if after the {...} block
if ( *cur != ';' ) if ( *cur != ';' )
pEnum->mName = get_token_str( cur ); pEnum->m_Name = get_token_str( cur );
} }
clear_commets_queue(); clear_commets_queue();
@@ -2288,7 +2288,7 @@ void CJSourceParser::AddTypeDefNode( char*& cur )
get_string_between( start, typeEnd, &pTDef->mOriginalType ); get_string_between( start, typeEnd, &pTDef->mOriginalType );
get_string_between( nameStart, nameEnd, &pTDef->mName ); get_string_between( nameStart, nameEnd, &pTDef->m_Name );
clear_commets_queue(); clear_commets_queue();

View File

@@ -149,7 +149,7 @@ bool ScriptTemplate::HasVar( const char* name )
{ {
for( size_t i = 0; i != mVars.size(); ++i ) for( size_t i = 0; i != mVars.size(); ++i )
if ( strcmp( mVars[i]->mName, name ) == 0 ) if ( strcmp( mVars[i]->m_Name, name ) == 0 )
return 1; return 1;
@@ -197,7 +197,7 @@ inline void ScriptTemplate::PrintVar( TVarInfo* pInfo,
case TVAR_INTEGER : case TVAR_INTEGER :
{ {
sprintf(buf, "%d",*( (int*) ((char*)dataObj + pInfo->mOfs) ) ); sprintf(buf, "%d",*( (int*) ((char*)dataObj + pInfo->mOfs) ) );
stm.WriteBytes( buf, strlen(buf ) ); stm.WriteBytes( buf, strlen(buf ) );
break; break;
} }
@@ -213,7 +213,7 @@ inline void ScriptTemplate::PrintVar( TVarInfo* pInfo,
cout << "DBG:: dataObj points to " << (int)dataObj << endl; cout << "DBG:: dataObj points to " << (int)dataObj << endl;
cout << "DBG:: pInfo->mOfs value is " << (int)pInfo->mOfs << endl; cout << "DBG:: pInfo->mOfs value is " << (int)pInfo->mOfs << endl;
cout << "DBG:: d+pInfo->mOfs is " << (int)((char*)dataObj + pInfo->mOfs) << endl; cout << "DBG:: d+pInfo->mOfs is " << (int)((char*)dataObj + pInfo->mOfs) << endl;
cout << "DBG:: pInfo->mName is " << pInfo->mName << endl; cout << "DBG:: pInfo->m_Name is " << pInfo->m_Name << endl;
cout << "DBG:: pInfo->mType is " << pInfo->mType << endl; cout << "DBG:: pInfo->mType is " << pInfo->mType << endl;
cout << "DBG:: end of dump. " << endl; cout << "DBG:: end of dump. " << endl;
@@ -246,7 +246,7 @@ inline void ScriptTemplate::PrintVar( TVarInfo* pInfo,
} }
int* array = *((int**)( (char*)dataObj+info.mRefOfs )); int* array = *((int**)( (char*)dataObj+info.mRefOfs ));
ScriptTemplate* pRefTempl; ScriptTemplate* pRefTempl;
for( int i = 0; i != sz; ++i ) for( int i = 0; i != sz; ++i )
@@ -297,7 +297,7 @@ void ScriptTemplate::PrintScript( void* dataObj, ScriptStream& stm )
for( size_t i = 0; i != sz; ++i ) for( size_t i = 0; i != sz; ++i )
{ {
if ( strcmp( mVars[i]->mName, start ) == 0 ) if ( strcmp( mVars[i]->m_Name, start ) == 0 )
{ {
PrintVar( mVars[i], dataObj, stm ); PrintVar( mVars[i], dataObj, stm );
@@ -328,7 +328,7 @@ ScriptSection::ScriptSection( const string& name,
) )
: mpParent ( NULL ), : mpParent ( NULL ),
mName ( name ), m_Name ( name ),
mBody ( body ), mBody ( body ),
mAutoHide( autoHide ), mAutoHide( autoHide ),
@@ -411,7 +411,7 @@ ScriptSection* ScriptSection::GetSubsection( const char* name )
// DBG:: // DBG::
//ScriptSection& sect = *mSubsections[i]; //ScriptSection& sect = *mSubsections[i];
if ( mSubsections[i]->mName == buf ) if ( mSubsections[i]->m_Name == buf )
{ {
if ( name[cur] == '/' ) if ( name[cur] == '/' )
@@ -467,8 +467,8 @@ void ScriptSection::RegisterTemplate( ScriptTemplate& sectionTempalte )
arrRefOfs, arrSizeOfs, refTemplOfs; arrRefOfs, arrSizeOfs, refTemplOfs;
// obtaining offsets of member vars // obtaining offsets of member vars
GET_VAR_OFS( ScriptSection, mName, &nameOfs ) GET_VAR_OFS( ScriptSection, m_Name, &nameOfs )
GET_VAR_OFS( ScriptSection, mBody, &bodyOfs ) GET_VAR_OFS( ScriptSection, mBody, &bodyOfs )
GET_VAR_OFS( ScriptSection, mId, &idOfs ) GET_VAR_OFS( ScriptSection, mId, &idOfs )
GET_VAR_OFS( ScriptSection, mRefFirst, &arrRefOfs ) GET_VAR_OFS( ScriptSection, mRefFirst, &arrRefOfs )
@@ -511,7 +511,7 @@ void ScriptSection::DoRemoveEmptySections(int& nRemoved, SectListT& removedLst)
sect.DoRemoveEmptySections( nRemoved, removedLst ); sect.DoRemoveEmptySections( nRemoved, removedLst );
if (sect.mAutoHide ) if (sect.mAutoHide )
if ( sect.mReferences.size() == 0 ) if ( sect.mReferences.size() == 0 )
{ {
bool found = false; bool found = false;
@@ -522,7 +522,7 @@ void ScriptSection::DoRemoveEmptySections(int& nRemoved, SectListT& removedLst)
found = 1; found = 1;
break; break;
} }
if ( !found ) if ( !found )
{ {
removedLst.push_back( &sect ); removedLst.push_back( &sect );

View File

@@ -6,7 +6,7 @@
// Created: 22/09/98 // Created: 22/09/98
// RCS-ID: $Id$ // RCS-ID: $Id$
// Copyright: (c) Aleskandars Gluchovas // Copyright: (c) Aleskandars Gluchovas
// Licence: wxWindows licence // Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
#ifndef __SCRIPTBINDER_G__ #ifndef __SCRIPTBINDER_G__
@@ -14,26 +14,26 @@
#if defined( wxUSE_TEMPLATE_STL ) #if defined( wxUSE_TEMPLATE_STL )
#include <vector> #include <vector>
#ifdef WIN32 #ifdef WIN32
#include <bstring.h> #include <bstring.h>
#else #else
#include <strclass.h> #include <strclass.h>
#include <string.h> #include <string.h>
#endif #endif
#else #else
#include "wxstlvec.h" #include "wxstlvec.h"
#include "wx/string.h" #include "wx/string.h"
#ifdef wxUSE_STD_STRING #if wxUSE_STD_STRING
using std::string; using std::string;
#else #else
// FIXME:: dirty! // FIXME:: dirty!
typedef wxString string; typedef wxString string;
#endif #endif
#endif #endif
@@ -49,26 +49,26 @@
class ScriptStream class ScriptStream
{ {
protected: protected:
char* mpBuf; char* mpBuf;
size_t mSize; size_t mSize;
size_t mCapacity; size_t mCapacity;
public: public:
ScriptStream(); ScriptStream();
~ScriptStream(); ~ScriptStream();
void WriteBytes( const void* srcBuf, size_t count ); void WriteBytes( const void* srcBuf, size_t count );
ScriptStream& operator<<( const char* str ); ScriptStream& operator<<( const char* str );
ScriptStream& operator<<( const string& str ); ScriptStream& operator<<( const string& str );
ScriptStream& operator<<( char ch ); ScriptStream& operator<<( char ch );
void endl(); void endl();
inline char* GetBuf() { return mpBuf; } inline char* GetBuf() { return mpBuf; }
inline size_t GetBufSize() { return mSize; } inline size_t GetBufSize() { return mSize; }
// clears current contents of the stream // clears current contents of the stream
void Reset() { mSize = 0; } void Reset() { mSize = 0; }
}; };
@@ -78,10 +78,10 @@ class ScriptTemplate;
enum TEMPLATE_VARIABLE_TYPES enum TEMPLATE_VARIABLE_TYPES
{ {
TVAR_INTEGER, TVAR_INTEGER,
TVAR_STRING, TVAR_STRING,
TVAR_DOUBLE, TVAR_DOUBLE,
TVAR_REF_ARRAY TVAR_REF_ARRAY
}; };
// helper structures used only by ScriptTemplate // helper structures used only by ScriptTemplate
@@ -89,31 +89,31 @@ enum TEMPLATE_VARIABLE_TYPES
struct TVarInfo struct TVarInfo
{ {
public: public:
const char* mName; const char* m_Name;
int mType; int mType;
int mOfs; int mOfs;
TVarInfo( const char* name, int ofs, int varType ) TVarInfo( const char* name, int ofs, int varType )
: mName(name), : m_Name(name),
mType( varType ), mType( varType ),
mOfs( ofs ) mOfs( ofs )
{} {}
}; };
struct TArrayInfo : public TVarInfo struct TArrayInfo : public TVarInfo
{ {
public: public:
int mRefOfs; int mRefOfs;
int mSizeIntOfs; int mSizeIntOfs;
int mObjRefTemplOfs; int mObjRefTemplOfs;
TArrayInfo( const char* name ) TArrayInfo( const char* name )
: TVarInfo( name, 0, TVAR_REF_ARRAY ) : TVarInfo( name, 0, TVAR_REF_ARRAY )
{} {}
}; };
// stores offset of the given member (of the given class) // stores offset of the given member (of the given class)
// to (*pOfs), though the use of template classes would have // to (*pOfs), though the use of template classes would have
// solved this problem in much clearer fashion // solved this problem in much clearer fashion
// FOR NOW:: obtaining physical offset of class member // FOR NOW:: obtaining physical offset of class member
@@ -121,38 +121,38 @@ public:
// FIXME:: +/- 1 problem // FIXME:: +/- 1 problem
#ifdef __UNIX__ #ifdef __UNIX__
#define WEIRD_OFFSET 1 #define WEIRD_OFFSET 1
#else #else
#define WEIRD_OFFSET 0 #define WEIRD_OFFSET 0
#endif #endif
#define GET_VAR_OFS( className, varName, pOfs ) \ #define GET_VAR_OFS( className, varName, pOfs ) \
{ \ { \
int* className::* varPtr; \ int* className::* varPtr; \
varPtr = (int* className::*)&className::varName; \ varPtr = (int* className::*)&className::varName; \
\ \
(*pOfs) = int(*(int*)&varPtr)-WEIRD_OFFSET; \ (*pOfs) = int(*(int*)&varPtr)-WEIRD_OFFSET; \
} }
class ScriptSection; class ScriptSection;
#if defined( wxUSE_TEMPLATE_STL ) #if defined( wxUSE_TEMPLATE_STL )
typedef vector<TVarInfo*> TVarListT; typedef vector<TVarInfo*> TVarListT;
// container class for sections // container class for sections
typedef vector<ScriptSection*> SectListT; typedef vector<ScriptSection*> SectListT;
#else #else
typedef TVarInfo* TVarInfoPtrT; typedef TVarInfo* TVarInfoPtrT;
typedef ScriptSection* ScriptSectionPtrT; typedef ScriptSection* ScriptSectionPtrT;
typedef WXSTL_VECTOR_SHALLOW_COPY(TVarInfoPtrT) TVarListT; typedef WXSTL_VECTOR_SHALLOW_COPY(TVarInfoPtrT) TVarListT;
// container class for sections // container class for sections
typedef WXSTL_VECTOR_SHALLOW_COPY(ScriptSectionPtrT) SectListT; typedef WXSTL_VECTOR_SHALLOW_COPY(ScriptSectionPtrT) SectListT;
#endif #endif
@@ -163,42 +163,41 @@ class ScriptSection;
class ScriptTemplate class ScriptTemplate
{ {
protected: protected:
// do not use string object here - parsing of // do not use string object here - parsing of
// C string can be much faster (in debug v.) // C string can be much faster (in debug v.)
char* mTText; char* mTText;
TVarListT mVars; TVarListT mVars;
inline void PrintVar( TVarInfo* pInfo,
void* dataObj,
ScriptStream& stm );
inline void PrintVar( TVarInfo* pInfo,
void* dataObj,
ScriptStream& stm );
public: public:
ScriptTemplate( const string& templateText ); ScriptTemplate( const string& templateText );
virtual ~ScriptTemplate(); virtual ~ScriptTemplate();
bool HasVar( const char* name );
// Member variables registration methods. bool HasVar( const char* name );
// NOTE:: GET_VAR_OFS() macro should be used // Member variables registration methods.
// to get offset of the class member (see #define above)
void AddStringVar ( const char* name, int ofs );
void AddIntegerVar( const char* name, int ofs );
void AddDoubleVar ( const char* name, int ofs );
void AddObjectRefArray( const char* name, // NOTE:: GET_VAR_OFS() macro should be used
int ofsRefToFirstObj, // to get offset of the class member (see #define above)
int ofsObjSizeInt, void AddStringVar ( const char* name, int ofs );
int ofsObjRefTempl void AddIntegerVar( const char* name, int ofs );
); void AddDoubleVar ( const char* name, int ofs );
// reads the script, replaces $(..) tags with values void AddObjectRefArray( const char* name,
// of registered members of dataObj object, and outputs int ofsRefToFirstObj,
// the result to given text stream int ofsObjSizeInt,
int ofsObjRefTempl
);
void PrintScript( void* dataObj, ScriptStream& stm ); // reads the script, replaces $(..) tags with values
// of registered members of dataObj object, and outputs
// the result to given text stream
void PrintScript( void* dataObj, ScriptStream& stm );
}; };
class ScriptSection; class ScriptSection;
@@ -210,108 +209,108 @@ class ScriptSection
{ {
protected: protected:
// NOTE:: "$(NAME)", $(ID), "$(BODY)" and "$(REFLIST)" aree // NOTE:: "$(NAME)", $(ID), "$(BODY)" and "$(REFLIST)" are
// reseved template variables of ScriptSection // reseved template variables of ScriptSection
// the below there members are registered to ScriptTemplate, // the below there members are registered to ScriptTemplate,
// GUID within the section tree (numeric) // GUID within the section tree (numeric)
ScriptSection* mpParent; ScriptSection* mpParent;
string mId; // $(ID) string mId; // $(ID)
string mName; // $(NAME) string m_Name;// $(NAME)
string mBody; // $(BODY) string mBody; // $(BODY)
// NULL, if this section is not aggregated anywhere // NULL, if this section is not aggregated anywhere
SectListT mSubsections; // aggregated sectons SectListT mSubsections; // aggregated sectons
SectListT mReferences; // registered as $(REFLIST) SectListT mReferences; // registered as $(REFLIST)
bool mAutoHide; // see autoHide arg, in constructor bool mAutoHide; // see autoHide arg, in constructor
bool mSortOn; // TRUE, if sort subsectons by naem bool mSortOn; // true, if sort subsectons by naem
// tempalte for this section // tempalte for this section
ScriptTemplate* mpSectTempl; ScriptTemplate* mpSectTempl;
// template used for links (or references) to this section // template used for links (or references) to this section
ScriptTemplate* mpRefTempl; ScriptTemplate* mpRefTempl;
// do not call destructor of this object,
// call RemoveRef() instead
int mRefCount;
static int mIdCounter; // generator of GUIDs // do not call destructor of this object,
// call RemoveRef() instead
int mRefCount;
// fields registered and used by ScriptTemplate object static int mIdCounter; // generator of GUIDs
void* mRefFirst;
int mArrSize; // fields registered and used by ScriptTemplate object
void* mRefFirst;
int mArrSize;
protected: protected:
virtual void AddRef(); virtual void AddRef();
virtual void RemoveRef(); virtual void RemoveRef();
void DoRemoveEmptySections(int& nRemoved, SectListT& removedLst); void DoRemoveEmptySections(int& nRemoved, SectListT& removedLst);
void DoRemoveDeadLinks( SectListT& removedLst); void DoRemoveDeadLinks( SectListT& removedLst);
public: public:
// NOTE:: pass NULL to certain template, if your sure // NOTE:: pass NULL to certain template, if your sure
// this kind of template will never be used, // this kind of template will never be used,
// e.g. if section is contained but never referrenced, // e.g. if section is contained but never referrenced,
// then pReferenceTemplate can be NULL // then pReferenceTemplate can be NULL
// if autoHide option is TRUE, the section will be automatically // if autoHide option is true, the section will be automatically
// collapsed (not shown) if it doesn't contain any references // collapsed (not shown) if it doesn't contain any references
// to other sections (e.g. could be usefull for autoamically // to other sections (e.g. could be usefull for autoamically
// hiding empty index-sections). // hiding empty index-sections).
ScriptSection( const string& name = "", ScriptSection( const string& name = "",
const string& body = "", const string& body = "",
ScriptTemplate* pSectionTemplate = NULL, ScriptTemplate* pSectionTemplate = NULL,
ScriptTemplate* pReferenceTemplate = NULL, ScriptTemplate* pReferenceTemplate = NULL,
bool autoHide = FALSE, bool autoHide = false,
bool sorted = FALSE bool sorted = false
); );
// calls RemoveRef() to all aggreagated sections first, // calls RemoveRef() to all aggreagated sections first,
// then to all referenced section - this way all // then to all referenced section - this way all
// sections (even not aggregated ones) become "garbage-collected" // sections (even not aggregated ones) become "garbage-collected"
// NOTE:: do not call destructor directlly, call RemoveRef() // NOTE:: do not call destructor directlly, call RemoveRef()
// instead // instead
virtual ~ScriptSection(); virtual ~ScriptSection();
// if addToReferencesToo is TRUE, section is aggregated and // if addToReferencesToo is true, section is aggregated and
// also added to reference list of this section // also added to reference list of this section
void AddSection( ScriptSection* pSection, bool addToReferencesToo = FALSE ); void AddSection( ScriptSection* pSection, bool addToReferencesToo = false );
// add cross-reference to this given section // add cross-reference to this given section
void AddReference( ScriptSection* pReferredSection ); void AddReference( ScriptSection* pReferredSection );
// subsection may be given of variable depth level, // subsection may be given of variable depth level,
// e.g. "publications/reviews/software" // e.g. "publications/reviews/software"
ScriptSection* GetSubsection( const char* name ); ScriptSection* GetSubsection( const char* name );
// returns list aggregated sections // returns list aggregated sections
SectListT& GetSubsections(); SectListT& GetSubsections();
// binds reserved template names ( $(..) ) to member // binds reserved template names ( $(..) ) to member
// vairalbes in the ScriptSection class, should be called // vairalbes in the ScriptSection class, should be called
// to initialize each user-code provided script template // to initialize each user-code provided script template
static void RegisterTemplate( ScriptTemplate& sectionTempalte ); static void RegisterTemplate( ScriptTemplate& sectionTempalte );
// prints out section tree to the stream, starting from // prints out section tree to the stream, starting from
// this section as a root node // this section as a root node
virtual void Print( ScriptStream& stm ); virtual void Print( ScriptStream& stm );
// searches empty sections which has autoHide == TRUE, // searches empty sections which has autoHide == true,
// and colapses them (this method should be called ) // and colapses them (this method should be called )
// on the root-section of the sections tree // on the root-section of the sections tree
// NOTE:: does not work properly, yet! // NOTE:: does not work properly, yet!
void RemoveEmptySections(); void RemoveEmptySections();
}; };
// base class for documnetation generators // base class for documnetation generators
@@ -321,61 +320,61 @@ public:
class DocGeneratorBase class DocGeneratorBase
{ {
protected: protected:
MarkupTagsT mTags; MarkupTagsT mTags;
// override this method to do some post processing // override this method to do some post processing
// after generation of document, or even write some // after generation of document, or even write some
// data into output stream, before the section tree // data into output stream, before the section tree
// is flushed into it. // is flushed into it.
// return FALSE, if something has gone wrong and // return false, if something has gone wrong and
// document cannot be saved now // document cannot be saved now
virtual bool OnSaveDocument( ScriptStream& WXUNUSED(stm) ) virtual bool OnSaveDocument( ScriptStream& WXUNUSED(stm) )
{ return 1; } { return 1; }
// override this method to provide reference to // override this method to provide reference to
// the top section of the document (used as default // the top section of the document (used as default
// starting section when saving a document) // starting section when saving a document)
virtual ScriptSection* GetTopSection() virtual ScriptSection* GetTopSection()
{ return 0; } { return 0; }
public: public:
DocGeneratorBase() DocGeneratorBase()
: mTags(0) // no defaul script : mTags(0) // no defaul script
{} {}
// dectrouctors of polymorphic classes SHOULD be virtual // dectrouctors of polymorphic classes SHOULD be virtual
virtual ~DocGeneratorBase() {} virtual ~DocGeneratorBase() {}
// returns tags, being used for specific target script // returns tags, being used for specific target script
MarkupTagsT GetScriptMarkupTags() { return mTags; } MarkupTagsT GetScriptMarkupTags() { return mTags; }
// sets tag array for specific script // sets tag array for specific script
// NOTE:: Why virtual? since approach with MarkupTagsT is // NOTE:: Why virtual? since approach with MarkupTagsT is
// "flowless" only in theory. Overriding this method // "flowless" only in theory. Overriding this method
// allows document generators to check the type of the // allows document generators to check the type of the
// target script, and perhaps make some modifications // target script, and perhaps make some modifications
// to generator's tamplates, to match the specific script // to generator's tamplates, to match the specific script
virtual void SetScriptMarkupTags( MarkupTagsT tags ) virtual void SetScriptMarkupTags( MarkupTagsT tags )
{ mTags = tags; } { mTags = tags; }
// seves document to file starting from the root-node of // seves document to file starting from the root-node of
// the document (provided by GetTopSection() method), // the document (provided by GetTopSection() method),
// or from "pFromSection" if it's not NULL. // or from "pFromSection" if it's not NULL.
// fopenOptions arg. is string passed to fopen() method, // fopenOptions arg. is string passed to fopen() method,
// returns TRUE, if saving was successfull // returns true, if saving was successfull
virtual bool SaveDocument( const char* fname,
const char* fopenOptions = "w",
ScriptSection* pFromSection = NULL
);
virtual bool SaveDocument( const char* fname,
const char* fopenOptions = "w",
ScriptSection* pFromSection = NULL
);
}; };
#endif #endif

View File

@@ -6,7 +6,7 @@
// Created: 22/09/98 // Created: 22/09/98
// RCS-ID: $Id$ // RCS-ID: $Id$
// Copyright: (c) Aleskandars Gluchovas // Copyright: (c) Aleskandars Gluchovas
// Licence: wxWindows licence // Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
#ifndef __SOURCEPAINTER_G__ #ifndef __SOURCEPAINTER_G__
@@ -18,28 +18,28 @@
#if defined( wxUSE_TEMPLATE_STL ) #if defined( wxUSE_TEMPLATE_STL )
#include <vector.h> #include <vector.h>
typedef vector<int> SPBlockListT; typedef vector<int> SPBlockListT;
#ifdef WIN32 #ifdef WIN32
#include <bstring.h> #include <bstring.h>
#else #else
#include <strclass.h> #include <strclass.h>
#include <string.h> #include <string.h>
#endif #endif
#else #else
#include "wxstlvec.h" #include "wxstlvec.h"
#include "wx/string.h" #include "wx/string.h"
#ifdef wxUSE_STD_STRING
using std::string;
#else
// FIXME:: dirty!
#define string wxString
#endif
typedef WXSTL_VECTOR_SHALLOW_COPY(int) SPBlockListT; #if wxUSE_STD_STRING
using std::string;
#else
// FIXME:: dirty!
#define string wxString
#endif
typedef WXSTL_VECTOR_SHALLOW_COPY(int) SPBlockListT;
#endif #endif
@@ -63,46 +63,46 @@
class SourcePainter class SourcePainter
{ {
protected: protected:
string mResultStr; string mResultStr;
SPBlockListT mBlocks; SPBlockListT mBlocks;
bool mCollectResultsOn; bool mCollectResultsOn;
// state variables // state variables
bool mIsInComment; bool mIsInComment;
bool mCommentIsMultiline; bool mCommentIsMultiline;
public: public:
// assembleResultString == TRUE - instructs painter // assembleResultString == true - instructs painter
// to collect each chunk of srouce passed to ProcessSource(), // to collect each chunk of srouce passed to ProcessSource(),
// so that results cann be futher obtained in a single string // so that results cann be futher obtained in a single string
// instead of vector of block descriptions // instead of vector of block descriptions
SourcePainter( bool assembleResultString = TRUE ); SourcePainter( bool assembleResultString = true );
virtual ~SourcePainter() {} virtual ~SourcePainter() {}
// can be called multiple times (e.g. on each source line) // can be called multiple times (e.g. on each source line)
void ProcessSource( char* src, int srcLen ); void ProcessSource( char* src, int srcLen );
// method, for manually adjusting state of source painter // method, for manually adjusting state of source painter
void SetState( bool isInComment, void SetState( bool isInComment,
bool commentIsMultiline ); bool commentIsMultiline );
// reinitializes object - clears results of previouse processing // reinitializes object - clears results of previouse processing
void Init( bool assembleResultString = TRUE ); void Init( bool assembleResultString = true );
// generates string of highlighted source for the scipting // generates string of highlighted source for the scipting
// language given by "tags" argument // language given by "tags" argument
virtual void GetResultString(string& result, MarkupTagsT tags);
// returns vector of block descriptors, see SPBlockListT definition virtual void GetResultString(string& result, MarkupTagsT tags);
// (block descriptors can be used for fast custom hightlighted text generation)
SPBlockListT& GetBlocks(); // returns vector of block descriptors, see SPBlockListT definition
// (block descriptors can be used for fast custom hightlighted text generation)
// NOTE:: static method SPBlockListT& GetBlocks();
// returns if the given word is a reserved word or basic type identifier
static bool IsKeyword( char* word, int wordLen ); // NOTE:: static method
// returns if the given word is a reserved word or basic type identifier
static bool IsKeyword( char* word, int wordLen );
}; };
#endif #endif

View File

@@ -6,7 +6,7 @@
// Created: 22/09/98 // Created: 22/09/98
// RCS-ID: $Id$ // RCS-ID: $Id$
// Copyright: (c) Aleskandars Gluchovas // Copyright: (c) Aleskandars Gluchovas
// Licence: wxWindows licence // Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__ #ifdef __GNUG__
@@ -425,7 +425,7 @@ string spOperation::GetFullName(MarkupTagsT tags)
{ {
string txt = tags[TAG_BOLD].start + mRetType; string txt = tags[TAG_BOLD].start + mRetType;
txt += " "; txt += " ";
txt += mName; txt += m_Name;
txt += "( "; txt += "( ";
txt += tags[TAG_BOLD].end; txt += tags[TAG_BOLD].end;
@@ -447,7 +447,7 @@ string spOperation::GetFullName(MarkupTagsT tags)
txt += tags[TAG_ITALIC].start; txt += tags[TAG_ITALIC].start;
txt += " "; txt += " ";
txt += param.mName; txt += param.m_Name;
if ( param.mInitVal != "" ) if ( param.mInitVal != "" )
{ {
@@ -575,13 +575,13 @@ void spContext::DumpThis(const wxString& WXUNUSED(indent)) const
void spParameter::DumpThis(const wxString& indent) const void spParameter::DumpThis(const wxString& indent) const
{ {
wxLogDebug("%sparam named '%s' of type '%s'", wxLogDebug("%sparam named '%s' of type '%s'",
indent.c_str(), mName.c_str(), mType.c_str()); indent.c_str(), m_Name.c_str(), mType.c_str());
} }
void spAttribute::DumpThis(const wxString& indent) const void spAttribute::DumpThis(const wxString& indent) const
{ {
wxLogDebug("%svariable named '%s' of type '%s'", wxLogDebug("%svariable named '%s' of type '%s'",
indent.c_str(), mName.c_str(), mType.c_str()); indent.c_str(), m_Name.c_str(), mType.c_str());
} }
void spOperation::DumpThis(const wxString& indent) const void spOperation::DumpThis(const wxString& indent) const
@@ -614,7 +614,7 @@ void spOperation::DumpThis(const wxString& indent) const
mIsConstant ? "const " : "", mIsConstant ? "const " : "",
mIsVirtual ? "virtual " : "", mIsVirtual ? "virtual " : "",
protection.c_str(), protection.c_str(),
mScope.c_str(), mName.c_str(), mRetType.c_str()); mScope.c_str(), m_Name.c_str(), mRetType.c_str());
} }
void spPreprocessorLine::DumpThis(const wxString& indent) const void spPreprocessorLine::DumpThis(const wxString& indent) const
@@ -649,7 +649,7 @@ void spClass::DumpThis(const wxString& indent) const
for ( StrListT::const_iterator i = mSuperClassNames.begin(); for ( StrListT::const_iterator i = mSuperClassNames.begin();
i != mSuperClassNames.end(); i != mSuperClassNames.end();
i++ ) { i++ ) {
if ( !!base ) if ( !base.empty() )
base += ", "; base += ", ";
base += *i; base += *i;
} }
@@ -685,19 +685,19 @@ void spClass::DumpThis(const wxString& indent) const
wxLogDebug("%s%s named '%s' (base classes: %s)", wxLogDebug("%s%s named '%s' (base classes: %s)",
indent.c_str(), kind.c_str(), indent.c_str(), kind.c_str(),
mName.c_str(), base.c_str()); m_Name.c_str(), base.c_str());
} }
void spEnumeration::DumpThis(const wxString& indent) const void spEnumeration::DumpThis(const wxString& indent) const
{ {
wxLogDebug("%senum named '%s'", wxLogDebug("%senum named '%s'",
indent.c_str(), mName.c_str()); indent.c_str(), m_Name.c_str());
} }
void spTypeDef::DumpThis(const wxString& indent) const void spTypeDef::DumpThis(const wxString& indent) const
{ {
wxLogDebug("%stypedef %s = %s", wxLogDebug("%stypedef %s = %s",
indent.c_str(), mName.c_str(), mOriginalType.c_str()); indent.c_str(), m_Name.c_str(), mOriginalType.c_str());
} }
void spFile::DumpThis(const wxString& indent) const void spFile::DumpThis(const wxString& indent) const

View File

@@ -30,7 +30,7 @@
#include "wx/string.h" #include "wx/string.h"
#include "wxstlvec.h" #include "wxstlvec.h"
#ifdef wxUSE_STD_STRING #if wxUSE_STD_STRING
using std::string; using std::string;
#else #else
// FOR NOW:: quick n' dirty: // FOR NOW:: quick n' dirty:
@@ -166,7 +166,7 @@ public:
// spClass on sorting the class members // spClass on sorting the class members
void VisitAll( spContext& atContext, void VisitAll( spContext& atContext,
bool sortContent = TRUE bool sortContent = true
); );
// methods invoked by visitor // methods invoked by visitor
@@ -236,7 +236,7 @@ public:
string mText; string mText;
bool mIsMultiline; // multiline comments ar those with /**/'s bool mIsMultiline; // multiline comments ar those with /**/'s
// TRUE, if these was an empty empty // true, if these was an empty empty
// line above single line comment // line above single line comment
bool mStartsPar; bool mStartsPar;
@@ -311,13 +311,13 @@ public:
// see SRC_VISIBLITY_TYPES enumeration // see SRC_VISIBLITY_TYPES enumeration
int mVisibility; int mVisibility;
// TRUE, if context does not really exist in the source // true, if context does not really exist in the source
// but was created by external tools (e.g. forward engineering) // but was created by external tools (e.g. forward engineering)
bool mIsVirtualContext; bool mIsVirtualContext;
bool mVirtualContextHasChildren; bool mVirtualContextHasChildren;
// body of the context in case (mIsVirtual == TRUE) // body of the context in case (mIsVirtual == true)
string mVirtualContextBody; string mVirtualContextBody;
string mVittualContextFooter; string mVittualContextFooter;
@@ -327,7 +327,7 @@ public:
public: public:
// universal identifier of the context (e.g. class name) // universal identifier of the context (e.g. class name)
string mName; wxString m_Name;
public: public:
// default constructor // default constructor
@@ -360,7 +360,7 @@ public:
bool VitualContextHasChildren(); bool VitualContextHasChildren();
void SetVirtualContextBody( const string& body, void SetVirtualContextBody( const string& body,
bool hasChildren = FALSE, bool hasChildren = false,
const string& footer = wxEmptyString ); const string& footer = wxEmptyString );
string GetVirtualContextBody(); string GetVirtualContextBody();
@@ -373,7 +373,7 @@ public:
virtual string GetHeader( spContext* pCtx = NULL ); virtual string GetHeader( spContext* pCtx = NULL );
// TRUE, if there is at least one entry // true, if there is at least one entry
// in the comment list of this context // in the comment list of this context
bool HasComments(); bool HasComments();
MCommentListT& GetCommentList() { return mComments; } MCommentListT& GetCommentList() { return mComments; }
@@ -384,7 +384,7 @@ public:
virtual void SortMembers() {} virtual void SortMembers() {}
// returns identifier of this context // returns identifier of this context
inline string& GetName() { return mName; } inline wxString& GetName() { return m_Name; }
// returns -1, if souce line # is unknow // returns -1, if souce line # is unknow
inline int GetSourceLineNo() { return mSrcLineNo; } inline int GetSourceLineNo() { return mSrcLineNo; }
@@ -413,11 +413,11 @@ public:
// returns NULL, if the context with the given // returns NULL, if the context with the given
// name and type is not contained by this context // name and type is not contained by this context
// and it's children. Children's children are not // and it's children. Children's children are not
// searched recursivelly if searchSubMembers is FALSE // searched recursivelly if searchSubMembers is false
spContext* FindContext( const string& identifier, spContext* FindContext( const string& identifier,
int contextType = SP_CTX_ANY, int contextType = SP_CTX_ANY,
bool searchSubMembers = TRUE bool searchSubMembers = true
); );
// removes this context from it's parent // removes this context from it's parent
@@ -426,19 +426,19 @@ public:
// will result assertion failure) // will result assertion failure)
void RemoveThisContext(); void RemoveThisContext();
// returns TRUE, if this object is aggregated in the file // returns true, if this object is aggregated in the file
bool IsInFile(); bool IsInFile();
// TRUE, if outter context is a namespace // true, if outter context is a namespace
bool IsInNameSpace(); bool IsInNameSpace();
// TRUE, if outter context is a class // true, if outter context is a class
bool IsInClass(); bool IsInClass();
// TRUE, if outter cotext is an operation (TRUE for "spParameter"s) // true, if outter cotext is an operation (true for "spParameter"s)
bool IsInOperation(); bool IsInOperation();
// TRUE if the context is public // true if the context is public
bool IsPublic() const { return mVisibility == SP_VIS_PUBLIC; } bool IsPublic() const { return mVisibility == SP_VIS_PUBLIC; }
// NOTE:: method returns not the type of this object // NOTE:: method returns not the type of this object
@@ -547,14 +547,14 @@ public:
// argument list // argument list
//MParamListT mParams; //MParamListT mParams;
// TRUE, if operation does not modify // true, if operation does not modify
// the content of the object // the content of the object
bool mIsConstant; bool mIsConstant;
// flag, specific to C++ // flag, specific to C++
bool mIsVirtual; bool mIsVirtual;
// TRUE, if definition follows the declaration immediatelly // true, if definition follows the declaration immediatelly
bool mHasDefinition; bool mHasDefinition;
// scope if any (e.g. MyClass::MyFunction(), scope stirng is "MyClass" ) // scope if any (e.g. MyClass::MyFunction(), scope stirng is "MyClass" )
@@ -634,7 +634,7 @@ public:
// valid if mClassSubType is SP_CLTYPE_TEMPLATE_CLASS // valid if mClassSubType is SP_CLTYPE_TEMPLATE_CLASS
string mTemplateTypes; string mTemplateTypes;
// TRUE, if it's and interface of abstract base class // true, if it's and interface of abstract base class
bool mIsAbstract; bool mIsAbstract;
public: public: