// Copyright 1999 (c) by Perforce Software, Inc. All rights reserved. // // p4wStrBuf_test: // Test p4wStrBuf. // ------------------------------------- // Includes // #include <iostream> #include <p4wp4.h> #include "p4wStrBuf.h" // ------------------------------------- // p4wStrBuf test function. // int main(int argc, char *argv[]) { // // Create our sample dictionary. StrBufDict dict; dict.SetVar(StrRef("aString"), StrRef("aString")); dict.SetVar(StrRef("aTime"), StrRef("930854842")); // // Create our p4wStrBuf and format some strings. p4wStrBuf buf; cout << buf.Expand(StrRef("string: %aString%"), dict).Text() << endl; buf.Clear(); cout << buf.Expand(StrRef("noString: %noString?not found%"), dict).Text() << endl; // // Play with time. buf.Clear(); cout << buf.Expand(StrRef("mm/dd/yy: %aTime@*m/*d/*y%"), dict).Text() << endl; buf.Clear(); cout << buf.Expand(StrRef("mm/dd/yyyy: %aTime@*m/*d/*Y%"), dict).Text() << endl; buf.Clear(); cout << buf.Expand(StrRef("*mm*dd*yyyy*: %aTime@***m***d***Y**%"), dict).Text() << endl; buf.Clear(); cout << buf.Expand(StrRef("noTime: %noTime@*m/*d/*Y?not found%"), dict).Text() << endl; }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 12234 | Matt Attaway |
Rejigger P4Web project in preparation for official sunsetting The bin directory contains the last official builds of P4Web from the Perforce download site. P4Web is soon to be completely sunsetted; these builds are here for folks who don't want to build their own. To better handle the archived builds the source code has been moved into a separate src directory. |
||
//guest/perforce_software/p4web/Main/p4wStrBuf_test.cpp | |||||
#1 | 8914 | Matt Attaway | Initial add of the P4Web source code |