/* * Copyright 1995, 1996 Perforce Software. All rights reserved. * * This file is part of Perforce - the FAST SCM System. */ /* * MapChar -- a MapHalf's character string * * Public Methods: * * MapChar::Set() - initialize MapChar, given the string * MapChar::Advance() - advance to the next lexical element * MapChar::ParamNumber() - return wildcard slot of current element * %x = x * * = 10 + nStars * ... = 20 + nDots * MapChar::MakeParam() - format a parameter element * MapChar::Name() - dump out current element name for debugging * * Public attributes: * p - pointer to current element * cc - current element's type * ccPre - previous element's type */ const int PARAM_BASE_PERCENT = 0; // parameter slots for %x const int PARAM_BASE_STARS = 10; // parameter slots for *'s const int PARAM_BASE_DOTS = 20; // parameter slots for ...'s const int PARAM_BASE_TOP = 23; // last slot enum MapCharClass { cEOS, // \0 cCHAR, // any char cSLASH, // / cPERC, // %x cSTAR, // * cDOTS // ... } ; class MapChar { public: int Set( char *&p, int &nStars, int &nDots ); void MakeParam( StrBuf &buf, MapChar *mc2, int &wildSlot ); const char *Name(); // debugging only int IsWild() { return cc >= cPERC; } int operator -( MapChar &mc ) { return StrPtr::SCompare( c, mc.c ); } int operator -( char oc ) { return StrPtr::SCompare( c, oc ); } int operator ==( MapChar &mc ) { return StrPtr::SEqual( c, mc.c ); } int operator ==( char oc ) { return StrPtr::SEqual( c, oc ); } public: char c; // current character char paramNumber; // current ParamNumber MapCharClass cc; // current char's type } ;
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 18760 | rlranft |
Populate -o //guest/perforce_software/p4/... //guest/rlranft/p4/.... |
||
//guest/perforce_software/p4/2014-2/dbsupp/mapchar.h | |||||
#1 | 15903 | Matt Attaway | Everything should be happy now between the Workshop and the depot paths | ||
//guest/perforce_software/p4/2014_2/dbsupp/mapchar.h | |||||
#1 | 15901 | Matt Attaway | Clean up code to fit modern Workshop naming standards | ||
//guest/perforce_software/p4/2014.2/dbsupp/mapchar.h | |||||
#1 | 12189 | Matt Attaway | Initial (and much belated) drop of 2014.2 p4 source code |