More warning and error fixes (work in progress with Tinderbox).

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34519 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Włodzimierz Skiba
2005-06-02 09:44:45 +00:00
parent 7b1c346952
commit 2af95167f5
12 changed files with 291 additions and 312 deletions

View File

@@ -644,9 +644,9 @@ static inline void skip_next_token_back( char*& cur )
++cur; // position after the trailing charcter of the prev token
}
static string get_token_str( char* cur )
static wxString get_token_str( char* cur )
{
return string( cur, get_token_len( cur ) );
return wxString( cur, get_token_len( cur ) );
}
// skips token or whole expression which may have
@@ -1327,7 +1327,7 @@ void CJSourceParser::AddMacroNode( wxChar*& cur )
skip_token( cur );
get_next_token( cur );
string condition = get_token_str( cur );
wxString condition = get_token_str( cur );
// currently, everything except '0' is true
if ( condition == _T("0") ) {
@@ -1595,7 +1595,7 @@ bool CJSourceParser::ParseNameAndRetVal( char*& cur, bool& isAMacro )
skip_next_token_back( cur );
skip_token_back( cur );
string lastToken = get_token_str( cur );
wxString lastToken = get_token_str( cur );
if ( lastToken == "operator" ) {
lastToken += pOp->m_Name;
pOp->m_Name = lastToken;
@@ -1608,7 +1608,7 @@ bool CJSourceParser::ParseNameAndRetVal( char*& cur, bool& isAMacro )
else if ( pOp->m_Name == "operator" ) {
skip_token( cur );
get_next_token( cur );
string oper = get_token_str( cur );
wxString oper = get_token_str( cur );
pOp->m_Name += oper;
}
@@ -1618,11 +1618,11 @@ bool CJSourceParser::ParseNameAndRetVal( char*& cur, bool& isAMacro )
if ( cur >= start )
{
string rettype = string( start, size_t( cur-start ) );
wxString rettype = wxString( start, size_t( cur-start ) );
// FIXME just for now...
string::size_type pos = 0;
string toerase("WXDLLEXPORT ");
while((pos = rettype.find(toerase, pos)) != string::npos)
wxString::size_type pos = 0;
wxString toerase("WXDLLEXPORT ");
while((pos = rettype.find(toerase, pos)) != wxString::npos)
rettype.erase(pos, toerase.length());
pOp->m_RetType = rettype;
}
@@ -1744,14 +1744,14 @@ bool CJSourceParser::ParseArguments( char*& cur )
AttachComments( *pPar, blocks[nameBlock] );
// retrieve argument name
pPar->m_Name = string( blocks[nameBlock], blockSizes[nameBlock] );
pPar->m_Name = wxString( blocks[nameBlock], blockSizes[nameBlock] );
// retreive argument type
size_t len = blockSizes[ typeBlock ];
len = size_t ( (blocks[ typeBlock ] + len) - blocks[ 0 ] );
pPar->m_Type = string( blocks[0], len );
pPar->m_Type = wxString( blocks[0], len );
arrange_indirection_tokens_between( pPar->m_Type, pPar->m_Name );
@@ -1834,7 +1834,7 @@ void CJSourceParser::ParseMemberVar( char*& cur )
bool firstMember = true;
string type;
wxString type;
// jump to the end of statement
// and start collecting same-type varibles
@@ -2026,7 +2026,7 @@ void CJSourceParser::AddClassNode( char*& cur )
{
char* ctxStart = cur;
string classkeyword = get_token_str( cur );
wxString classkeyword = get_token_str( cur );
skip_token( cur ); // skip 'class' keyword
if ( !get_next_token( cur ) ) return;
@@ -2156,7 +2156,7 @@ void CJSourceParser::AddClassNode( char*& cur )
if ( *tok != ':' && *cur != ':' )
pClass->m_SuperClassNames.push_back( string( cur, len ) );
pClass->m_SuperClassNames.push_back( wxString( cur, len ) );
} while(1);

View File

@@ -75,7 +75,7 @@ protected:
void AddEnumNode( char*& cur );
void AddTypeDefNode( char*& cur );
void DumpOperationInfo( spOperation& info, const string& tab, wxSTD ostream& os );
void DumpOperationInfo( spOperation& info, const wxString& tab, wxSTD ostream& os );
void DumpClassHeader( spClass& info, wxSTD ostream& os );
void DumpClassBody( spClass& info, wxSTD ostream& os );
@@ -114,17 +114,17 @@ static inline void skip_tempalate_statement( char*& cur );
static inline void skip_statement( char*& cur );
static inline void skip_token_back( char*& cur );
static inline void skip_next_token_back( char*& cur );
static string get_token_str( char* cur );
static wxString get_token_str( char* cur );
static size_t skip_block( char*& cur );
static inline bool skip_imp_block( char*& cur );
static bool is_class_token( char*& cur );
inline static bool is_forward_decl( char* cur );
inline static bool is_function( char* cur, bool& isAMacro );
static inline void skip_scope_block( char*& cur );
static void arrange_indirection_tokens_between( string& type, string& identifier );
static void arrange_indirection_tokens_between( wxString& type, wxString& identifier );
static bool is_keyword( char* cur );
static inline void get_string_between( char* start, char* end, string* pStr );
static char* set_comment_text( string& text, char* start );
static inline void get_string_between( char* start, char* end, wxString* pStr );
static char* set_comment_text( wxString& text, char* start );
*/
#endif

View File

@@ -149,7 +149,7 @@ RipperDocGen::RipperDocGen()
mpFileBinderCtx = new spFile();
// the default script is HTML
mTags = get_HTML_markup_tags();
m_Tags = get_HTML_markup_tags();
mpParser = 0; // no default parser!
}
@@ -170,8 +170,8 @@ void RipperDocGen::AppendComments( spContext& fromContext, wxString& str )
size_t start = str.length();
str += mTags[TAG_BOLD].end;
str += mTags[TAG_PARAGRAPH].start;
str += m_Tags[TAG_BOLD].end;
str += m_Tags[TAG_PARAGRAPH].start;
MCommentListT& lst = fromContext.GetCommentList();
@@ -182,7 +182,7 @@ void RipperDocGen::AppendComments( spContext& fromContext, wxString& str )
if ( lst[i]->StartsParagraph() )
{
str += mTags[TAG_PARAGRAPH].start;
str += m_Tags[TAG_PARAGRAPH].start;
}
str += lst[i]->m_Text;
@@ -212,14 +212,14 @@ void RipperDocGen::AppendComments( spContext& fromContext, wxString& str )
}
str[n] = _T(' ');
}
str += mTags[TAG_PARAGRAPH].end;
str += m_Tags[TAG_PARAGRAPH].end;
}
void RipperDocGen::AppendMulitilineStr( wxString& st, wxString& mlStr )
{
st = mTags[TAG_FIXED_FONT].start;
st = m_Tags[TAG_FIXED_FONT].start;
st += mlStr;
st += mTags[TAG_FIXED_FONT].end;
st += m_Tags[TAG_FIXED_FONT].end;
}
void RipperDocGen::AppendHighlightedSource( wxString& st, wxString source )
@@ -235,7 +235,7 @@ void RipperDocGen::AppendHighlightedSource( wxString& st, wxString source )
// highlight things
mSrcPainter.Init();
mSrcPainter.ProcessSource( buf, strlen(buf) );
mSrcPainter.GetResultString( st, mTags );
mSrcPainter.GetResultString( st, m_Tags );
}
bool RipperDocGen::CheckIfUncommented( spContext& ctx, ScriptSection& toSect )
@@ -269,7 +269,7 @@ wxString RipperDocGen::GetScopedName( spContext& ofCtx )
void RipperDocGen::AddToCurrentClass( ScriptSection* pSection, spContext& ctx,
const char* subSectionName )
{
string sName;
wxString sName;
if ( ctx.mVisibility == SP_VIS_PROTECTED )
sName = "Protected members/";
@@ -372,11 +372,11 @@ void RipperDocGen::VisitEnumeration( spEnumeration& en )
return;
wxString body;
body += mTags[TAG_BOLD].start;
body += m_Tags[TAG_BOLD].start;
AppendMulitilineStr( body, en.m_EnumContent );
body += mTags[TAG_BOLD].end;
body += m_Tags[TAG_BOLD].end;
wxString line;
AppendHighlightedSource( line, body );
@@ -395,17 +395,17 @@ void RipperDocGen::VisitTypeDef( spTypeDef& td )
return;
wxString body;
body += mTags[TAG_BOLD].start;
body += m_Tags[TAG_BOLD].start;
body += "typdef ";
body += mTags[TAG_BOLD].end;
body += m_Tags[TAG_BOLD].end;
AppendMulitilineStr( body, td.m_OriginalType );
body += td.m_OriginalType;
body += ' ';
body += mTags[TAG_BOLD].start;
body += m_Tags[TAG_BOLD].start;
body += td.GetName();
body += mTags[TAG_BOLD].end;
body += m_Tags[TAG_BOLD].end;
wxString line;
AppendHighlightedSource( line, body );
@@ -427,14 +427,14 @@ void RipperDocGen::VisitPreprocessorLine( spPreprocessorLine& pd )
return;
wxString body;
body += mTags[TAG_FIXED_FONT].start;
body += m_Tags[TAG_FIXED_FONT].start;
wxString coloredLine = pd.m_Line;
AppendHighlightedSource( coloredLine, pd.m_Line );
AppendMulitilineStr( body, coloredLine );
body += mTags[TAG_FIXED_FONT].end;
body += m_Tags[TAG_FIXED_FONT].end;
AppendComments( pd, body );
@@ -492,14 +492,14 @@ void RipperDocGen::VisitClass( spClass& cl )
void RipperDocGen::VisitAttribute( spAttribute& attr )
{
wxString body;
body += mTags[TAG_BOLD].start;
body += m_Tags[TAG_BOLD].start;
body += attr.m_Type;
body += mTags[TAG_BOLD].end;
body += m_Tags[TAG_BOLD].end;
body += mTags[TAG_ITALIC].start;
body += m_Tags[TAG_ITALIC].start;
body += ' ';
body += attr.GetName();
body += mTags[TAG_ITALIC].end;
body += m_Tags[TAG_ITALIC].end;
wxString line;
AppendHighlightedSource( line, body );
@@ -527,7 +527,7 @@ void RipperDocGen::VisitOperation( spOperation& op )
{
wxString body;
AppendHighlightedSource( body, op.GetFullName(mTags) );
AppendHighlightedSource( body, op.GetFullName(m_Tags) );
AppendComments( op, body );

View File

@@ -80,7 +80,7 @@ protected:
spContext* mpFileBinderCtx;
// script tags set up from usesr code
MarkupTagsT mTags;
MarkupTagsT m_Tags;
protected:
// helpers

View File

@@ -48,14 +48,14 @@ static size_t log2(size_t nr)
/***** Implementation for class ScriptStream *****/
ScriptStream::ScriptStream()
: mpBuf(0),
mSize(0),
mCapacity(0)
: m_pBuf(0),
m_Size(0),
m_Capacity(0)
{}
ScriptStream::~ScriptStream()
{
if ( mpBuf ) delete mpBuf;
if ( m_pBuf ) delete m_pBuf;
}
void ScriptStream::WriteBytes( const void* srcBuf, size_t count )
@@ -63,28 +63,28 @@ void ScriptStream::WriteBytes( const void* srcBuf, size_t count )
if ( !count ) return;
// increase the capacity if necessary
if ( mSize + count > mCapacity )
if ( m_Size + count > m_Capacity )
{
mCapacity =
( 0x2 << (log2( mSize + count ) + 1 ) );
m_Capacity =
( 0x2 << (log2( m_Size + count ) + 1 ) );
if ( mCapacity < 128 ) mCapacity = 128;
if ( m_Capacity < 128 ) m_Capacity = 128;
char* oldBuf = mpBuf;
char* oldBuf = m_pBuf;
mpBuf = new char[mCapacity];
m_pBuf = new char[m_Capacity];
if ( oldBuf )
{
memcpy( mpBuf, oldBuf, mSize );
memcpy( m_pBuf, oldBuf, m_Size );
delete oldBuf;
}
}
// append new data
memcpy( &mpBuf[mSize], srcBuf, count );
memcpy( &m_pBuf[m_Size], srcBuf, count );
mSize += count;
m_Size += count;
}
ScriptStream& ScriptStream::operator<<( const char* str )
@@ -94,7 +94,7 @@ ScriptStream& ScriptStream::operator<<( const char* str )
return *this;
}
ScriptStream& ScriptStream::operator<<( const string& str )
ScriptStream& ScriptStream::operator<<( const wxString& str )
{
if ( str.length() < 512 )
{
@@ -127,29 +127,29 @@ void ScriptStream::endl()
/***** Implementation for class ScriptTemplate *****/
ScriptTemplate::ScriptTemplate( const string& templateText )
ScriptTemplate::ScriptTemplate( const wxString& templateText )
{
string tmp = templateText;
wxString tmp = templateText;
mTText = (char*)malloc( tmp.length() + 1 );
m_TText = (char*)malloc( tmp.length() + 1 );
strcpy( mTText, tmp.c_str() );
strcpy( m_TText, tmp.c_str() );
}
ScriptTemplate::~ScriptTemplate()
{
for( size_t i = 0; i != mVars.size(); ++i )
for( size_t i = 0; i != m_Vars.size(); ++i )
delete mVars[i];
delete m_Vars[i];
free( mTText );
free( m_TText );
}
bool ScriptTemplate::HasVar( const char* name )
{
for( size_t i = 0; i != mVars.size(); ++i )
for( size_t i = 0; i != m_Vars.size(); ++i )
if ( strcmp( mVars[i]->m_Name, name ) == 0 )
if ( strcmp( m_Vars[i]->m_Name, name ) == 0 )
return 1;
@@ -158,17 +158,17 @@ bool ScriptTemplate::HasVar( const char* name )
void ScriptTemplate::AddStringVar ( const char* name, int ofs )
{
mVars.push_back( new TVarInfo( name, ofs, TVAR_STRING ) );
m_Vars.push_back( new TVarInfo( name, ofs, TVAR_STRING ) );
}
void ScriptTemplate::AddIntegerVar( const char* name, int ofs )
{
mVars.push_back( new TVarInfo( name, ofs, TVAR_INTEGER ) );
m_Vars.push_back( new TVarInfo( name, ofs, TVAR_INTEGER ) );
}
void ScriptTemplate::AddDoubleVar ( const char* name, int ofs )
{
mVars.push_back( new TVarInfo( name, ofs, TVAR_DOUBLE ) );
m_Vars.push_back( new TVarInfo( name, ofs, TVAR_DOUBLE ) );
}
void ScriptTemplate::AddObjectRefArray( const char* name,
@@ -179,11 +179,11 @@ void ScriptTemplate::AddObjectRefArray( const char* name,
{
TArrayInfo* pInfo = new TArrayInfo( name );
mVars.push_back( pInfo );
m_Vars.push_back( pInfo );
pInfo->mRefOfs = ofsRefToFirstObj;
pInfo->mSizeIntOfs = ofsObjSizeInt;
pInfo->mObjRefTemplOfs = ofsObjRefTempl;
pInfo->m_RefOfs = ofsRefToFirstObj;
pInfo->m_SizeIntOfs = ofsObjSizeInt;
pInfo->m_ObjRefTemplOfs = ofsObjRefTempl;
}
inline void ScriptTemplate::PrintVar( TVarInfo* pInfo,
@@ -196,7 +196,7 @@ inline void ScriptTemplate::PrintVar( TVarInfo* pInfo,
{
case TVAR_INTEGER :
{
sprintf(buf, "%d",*( (int*) ((char*)dataObj + pInfo->mOfs) ) );
sprintf(buf, "%d",*( (int*) ((char*)dataObj + pInfo->m_Ofs) ) );
stm.WriteBytes( buf, strlen(buf ) );
break;
@@ -204,15 +204,15 @@ inline void ScriptTemplate::PrintVar( TVarInfo* pInfo,
case TVAR_STRING :
{
string& str = *( (string*) ((char*)dataObj+pInfo->mOfs) );
wxString& str = *( (wxString*) ((char*)dataObj+pInfo->m_Ofs) );
const char* cs = str.c_str();
#ifdef DEBUG_WEIRED_OFFSETS
cout << "DBG:: cs address is " << (int)cs << endl;
cout << "DBG:: str address is " << (int)(&str) << endl;
cout << "DBG:: dataObj points to " << (int)dataObj << 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:: pInfo->m_Ofs value is " << (int)pInfo->m_Ofs << endl;
cout << "DBG:: d+pInfo->m_Ofs is " << (int)((char*)dataObj + pInfo->m_Ofs) << endl;
cout << "DBG:: pInfo->m_Name is " << pInfo->m_Name << endl;
cout << "DBG:: pInfo->m_Type is " << pInfo->m_Type << endl;
cout << "DBG:: end of dump. " << endl;
@@ -226,7 +226,7 @@ inline void ScriptTemplate::PrintVar( TVarInfo* pInfo,
case TVAR_DOUBLE :
{
sprintf( buf, "%f",
*( (double*)( (char*)dataObj+pInfo->mOfs) ) );
*( (double*)( (char*)dataObj+pInfo->m_Ofs) ) );
stm.WriteBytes( buf, strlen(buf ) );
break;
@@ -236,7 +236,7 @@ inline void ScriptTemplate::PrintVar( TVarInfo* pInfo,
{
TArrayInfo& info = *((TArrayInfo*)pInfo);
int sz = *((int*) ( (char*)dataObj+info.mSizeIntOfs ));
int sz = *((int*) ( (char*)dataObj+info.m_SizeIntOfs ));
if ( !sz )
{
// DBG::
@@ -245,14 +245,14 @@ inline void ScriptTemplate::PrintVar( TVarInfo* pInfo,
break;
}
int* array = *((int**)( (char*)dataObj+info.mRefOfs ));
int* array = *((int**)( (char*)dataObj+info.m_RefOfs ));
ScriptTemplate* pRefTempl;
for( int i = 0; i != sz; ++i )
{
pRefTempl =
*((ScriptTemplate**)((char*)(array[i])+info.mObjRefTemplOfs));
*((ScriptTemplate**)((char*)(array[i])+info.m_ObjRefTemplOfs));
pRefTempl->PrintScript( (void*)array[i], stm );
}
@@ -266,7 +266,7 @@ inline void ScriptTemplate::PrintVar( TVarInfo* pInfo,
void ScriptTemplate::PrintScript( void* dataObj, ScriptStream& stm )
{
char* cur = mTText;
char* cur = m_TText;
// template parsing loop
do
@@ -292,14 +292,14 @@ void ScriptTemplate::PrintScript( void* dataObj, ScriptStream& stm )
// look up variable
size_t sz = mVars.size();
size_t sz = m_Vars.size();
// bool found = false;
for( size_t i = 0; i != sz; ++i )
{
if ( strcmp( mVars[i]->m_Name, start ) == 0 )
if ( strcmp( m_Vars[i]->m_Name, start ) == 0 )
{
PrintVar( mVars[i], dataObj, stm );
PrintVar( m_Vars[i], dataObj, stm );
*cur = ')'; // remove terminating zero
++cur;
@@ -317,7 +317,7 @@ void ScriptTemplate::PrintScript( void* dataObj, ScriptStream& stm )
/***** implementation for class ScriptSection *****/
int ScriptSection::mIdCounter = 0;
int ScriptSection::m_IdCounter = 0;
ScriptSection::ScriptSection( const wxString& name,
const wxString& body,
@@ -326,54 +326,54 @@ ScriptSection::ScriptSection( const wxString& name,
bool autoHide,
bool sorted
)
: mpParent ( NULL ),
: m_pParent ( NULL ),
m_Name ( name ),
mBody ( body ),
m_Body ( body ),
mAutoHide( autoHide ),
mSortOn ( sorted ),
m_AutoHide ( autoHide ),
m_SortOn ( sorted ),
mpSectTempl( pSectionTemplate ),
mpRefTempl ( pReferenceTemplate ),
m_pSectTempl( pSectionTemplate ),
m_pRefTempl ( pReferenceTemplate ),
mRefCount( 0 ),
mArrSize( 0 )
m_RefCount( 0 ),
m_ArrSize( 0 )
{
// generate GUID
wxChar buf[32];
wxSprintf( buf, _T("%d"), ++mIdCounter );
mId = buf;
wxSprintf( buf, _T("%d"), ++m_IdCounter );
m_Id = buf;
}
ScriptSection::~ScriptSection()
{
SectListT lst = mSubsections;
SectListT lst = m_Subsections;
while( mSubsections.size() )
while( m_Subsections.size() )
mSubsections[0]->RemoveRef();
m_Subsections[0]->RemoveRef();
for( size_t i = 0; i != mReferences.size(); ++i )
for( size_t i = 0; i != m_References.size(); ++i )
mReferences[i]->RemoveRef();
m_References[i]->RemoveRef();
}
void ScriptSection::AddRef()
{
++mRefCount;
++m_RefCount;
}
void ScriptSection::RemoveRef()
{
if ( !mRefCount || !(--mRefCount) )
if ( !m_RefCount || !(--m_RefCount) )
{
if (mpParent)
if (m_pParent)
{
// remove ourselves from parent's list
SectListT& lst = mpParent->mSubsections;
SectListT& lst = m_pParent->m_Subsections;
for( size_t i = 0; i != lst.size(); ++i )
if ( lst[i] == this )
@@ -404,21 +404,21 @@ ScriptSection* ScriptSection::GetSubsection( const char* name )
buf[cur] = '\0';
size_t sz = mSubsections.size();
size_t sz = m_Subsections.size();
for( size_t i = 0; i != sz; ++i )
{
// DBG::
//ScriptSection& sect = *mSubsections[i];
//ScriptSection& sect = *m_Subsections[i];
if ( mSubsections[i]->m_Name == buf )
if ( m_Subsections[i]->m_Name == buf )
{
if ( name[cur] == '/' )
// search recursivelly
return mSubsections[i]->GetSubsection( &name[cur+1] );
return m_Subsections[i]->GetSubsection( &name[cur+1] );
else
return mSubsections[i];
return m_Subsections[i];
}
}
@@ -429,14 +429,14 @@ void ScriptSection::AddSection( ScriptSection* pSection,
bool addToReferencesToo
)
{
mSubsections.push_back( pSection );
m_Subsections.push_back( pSection );
pSection->AddRef();
// can add section to multiple containers
// ASSERT( pSection->mpParent == 0 );
// ASSERT( pSection->m_pParent == 0 );
pSection->mpParent = this;
pSection->m_pParent = this;
if ( addToReferencesToo )
@@ -445,19 +445,19 @@ void ScriptSection::AddSection( ScriptSection* pSection,
void ScriptSection::AddReference( ScriptSection* pReferredSection )
{
mReferences.push_back( pReferredSection );
m_References.push_back( pReferredSection );
pReferredSection->AddRef();
// set up mandatory fields used by ScriptTemplate
mArrSize = mReferences.size();
if ( mArrSize )
mRefFirst = (void*)&mReferences[0];
m_ArrSize = m_References.size();
if ( m_ArrSize )
m_RefFirst = (void*)&m_References[0];
}
SectListT& ScriptSection::GetSubsections()
{
return mSubsections;
return m_Subsections;
}
// static method:
@@ -469,12 +469,12 @@ void ScriptSection::RegisterTemplate( ScriptTemplate& sectionTempalte )
// obtaining offsets of member vars
GET_VAR_OFS( ScriptSection, m_Name, &nameOfs )
GET_VAR_OFS( ScriptSection, mBody, &bodyOfs )
GET_VAR_OFS( ScriptSection, mId, &idOfs )
GET_VAR_OFS( ScriptSection, mRefFirst, &arrRefOfs )
GET_VAR_OFS( ScriptSection, mArrSize, &arrSizeOfs )
GET_VAR_OFS( ScriptSection, m_Body, &bodyOfs )
GET_VAR_OFS( ScriptSection, m_Id, &idOfs )
GET_VAR_OFS( ScriptSection, m_RefFirst,&arrRefOfs )
GET_VAR_OFS( ScriptSection, m_ArrSize, &arrSizeOfs )
GET_VAR_OFS( ScriptSection, mpRefTempl, &refTemplOfs )
GET_VAR_OFS( ScriptSection, m_pRefTempl, &refTemplOfs )
// registering member variables with given script template
@@ -491,28 +491,28 @@ void ScriptSection::Print( ScriptStream& stm )
// TBD:: sorting
// print out this content first
if ( mpSectTempl )
if ( m_pSectTempl )
mpSectTempl->PrintScript( this, stm );
m_pSectTempl->PrintScript( this, stm );
// attach contents subsections at the end of this content
for( size_t i = 0; i != mSubsections.size(); ++i )
for( size_t i = 0; i != m_Subsections.size(); ++i )
mSubsections[i]->Print( stm );
m_Subsections[i]->Print( stm );
}
void ScriptSection::DoRemoveEmptySections(int& nRemoved, SectListT& removedLst)
{
for( size_t i = 0; i != mSubsections.size(); ++i )
for( size_t i = 0; i != m_Subsections.size(); ++i )
{
ScriptSection& sect = *mSubsections[i];
ScriptSection& sect = *m_Subsections[i];
sect.DoRemoveEmptySections( nRemoved, removedLst );
if (sect.mAutoHide )
if (sect.m_AutoHide )
if ( sect.mReferences.size() == 0 )
if ( sect.m_References.size() == 0 )
{
bool found = false;
for( size_t k = 0; k != removedLst.size(); ++k )
@@ -539,24 +539,24 @@ void ScriptSection::DoRemoveDeadLinks( SectListT& removedLst)
{
size_t dsz = removedLst.size();
for( size_t i = 0; i != mSubsections.size(); ++i )
for( size_t i = 0; i != m_Subsections.size(); ++i )
{
mSubsections[i]->DoRemoveDeadLinks( removedLst );
m_Subsections[i]->DoRemoveDeadLinks( removedLst );
}
for( size_t n = 0; n != mReferences.size(); ++n )
for( size_t n = 0; n != m_References.size(); ++n )
{
for( size_t k = 0; k != dsz; ++k )
if ( removedLst[k] == mReferences[n] )
if ( removedLst[k] == m_References[n] )
{
mReferences.erase( &mReferences[n] );
m_References.erase( &m_References[n] );
--n;
// set up mandatory fields used by ScriptTemplate
mArrSize = mReferences.size();
if ( mArrSize )
mRefFirst = (void*)&mReferences[0];
m_ArrSize = m_References.size();
if ( m_ArrSize )
m_RefFirst = (void*)&m_References[0];
break;
}

View File

@@ -28,13 +28,6 @@
#include "wxstlvec.h"
#include "wx/string.h"
#if wxUSE_STD_STRING
using std::string;
#else
// FIXME:: dirty!
typedef wxString string;
#endif
#endif
#ifndef ASSERT
@@ -49,9 +42,9 @@
class ScriptStream
{
protected:
char* mpBuf;
size_t mSize;
size_t mCapacity;
char* m_pBuf;
size_t m_Size;
size_t m_Capacity;
public:
ScriptStream();
~ScriptStream();
@@ -59,16 +52,16 @@ public:
void WriteBytes( const void* srcBuf, size_t count );
ScriptStream& operator<<( const char* str );
ScriptStream& operator<<( const string& str );
ScriptStream& operator<<( const wxString& str );
ScriptStream& operator<<( char ch );
void endl();
inline char* GetBuf() { return mpBuf; }
inline size_t GetBufSize() { return mSize; }
inline char* GetBuf() { return m_pBuf; }
inline size_t GetBufSize() { return m_Size; }
// clears current contents of the stream
void Reset() { mSize = 0; }
void Reset() { m_Size = 0; }
};
@@ -91,21 +84,21 @@ struct TVarInfo
public:
const char* m_Name;
int m_Type;
int mOfs;
int m_Ofs;
TVarInfo( const char* name, int ofs, int varType )
: m_Name(name),
m_Type( varType ),
mOfs( ofs )
m_Ofs( ofs )
{}
};
struct TArrayInfo : public TVarInfo
{
public:
int mRefOfs;
int mSizeIntOfs;
int mObjRefTemplOfs;
int m_RefOfs;
int m_SizeIntOfs;
int m_ObjRefTemplOfs;
TArrayInfo( const char* name )
: TVarInfo( name, 0, TVAR_REF_ARRAY )
@@ -163,18 +156,18 @@ class ScriptSection;
class ScriptTemplate
{
protected:
// do not use string object here - parsing of
// do not use wxString object here - parsing of
// C string can be much faster (in debug v.)
char* mTText;
char* m_TText;
TVarListT mVars;
TVarListT m_Vars;
inline void PrintVar( TVarInfo* pInfo,
void* dataObj,
ScriptStream& stm );
public:
ScriptTemplate( const string& templateText );
ScriptTemplate( const wxString& templateText );
virtual ~ScriptTemplate();
bool HasVar( const char* name );
@@ -215,34 +208,34 @@ protected:
// the below there members are registered to ScriptTemplate,
// GUID within the section tree (numeric)
ScriptSection* mpParent;
string mId; // $(ID)
string m_Name;// $(NAME)
string mBody; // $(BODY)
ScriptSection* m_pParent;
wxString m_Id; // $(ID)
wxString m_Name;// $(NAME)
wxString m_Body; // $(BODY)
// NULL, if this section is not aggregated anywhere
SectListT mSubsections; // aggregated sectons
SectListT mReferences; // registered as $(REFLIST)
SectListT m_Subsections; // aggregated sectons
SectListT m_References; // registered as $(REFLIST)
bool mAutoHide; // see autoHide arg, in constructor
bool mSortOn; // true, if sort subsectons by naem
bool m_AutoHide; // see autoHide arg, in constructor
bool m_SortOn; // true, if sort subsectons by naem
// tempalte for this section
ScriptTemplate* mpSectTempl;
ScriptTemplate* m_pSectTempl;
// template used for links (or references) to this section
ScriptTemplate* mpRefTempl;
ScriptTemplate* m_pRefTempl;
// do not call destructor of this object,
// call RemoveRef() instead
int mRefCount;
int m_RefCount;
static int mIdCounter; // generator of GUIDs
static int m_IdCounter; // generator of GUIDs
// fields registered and used by ScriptTemplate object
void* mRefFirst;
int mArrSize;
void* m_RefFirst;
int m_ArrSize;
protected:
virtual void AddRef();
@@ -320,7 +313,7 @@ public:
class DocGeneratorBase
{
protected:
MarkupTagsT mTags;
MarkupTagsT m_Tags;
// override this method to do some post processing
// after generation of document, or even write some
@@ -343,14 +336,14 @@ protected:
public:
DocGeneratorBase()
: mTags(0) // no defaul script
: m_Tags(0) // no defaul script
{}
// dectrouctors of polymorphic classes SHOULD be virtual
virtual ~DocGeneratorBase() {}
// returns tags, being used for specific target script
MarkupTagsT GetScriptMarkupTags() { return mTags; }
MarkupTagsT GetScriptMarkupTags() { return m_Tags; }
// sets tag array for specific script
@@ -361,7 +354,7 @@ public:
// to generator's tamplates, to match the specific script
virtual void SetScriptMarkupTags( MarkupTagsT tags )
{ mTags = tags; }
{ m_Tags = tags; }
// seves document to file starting from the root-node of
// the document (provided by GetTopSection() method),

View File

@@ -606,7 +606,7 @@ void SourcePainter::ProcessSource( char* src, int srcLen )
if ( mCollectResultsOn )
mResultStr += string( src, srcLen );
mResultStr += wxString( src, srcLen );
}
void SourcePainter::SetState( bool isInComment,

View File

@@ -32,13 +32,6 @@
#include "wxstlvec.h"
#include "wx/string.h"
#if wxUSE_STD_STRING
using std::string;
#else
// FIXME:: dirty!
#define string wxString
#endif
typedef WXSTL_VECTOR_SHALLOW_COPY(int) SPBlockListT;
#endif
@@ -63,7 +56,7 @@
class SourcePainter
{
protected:
string mResultStr;
wxString mResultStr;
SPBlockListT mBlocks;
bool mCollectResultsOn;

View File

@@ -123,7 +123,7 @@ wxString spComment::GetText() const
spContext::spContext()
: mpParent ( NULL ),
: m_pParent ( NULL ),
mpFirstOccurence( NULL ),
mAlreadySorted ( false ),
@@ -231,14 +231,14 @@ bool spContext::VitualContextHasChildren()
return mVirtualContextHasChildren;
}
string spContext::GetVirtualContextBody()
wxString spContext::GetVirtualContextBody()
{
wxASSERT( mIsVirtualContext );
return mVirtualContextBody;
}
string spContext::GetFooterOfVirtualContextBody()
wxString spContext::GetFooterOfVirtualContextBody()
{
wxASSERT( mIsVirtualContext );
@@ -246,9 +246,9 @@ string spContext::GetFooterOfVirtualContextBody()
}
void spContext::SetVirtualContextBody( const string& body,
void spContext::SetVirtualContextBody( const wxString& body,
bool hasChildren,
const string& footer )
const wxString& footer )
{
mVirtualContextHasChildren = hasChildren;
@@ -297,7 +297,7 @@ void spContext::AddMember( spContext* pMember )
{
mMembers.push_back( pMember );
pMember->mpParent = this;
pMember->m_pParent = this;
}
void spContext::AddComment( spComment* pComment )
@@ -310,7 +310,7 @@ MMemberListT& spContext::GetMembers()
return mMembers;
}
spContext* spContext::FindContext( const string& identifier,
spContext* spContext::FindContext( const wxString& identifier,
int contextType,
bool searchSubMembers
)
@@ -339,8 +339,8 @@ spContext* spContext::FindContext( const string& identifier,
void spContext::RemoveThisContext()
{
if ( mpParent )
mpParent->RemoveChild( this );
if ( m_pParent )
m_pParent->RemoveChild( this );
else
// context should have a parent
wxFAIL_MSG("Context should have a parent");
@@ -348,12 +348,12 @@ void spContext::RemoveThisContext()
spContext* spContext::GetOutterContext()
{
return mpParent;
return m_pParent;
}
bool spContext::HasOutterContext()
{
return ( mpParent != 0 );
return ( m_pParent != 0 );
}
bool spContext::IsInFile()
@@ -379,25 +379,25 @@ bool spContext::IsInOperation()
spClass& spContext::GetClass()
{
wxASSERT( GetOutterContext()->GetType() == SP_CTX_CLASS );
return *((spClass*)mpParent );
return *((spClass*)m_pParent );
}
spFile& spContext::GetFile()
{
wxASSERT( GetOutterContext()->GetType() == SP_CTX_FILE );
return *((spFile*)mpParent );
return *((spFile*)m_pParent );
}
spNameSpace& spContext::GetNameSpace()
{
wxASSERT( GetOutterContext()->GetType() == SP_CTX_NAMESPACE );
return *((spNameSpace*)mpParent );
return *((spNameSpace*)m_pParent );
}
spOperation& spContext::GetOperation()
{
wxASSERT( GetOutterContext()->GetType() == SP_CTX_OPERATION );
return *((spOperation*)mpParent );
return *((spOperation*)m_pParent );
}
/***** Implementation for class spClass *****/

View File

@@ -30,13 +30,6 @@
#include "wx/string.h"
#include "wxstlvec.h"
#if wxUSE_STD_STRING
using std::string;
#else
// FOR NOW:: quick n' dirty:
#define string wxString
#endif
#endif
#include "markup.h" // markup tags used in spOperator::GetFullName()
@@ -132,7 +125,7 @@ class spComment;
typedef vector<spComment*> MCommentListT;
// list of parameters
typedef vector<spParameter*> MParamListT;
// string list
// wxString list
typedef vector<wxString> StrListT;
#else
@@ -266,7 +259,7 @@ protected:
MMemberListT mMembers;
// NULL, if this is top-most context
spContext* mpParent;
spContext* m_pParent;
// points to context object, where the this context
// was originally declared, meaning that this object
@@ -318,8 +311,8 @@ public:
bool mVirtualContextHasChildren;
// body of the context in case (mIsVirtual == true)
string mVirtualContextBody;
string mVittualContextFooter;
wxString mVirtualContextBody;
wxString mVittualContextFooter;
// e.g. can be used by documentation generator to store
// reference to section object
@@ -359,12 +352,12 @@ public:
bool VitualContextHasChildren();
void SetVirtualContextBody( const string& body,
void SetVirtualContextBody( const wxString& body,
bool hasChildren = false,
const string& footer = wxEmptyString );
const wxString& footer = wxEmptyString );
string GetVirtualContextBody();
string GetFooterOfVirtualContextBody();
wxString GetVirtualContextBody();
wxString GetFooterOfVirtualContextBody();
// can be overriden by top-level context classes
// to find-out ot the source-fragment of this
@@ -398,7 +391,7 @@ public:
spContext* GetOutterContext();
// perhaps more intuitive alias for `GetOutterContext()'
inline spContext* GetParent() { return mpParent; }
inline spContext* GetParent() { return m_pParent; }
bool HasOutterContext();
@@ -415,7 +408,7 @@ public:
// and it's children. Children's children are not
// searched recursivelly if searchSubMembers is false
spContext* FindContext( const string& identifier,
spContext* FindContext( const wxString& identifier,
int contextType = SP_CTX_ANY,
bool searchSubMembers = true
);
@@ -560,7 +553,7 @@ public:
// scope if any (e.g. MyClass::MyFunction(), scope stirng is "MyClass" )
// usually found along with implementation of the method, which is now skipped
string mScope;
wxString mScope;
public:
spOperation();
@@ -632,7 +625,7 @@ public:
int mInheritanceType;
// valid if mClassSubType is SP_CLTYPE_TEMPLATE_CLASS
string mTemplateTypes;
wxString mTemplateTypes;
// true, if it's and interface of abstract base class
bool mIsAbstract;

View File

@@ -76,7 +76,7 @@ protected:\
\
struct tree_node \
{\
tree_node* mpParent;\
tree_node* m_pParent;\
tree_node* mpLeft;\
tree_node* mpRight;\
\
@@ -109,16 +109,16 @@ public:\
return pNode;\
}\
else\
if ( pNode->mpParent )\
if ( pNode->m_pParent )\
{\
if ( pNode == pNode->mpParent->mpLeft )\
if ( pNode == pNode->m_pParent->mpLeft )\
\
return pNode->mpParent;\
return pNode->m_pParent;\
\
pNode = pNode->mpParent;\
pNode = pNode->m_pParent;\
\
node_ref_type prevNode = pNode;\
pNode = pNode->mpParent;\
pNode = pNode->m_pParent;\
\
while(pNode)\
{\
@@ -127,7 +127,7 @@ public:\
) return pNode;\
\
prevNode = pNode;\
pNode= pNode->mpParent;\
pNode= pNode->m_pParent;\
}\
\
return 0;\
@@ -147,15 +147,15 @@ public:\
return pNode;\
}\
else\
if ( pNode->mpParent )\
if ( pNode->m_pParent )\
{\
if ( pNode == pNode->mpParent->mpRight )\
return pNode->mpParent;\
if ( pNode == pNode->m_pParent->mpRight )\
return pNode->m_pParent;\
\
pNode = pNode->mpParent;\
pNode = pNode->m_pParent;\
\
node_ref_type prevNode = pNode;\
pNode = pNode->mpParent;\
pNode = pNode->m_pParent;\
\
while(pNode)\
{\
@@ -164,7 +164,7 @@ public:\
) return pNode;\
\
prevNode = pNode;\
pNode= pNode->mpParent;\
pNode= pNode->m_pParent;\
}\
\
return 0;\
@@ -233,7 +233,7 @@ protected:\
{\
node_ref_type pNewNode = AllocNode();\
\
pNewNode->mpParent = \
pNewNode->m_pParent = \
pNewNode->mpLeft =\
pNewNode->mpRight = 0;\
\
@@ -255,7 +255,7 @@ protected:\
: pCurrent->mpRight;\
}\
\
pNewNode->mpParent = pParent;\
pNewNode->m_pParent = pParent;\
\
if(pParent)\
\
@@ -546,15 +546,15 @@ public:\
else\
pX = pY->mpRight;\
\
if ( pX ) pX->mpParent = pY->mpParent;\
if ( pX ) pX->m_pParent = pY->m_pParent;\
\
if (pY->mpParent)\
if (pY->m_pParent)\
\
if (pY == pY->mpParent->mpLeft )\
if (pY == pY->m_pParent->mpLeft )\
\
pY->mpParent->mpLeft = pX;\
pY->m_pParent->mpLeft = pX;\
else\
pY->mpParent->mpRight = pX;\
pY->m_pParent->mpRight = pX;\
else\
mpRoot = pX;\
\
@@ -564,23 +564,23 @@ public:\
\
pY->mpLeft = pZ->mpLeft;\
\
if (pY->mpLeft) pY->mpLeft->mpParent = pY;\
if (pY->mpLeft) pY->mpLeft->m_pParent = pY;\
\
pY->mpRight = pZ->mpRight;\
\
if ( pY->mpRight ) \
\
pY->mpRight->mpParent = pY;\
pY->mpRight->m_pParent = pY;\
\
pY->mpParent = pZ->mpParent;\
pY->m_pParent = pZ->m_pParent;\
\
if (pZ->mpParent)\
if (pZ->m_pParent)\
\
if (pZ == pZ->mpParent->mpLeft)\
if (pZ == pZ->m_pParent->mpLeft)\
\
pZ->mpParent->mpLeft = pY;\
pZ->m_pParent->mpLeft = pY;\
else\
pZ->mpParent->mpRight = pY;\
pZ->m_pParent->mpRight = pY;\
else\
mpRoot = pY;\
\

View File

@@ -60,7 +60,7 @@ protected:\
\
node_ref_type mpFreeListHead;\
node_ref_type mpTerminator;\
size_type mSize;\
size_type m_Size;\
\
inline node_ref_type AllocNode() \
{ \
@@ -318,7 +318,7 @@ public:\
\
inline listClass()\
: mpFreeListHead( 0 ),\
mSize(0)\
m_Size(0)\
{\
mpTerminator = AllocNode();\
mpTerminator->mpPrev = mpTerminator->mpNext = mpTerminator;\
@@ -347,7 +347,7 @@ public:\
\
inline listClass(const_iterator first, const_iterator last)\
: mpFreeListHead( 0 ),\
mSize(0)\
m_Size(0)\
\
{ while( first != last ) push_back( *first++ ); }\
\
@@ -384,9 +384,9 @@ public:\
inline const_reverse_iterator rend() const\
{ return const_reverse_iterator(mpTerminator); }\
\
inline int empty() const { return (mSize == 0); }\
inline int empty() const { return (m_Size == 0); }\
\
inline size_type size() const { return mSize; }\
inline size_type size() const { return m_Size; }\
\
inline size_type max_size() const { return UINT_MAX/sizeof(list_node); }\
\
@@ -415,7 +415,7 @@ public:\
\
new (&pNew->mData) value_type(x);\
\
++mSize;\
++m_Size;\
\
return iterator(pNew);\
}\
@@ -441,8 +441,8 @@ public:\
other.mpTerminator->mpNext = \
other.mpTerminator->mpPrev = other.mpTerminator;\
\
mSize += other.mSize;\
other.mSize = 0;\
m_Size += other.m_Size;\
other.m_Size = 0;\
}\
\
inline void splice( iterator position, listClass& other, iterator first, iterator last )\
@@ -457,8 +457,8 @@ public:\
++sz;\
}\
\
mSize += sz;\
other.mSize -= sz;\
m_Size += sz;\
other.m_Size -= sz;\
\
node_ref_type pPos = position.mpNode;\
node_ref_type pFirst = first.mpNode;\
@@ -502,7 +502,7 @@ public:\
\
firstNode = next;\
\
--mSize;\
--m_Size;\
}\
}\
\
@@ -518,13 +518,13 @@ public:\
\
void sort()\
{\
if ( mSize < 2 ) return;\
if ( m_Size < 2 ) return;\
\
iterator from = begin();\
iterator other_end = end();\
--other_end;\
\
for( size_type i = 0; i != mSize; ++i )\
for( size_type i = 0; i != m_Size; ++i )\
{\
size_type nSwaps = 0;\
\