// // Copyright 2001 Perforce Software. All rights reserved. // // This file is part of Perforce - the FAST SCM System. // // p4wStrBuf: // StrBuf with the p4w-specific ::Expand() modifications. // Also include utilities for escaping and unescaping characters // in urls and html. // // Valid formats for Expand() // %var% // %var?alternate text if 'var' does not exist; do not use '%%'% // %var@strftime()-style format args with * instead of %; use '**' for '*'% // // Notes: // '?' may be combined with '@'. Example: %time@m d Y?No Time% #ifndef p4wStrBuf_H #define p4wStrBuf_H class p4wStrBuf : public StrBuf { public: p4wStrBuf() : StrBuf() {} virtual ~p4wStrBuf() {} // // p4w's ::Expand functions. virtual p4wStrBuf& Expand(const StrPtr &s, StrDict &d, int isUnicode =0, int bForceWrap =0); p4wStrBuf& ExpandList(const StrPtr &s, StrDict &d, int x, int isUnicode =0, int bForceWrap =0); p4wStrBuf& ExpandArray(const StrPtr &s, StrDict &d, int x, int y, int isUnicode =0); // // Escape <>&'s to > < and & p4wStrBuf& EscapeHTML(const StrPtr &s, int isUnicode =0, int bForceWrap =0); // // Escape html and change "http://" into real urls p4wStrBuf& EscapeHTMLDoURLs(const StrPtr &s, int isUnicode =0); // // Escape and unescape URL's. p4wStrBuf& EscapeURL(const StrPtr &s, int isUnicode =0); p4wStrBuf& EscapeSpaces(const StrPtr &s); p4wStrBuf& EscapeURLAllChars(const StrPtr &s, int isUnicode =0); p4wStrBuf& UnescapeURL(const StrPtr &s, int plus2sp =0); // // Escape and unescape ampersands only p4wStrBuf& EscapeAmp(const StrPtr &); p4wStrBuf& UnescapeAmp(const StrPtr &); // // Escape double quotes only p4wStrBuf& EscapeDQuotes(const StrPtr &); // // Escape URL, & terminate base with '/' if not there already p4wStrBuf& NormalizeBase(const StrPtr &, int isUnicode =0); // // Escape/Unescape characters special to p4 p4wStrBuf& EscapeP4Chars(const StrPtr &); p4wStrBuf& UnescapeP4Chars(const StrPtr &); // // Strip out trailing and leading blanks p4wStrBuf& StripBlanks(const StrPtr &); private: p4wStrBuf& DoExpand(const StrPtr &s, StrDict &d, int nargs, int x, int y, int unicode =0, int bForceWrap =0); }; #endif // p4wStrBuf_H
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#2 | 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. |
||
#1 | 8914 | Matt Attaway | Initial add of the P4Web source code |