- /*
- * Copyright 1995, 1996 Perforce Software. All rights reserved.
- *
- * This file is part of Perforce - the FAST SCM System.
- */
- /*
- * strtable.h - a string table, using StrDict interface
- *
- * Classes defined:
- *
- * StrPtrDict - a dictionary whose values we don't own
- * StrBufDict - a dictionary whose values we do own
- * BufferDict - a dictionary stuffed into a StrBuf.
- *
- * Public methods:
- *
- * Clear() - reset table, making all variables unset
- * GetVar() - look up variable, return value (or 0 if not set)
- * SetVar() - set variable/value pair
- *
- * XXX Total dumb duplication of StrPtrDict into StrBufDict.
- */
- struct StrPtrEntry;
- struct StrBufEntry;
- class VarArray;
- class StrPtrDict : public StrDict {
- public:
- StrPtrDict();
- ~StrPtrDict();
- // virtuals of StrDict
- StrPtr * VGetVar( const StrPtr &var );
- void VSetVar( const StrPtr &var, const StrPtr &val );
- void VRemoveVar( const StrPtr &var );
- int VGetVarX( int x, StrRef &var, StrRef &val );
- void VClear() { tabLength = 0; }
- private:
- VarArray *elems;
- int tabSize;
- int tabLength;
- } ;
- class StrBufDict : public StrDict {
- public:
- StrBufDict();
- StrBufDict( StrDict & dict );
- StrBufDict & operator =( StrDict & dict );
- ~StrBufDict();
- int GetCount()
- {
- return tabLength;
- }
- // virtuals of StrDict
- StrPtr * VGetVar( const StrPtr &var );
- void VSetVar( const StrPtr &var, const StrPtr &val );
- void VRemoveVar( const StrPtr &var );
- int VGetVarX( int x, StrRef &var, StrRef &val );
- void VClear() { tabLength = 0; }
- StrPtr * GetVarN( const StrPtr &var );
- private:
- VarArray *elems;
- int tabSize;
- int tabLength;
- } ;
- const int BufferDictMax = 20;
- class BufferDict : public StrDict {
- public:
- BufferDict() {}
- ~BufferDict() {}
- BufferDict & operator =( const BufferDict &s );
- // virtuals of StrDict
- StrPtr * VGetVar( const StrPtr &var );
- int VGetVarX( int x, StrRef &var, StrRef &val );
- void VSetVar( const StrPtr &var, const StrPtr &val );
- void VClear() { buf.Clear(); count = 0; }
- private:
- StrRef varRef; // temp for VGetVar
- int count;
- struct Var {
- int varOff; // into buf.Text()
- int varLen;
- int valOff; // into buf.Text()
- int valLen;
- } vars[ BufferDictMax ];
- StrBuf buf; // hold var/values
- } ;
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 7893 | Johan Nilsson | OFFLINE CHANGELIST 10 - SUBMITTED ON 2011/03/23 11:18:27 Upgrade project files to VS2010... and switching to msbuild for the entire project. Retargeted everything to .NET4 Client Profile for the time being, due to VS2010 C++ limitations (can't target anything other than 4.0 without complicating the setup too much). Shouldn't be too hard to retarget later if push comes to shove. Added VS2010 P4API stuff directly inside this project also to make things easier to get up and running for the moment. Removed old static P4API libraries. ____________________________________________________________ OFFLINE CHANGELIST 9 - SUBMITTED ON 2011/03/22 07:35:31 Converted to VS2010 « |
14 years ago |