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

View File

@@ -75,7 +75,7 @@ protected:
void AddEnumNode( char*& cur ); void AddEnumNode( char*& cur );
void AddTypeDefNode( 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 DumpClassHeader( spClass& info, wxSTD ostream& os );
void DumpClassBody( 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_statement( char*& cur );
static inline void skip_token_back( char*& cur ); static inline void skip_token_back( char*& cur );
static inline void skip_next_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 size_t skip_block( char*& cur );
static inline bool skip_imp_block( char*& cur ); static inline bool skip_imp_block( char*& cur );
static bool is_class_token( char*& cur ); static bool is_class_token( char*& cur );
inline static bool is_forward_decl( char* cur ); inline static bool is_forward_decl( char* cur );
inline static bool is_function( char* cur, bool& isAMacro ); inline static bool is_function( char* cur, bool& isAMacro );
static inline void skip_scope_block( char*& cur ); 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 bool is_keyword( char* cur );
static inline void get_string_between( char* start, char* end, string* pStr ); static inline void get_string_between( char* start, char* end, wxString* pStr );
static char* set_comment_text( string& text, char* start ); static char* set_comment_text( wxString& text, char* start );
*/ */
#endif #endif

View File

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

View File

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

View File

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

View File

@@ -28,13 +28,6 @@
#include "wxstlvec.h" #include "wxstlvec.h"
#include "wx/string.h" #include "wx/string.h"
#if wxUSE_STD_STRING
using std::string;
#else
// FIXME:: dirty!
typedef wxString string;
#endif
#endif #endif
#ifndef ASSERT #ifndef ASSERT
@@ -49,9 +42,9 @@
class ScriptStream class ScriptStream
{ {
protected: protected:
char* mpBuf; char* m_pBuf;
size_t mSize; size_t m_Size;
size_t mCapacity; size_t m_Capacity;
public: public:
ScriptStream(); ScriptStream();
~ScriptStream(); ~ScriptStream();
@@ -59,16 +52,16 @@ public:
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 wxString& str );
ScriptStream& operator<<( char ch ); ScriptStream& operator<<( char ch );
void endl(); void endl();
inline char* GetBuf() { return mpBuf; } inline char* GetBuf() { return m_pBuf; }
inline size_t GetBufSize() { return mSize; } inline size_t GetBufSize() { return m_Size; }
// clears current contents of the stream // clears current contents of the stream
void Reset() { mSize = 0; } void Reset() { m_Size = 0; }
}; };
@@ -91,21 +84,21 @@ struct TVarInfo
public: public:
const char* m_Name; const char* m_Name;
int m_Type; int m_Type;
int mOfs; int m_Ofs;
TVarInfo( const char* name, int ofs, int varType ) TVarInfo( const char* name, int ofs, int varType )
: m_Name(name), : m_Name(name),
m_Type( varType ), m_Type( varType ),
mOfs( ofs ) m_Ofs( ofs )
{} {}
}; };
struct TArrayInfo : public TVarInfo struct TArrayInfo : public TVarInfo
{ {
public: public:
int mRefOfs; int m_RefOfs;
int mSizeIntOfs; int m_SizeIntOfs;
int mObjRefTemplOfs; int m_ObjRefTemplOfs;
TArrayInfo( const char* name ) TArrayInfo( const char* name )
: TVarInfo( name, 0, TVAR_REF_ARRAY ) : TVarInfo( name, 0, TVAR_REF_ARRAY )
@@ -163,18 +156,18 @@ class ScriptSection;
class ScriptTemplate class ScriptTemplate
{ {
protected: 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.) // C string can be much faster (in debug v.)
char* mTText; char* m_TText;
TVarListT mVars; TVarListT m_Vars;
inline void PrintVar( TVarInfo* pInfo, inline void PrintVar( TVarInfo* pInfo,
void* dataObj, void* dataObj,
ScriptStream& stm ); ScriptStream& stm );
public: public:
ScriptTemplate( const string& templateText ); ScriptTemplate( const wxString& templateText );
virtual ~ScriptTemplate(); virtual ~ScriptTemplate();
bool HasVar( const char* name ); bool HasVar( const char* name );
@@ -215,34 +208,34 @@ protected:
// 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* m_pParent;
string mId; // $(ID) wxString m_Id; // $(ID)
string m_Name;// $(NAME) wxString m_Name;// $(NAME)
string mBody; // $(BODY) wxString m_Body; // $(BODY)
// NULL, if this section is not aggregated anywhere // NULL, if this section is not aggregated anywhere
SectListT mSubsections; // aggregated sectons SectListT m_Subsections; // aggregated sectons
SectListT mReferences; // registered as $(REFLIST) SectListT m_References; // registered as $(REFLIST)
bool mAutoHide; // see autoHide arg, in constructor bool m_AutoHide; // see autoHide arg, in constructor
bool mSortOn; // true, if sort subsectons by naem bool m_SortOn; // true, if sort subsectons by naem
// tempalte for this section // tempalte for this section
ScriptTemplate* mpSectTempl; ScriptTemplate* m_pSectTempl;
// template used for links (or references) to this section // template used for links (or references) to this section
ScriptTemplate* mpRefTempl; ScriptTemplate* m_pRefTempl;
// do not call destructor of this object, // do not call destructor of this object,
// call RemoveRef() instead // 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 // fields registered and used by ScriptTemplate object
void* mRefFirst; void* m_RefFirst;
int mArrSize; int m_ArrSize;
protected: protected:
virtual void AddRef(); virtual void AddRef();
@@ -320,7 +313,7 @@ public:
class DocGeneratorBase class DocGeneratorBase
{ {
protected: protected:
MarkupTagsT mTags; MarkupTagsT m_Tags;
// 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
@@ -343,14 +336,14 @@ protected:
public: public:
DocGeneratorBase() DocGeneratorBase()
: mTags(0) // no defaul script : m_Tags(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 m_Tags; }
// sets tag array for specific script // sets tag array for specific script
@@ -361,7 +354,7 @@ public:
// 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; } { m_Tags = 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),

View File

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

View File

@@ -32,13 +32,6 @@
#include "wxstlvec.h" #include "wxstlvec.h"
#include "wx/string.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; typedef WXSTL_VECTOR_SHALLOW_COPY(int) SPBlockListT;
#endif #endif
@@ -63,7 +56,7 @@
class SourcePainter class SourcePainter
{ {
protected: protected:
string mResultStr; wxString mResultStr;
SPBlockListT mBlocks; SPBlockListT mBlocks;
bool mCollectResultsOn; bool mCollectResultsOn;

View File

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

View File

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

View File

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

View File

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