/* * Copyright 1995, 1996 Perforce Software. All rights reserved. * * This file is part of Perforce - the FAST SCM System. */ # include <stdhdrs.h> # include <strbuf.h> # include "mapchar.h" static const char *const mapCharNames[] = { "0", "c", "/", "%", "*", "." } ; int MapChar::Set( char *&p, int &nStars, int &nDots ) { this->c = *p; if( c == '/' ) { cc = cSLASH; ++p; } else if( c == '.' && p[1] == '.' && p[2] == '.' ) { cc = cDOTS; paramNumber = PARAM_BASE_DOTS + nDots++; p += 3; } else if( c == '%' && p[1] == '%' && p[2] >= '0' && p[2] <= '9' ) { cc = cPERC; paramNumber = PARAM_BASE_PERCENT + ( p[2] - '0' ); p += 3; } else if( c == '*' ) { cc = cSTAR; paramNumber = PARAM_BASE_STARS + nStars++; ++p; } else if( c == '\0' ) { cc = cEOS; return 0; } else { cc = cCHAR; ++p; } return 1; } void MapChar::MakeParam( StrBuf &p, MapChar *mc2, int &wildSlot ) { if( cc == cDOTS && mc2->cc == cDOTS ) { p << "..."; } else { p << "%%" << ++wildSlot; } } const char * MapChar::Name() { return mapCharNames[ cc ]; }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 18760 | rlranft |
Populate -o //guest/perforce_software/p4/... //guest/rlranft/p4/.... |
||
//guest/perforce_software/p4/2015-1/dbsupp/mapchar.cc | |||||
#1 | 15903 | Matt Attaway | Everything should be happy now between the Workshop and the depot paths | ||
//guest/perforce_software/p4/2015_1/dbsupp/mapchar.cc | |||||
#1 | 15901 | Matt Attaway | Clean up code to fit modern Workshop naming standards | ||
//guest/perforce_software/p4/2015.1/dbsupp/mapchar.cc | |||||
#1 | 12190 | Matt Attaway | Initial drop of 2015.1 p4/p4api source |