++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
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") ) {
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;
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;
}
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;
}
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 );
bool firstMember = true;
- string type;
+ wxString type;
// jump to the end of statement
// and start collecting same-type varibles
{
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;
if ( *tok != ':' && *cur != ':' )
- pClass->m_SuperClassNames.push_back( string( cur, len ) );
+ pClass->m_SuperClassNames.push_back( wxString( cur, len ) );
} while(1);
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 );
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
mpFileBinderCtx = new spFile();
// the default script is HTML
- mTags = get_HTML_markup_tags();
+ m_Tags = get_HTML_markup_tags();
mpParser = 0; // no default parser!
}
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();
if ( lst[i]->StartsParagraph() )
{
- str += mTags[TAG_PARAGRAPH].start;
+ str += m_Tags[TAG_PARAGRAPH].start;
}
str += lst[i]->m_Text;
}
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 )
// 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 )
void RipperDocGen::AddToCurrentClass( ScriptSection* pSection, spContext& ctx,
const char* subSectionName )
{
- string sName;
+ wxString sName;
if ( ctx.mVisibility == SP_VIS_PROTECTED )
sName = "Protected members/";
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 );
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 );
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 );
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 );
{
wxString body;
- AppendHighlightedSource( body, op.GetFullName(mTags) );
+ AppendHighlightedSource( body, op.GetFullName(m_Tags) );
AppendComments( op, body );
spContext* mpFileBinderCtx;
// script tags set up from usesr code
- MarkupTagsT mTags;
+ MarkupTagsT m_Tags;
protected:
// helpers
/***** 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 )
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 )
return *this;
}
-ScriptStream& ScriptStream::operator<<( const string& str )
+ScriptStream& ScriptStream::operator<<( const wxString& str )
{
if ( str.length() < 512 )
{
/***** 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;
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,
{
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,
{
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;
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;
case TVAR_DOUBLE :
{
sprintf( buf, "%f",
- *( (double*)( (char*)dataObj+pInfo->mOfs) ) );
+ *( (double*)( (char*)dataObj+pInfo->m_Ofs) ) );
stm.WriteBytes( buf, strlen(buf ) );
break;
{
TArrayInfo& info = *((TArrayInfo*)pInfo);
- int sz = *((int*) ( (char*)dataObj+info.mSizeIntOfs ));
+ int sz = *((int*) ( (char*)dataObj+info.m_SizeIntOfs ));
if ( !sz )
{
// DBG::
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 );
}
void ScriptTemplate::PrintScript( void* dataObj, ScriptStream& stm )
{
- char* cur = mTText;
+ char* cur = m_TText;
// template parsing loop
do
// 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;
/***** implementation for class ScriptSection *****/
-int ScriptSection::mIdCounter = 0;
+int ScriptSection::m_IdCounter = 0;
ScriptSection::ScriptSection( const wxString& name,
const wxString& body,
bool autoHide,
bool sorted
)
- : mpParent ( NULL ),
+ : m_pParent ( NULL ),
- m_Name ( name ),
- mBody ( body ),
+ m_Name ( name ),
+ 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 )
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];
}
}
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 )
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:
// 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
// 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 )
{
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;
}
#include "wxstlvec.h"
#include "wx/string.h"
- #if wxUSE_STD_STRING
- using std::string;
- #else
- // FIXME:: dirty!
- typedef wxString string;
- #endif
-
#endif
#ifndef ASSERT
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();
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; }
};
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 )
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 );
// 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();
class DocGeneratorBase
{
protected:
- MarkupTagsT mTags;
+ MarkupTagsT m_Tags;
// override this method to do some post processing
// after generation of document, or even write some
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
// 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),
if ( mCollectResultsOn )
- mResultStr += string( src, srcLen );
+ mResultStr += wxString( src, srcLen );
}
void SourcePainter::SetState( bool isInComment,
#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
class SourcePainter
{
protected:
- string mResultStr;
+ wxString mResultStr;
SPBlockListT mBlocks;
bool mCollectResultsOn;
spContext::spContext()
- : mpParent ( NULL ),
+ : m_pParent ( NULL ),
mpFirstOccurence( NULL ),
mAlreadySorted ( false ),
return mVirtualContextHasChildren;
}
-string spContext::GetVirtualContextBody()
+wxString spContext::GetVirtualContextBody()
{
wxASSERT( mIsVirtualContext );
return mVirtualContextBody;
}
-string spContext::GetFooterOfVirtualContextBody()
+wxString spContext::GetFooterOfVirtualContextBody()
{
wxASSERT( mIsVirtualContext );
}
-void spContext::SetVirtualContextBody( const string& body,
- bool hasChildren,
- const string& footer )
+void spContext::SetVirtualContextBody( const wxString& body,
+ bool hasChildren,
+ const wxString& footer )
{
mVirtualContextHasChildren = hasChildren;
{
mMembers.push_back( pMember );
- pMember->mpParent = this;
+ pMember->m_pParent = this;
}
void spContext::AddComment( spComment* pComment )
return mMembers;
}
-spContext* spContext::FindContext( const string& identifier,
+spContext* spContext::FindContext( const wxString& identifier,
int contextType,
bool searchSubMembers
)
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");
spContext* spContext::GetOutterContext()
{
- return mpParent;
+ return m_pParent;
}
bool spContext::HasOutterContext()
{
- return ( mpParent != 0 );
+ return ( m_pParent != 0 );
}
bool spContext::IsInFile()
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 *****/
#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()
typedef vector<spComment*> MCommentListT;
// list of parameters
typedef vector<spParameter*> MParamListT;
- // string list
+ // wxString list
typedef vector<wxString> StrListT;
#else
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
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
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
spContext* GetOutterContext();
// perhaps more intuitive alias for `GetOutterContext()'
- inline spContext* GetParent() { return mpParent; }
+ inline spContext* GetParent() { return m_pParent; }
bool HasOutterContext();
// 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
);
// 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();
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;
// Created: 27/09/98
// RCS-ID: $Id$
// Copyright: (c) Aleskandars Gluchovas
-// Licence: wxWindows licence
+// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __WXSTLAC_G__
// arguments:
//
-// ARG_IS_UNIQUE
-// ASSOC_CONT_CLASS_NAME
+// ARG_IS_UNIQUE
+// ASSOC_CONT_CLASS_NAME
//
-// ARG_VALUE_TYPE
+// ARG_VALUE_TYPE
// ARG_KEY_TYPE
// ARG_ACTUAL_VALUE_TYPE
-//
+//
// _KEY_NAME
// _VALUE_NAME
//
-// _X_KEY_NAME
-// _X_VALUE_NAME
+// _X_KEY_NAME
+// _X_VALUE_NAME
//
// _INSERT_METHOD_DEFINITION
protected:\
\
public:\
- typedef ARG_VALUE_TYPE value_type;\
- typedef ARG_KEY_TYPE key_type;\
- typedef ARG_ACTUAL_VALUE_TYPE actual_value_type;\
+ typedef ARG_VALUE_TYPE value_type;\
+ typedef ARG_KEY_TYPE key_type;\
+ typedef ARG_ACTUAL_VALUE_TYPE actual_value_type;\
\
typedef value_type* pointer;\
typedef value_type& reference;\
\
struct tree_node \
{\
- tree_node* mpParent;\
+ tree_node* m_pParent;\
tree_node* mpLeft;\
tree_node* mpRight;\
\
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)\
{\
) return pNode;\
\
prevNode = pNode;\
- pNode= pNode->mpParent;\
+ pNode= pNode->m_pParent;\
}\
\
return 0;\
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)\
{\
) return pNode;\
\
prevNode = pNode;\
- pNode= pNode->mpParent;\
+ pNode= pNode->m_pParent;\
}\
\
return 0;\
{\
node_ref_type pNewNode = AllocNode();\
\
- pNewNode->mpParent = \
+ pNewNode->m_pParent = \
pNewNode->mpLeft =\
pNewNode->mpRight = 0;\
\
: pCurrent->mpRight;\
}\
\
- pNewNode->mpParent = pParent;\
+ pNewNode->m_pParent = pParent;\
\
if(pParent)\
\
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;\
\
\
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;\
\
#define GREATER_THEN_FUNCTOR(TYPE) struct \
{ inline int operator()(const TYPE& x, const TYPE& y ) const { return x > y; } }
-// functor argument should be created using the two above macros
+// functor argument should be created using the two above macros
// or passing own class with method "operator()(const TYPE&,cosnt TYPE&)" defined in it
#define WXSTL_MAP( KEY_TYPE, VALUE_TYPE, FUNCTOR ) __DEFINE_MAP( 1 ,KEY_TYPE, VALUE_TYPE, FUNCTOR)
// Created: 27/09/98
// RCS-ID: $Id$
// Copyright: (c) Aleskandars Gluchovas
-// Licence: wxWindows licence
+// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __WXSTLLST_G__
// VERSION:: 0.2 (copy-constructor/assign-op added)
// FOR NOW:: class-member operators "new" and "delete"
-// are ignored by list class, memory allocated
+// are ignored by list class, memory allocated
// and freed using global operators
typedef int Type;
{\
public:\
\
- typedef Type value_type;\
- typedef value_type* pointer;\
- typedef const value_type* const_pointer;\
- typedef value_type& reference;\
- typedef const value_type& const_reference;\
- typedef size_t size_type;\
- typedef ptrdiff_t difference_type;\
+ typedef Type value_type;\
+ typedef value_type* pointer;\
+ typedef const value_type* const_pointer;\
+ typedef value_type& reference;\
+ typedef const value_type& const_reference;\
+ typedef size_t size_type;\
+ typedef ptrdiff_t difference_type;\
\
protected:\
- struct list_node\
- {\
- list_node* mpNext;\
- list_node* mpPrev;\
- value_type mData;\
- };\
-\
- typedef list_node* node_ref_type;\
-\
- node_ref_type mpFreeListHead;\
- node_ref_type mpTerminator;\
- size_type mSize;\
-\
- inline node_ref_type AllocNode() \
- { \
- if ( mpFreeListHead ) \
- {\
- node_ref_type pFreeNode = mpFreeListHead;\
- mpFreeListHead = mpFreeListHead->mpPrev;\
-\
- return pFreeNode;\
- }\
- else\
- {\
- char* pHeapBlock = new char[sizeof(list_node)];\
-\
- return (node_ref_type)pHeapBlock;\
- }\
- }\
-\
- inline void DestroyFreeList()\
- {\
- while ( mpFreeListHead )\
- {\
- node_ref_type tmp = mpFreeListHead;\
+ struct list_node\
+ {\
+ list_node* mpNext;\
+ list_node* mpPrev;\
+ value_type mData;\
+ };\
+\
+ typedef list_node* node_ref_type;\
+\
+ node_ref_type mpFreeListHead;\
+ node_ref_type mpTerminator;\
+ size_type m_Size;\
+\
+ inline node_ref_type AllocNode() \
+ { \
+ if ( mpFreeListHead ) \
+ {\
+ node_ref_type pFreeNode = mpFreeListHead;\
+ mpFreeListHead = mpFreeListHead->mpPrev;\
+\
+ return pFreeNode;\
+ }\
+ else\
+ {\
+ char* pHeapBlock = new char[sizeof(list_node)];\
+\
+ return (node_ref_type)pHeapBlock;\
+ }\
+ }\
+\
+ inline void DestroyFreeList()\
+ {\
+ while ( mpFreeListHead )\
+ {\
+ node_ref_type tmp = mpFreeListHead;\
mpFreeListHead = mpFreeListHead->mpPrev;\
\
delete [](char*)tmp;\
\
inline listClass()\
: mpFreeListHead( 0 ),\
- mSize(0)\
+ m_Size(0)\
{\
mpTerminator = AllocNode();\
mpTerminator->mpPrev = mpTerminator->mpNext = mpTerminator;\
\
inline listClass(const_iterator first, const_iterator last)\
: mpFreeListHead( 0 ),\
- mSize(0)\
+ m_Size(0)\
\
{ while( first != last ) push_back( *first++ ); }\
\
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); }\
\
\
new (&pNew->mData) value_type(x);\
\
- ++mSize;\
+ ++m_Size;\
\
return iterator(pNew);\
}\
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 )\
++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;\
\
firstNode = next;\
\
- --mSize;\
+ --m_Size;\
}\
}\
\
\
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;\
\