From: stephan b. <sg...@us...> - 2004-12-26 12:19:25
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses/Util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12673/include/pclasses/Util Modified Files: StringTool.h Log Message: Renamed expandVars*() to expandDollarRefs*(). Fixed a minor escaped-$var bug. Index: StringTool.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/Util/StringTool.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- StringTool.h 26 Dec 2004 11:58:33 -0000 1.3 +++ StringTool.h 26 Dec 2004 12:19:15 -0000 1.4 @@ -229,11 +229,11 @@ /** Adds the following escape sequences to map: - - single backslash (\) == double backslash. + - 1x backslash (\) == 2x backslash. - - single quote == backslash, quote + - 1x apostrophe == 1x backslash 1x apostrophe - - double quote == backslash, double quote + - 1x double-quote == 1x backslash 1x double-quote */ void operator()( EntityMap & map ); }; @@ -301,12 +301,12 @@ } /** - Exactly like expandVarsInline() but returns a new string + Exactly like expandDollarRefsInline() but returns a new string which results from the expansions. The returned string may be the same as the original. */ - std::string expandVars( const EntityMap & src, const std::string & text ); + std::string expandDollarRefs( const EntityMap & src, const std::string & text ); /** Parsed env vars out of buffer, replacing them with their @@ -340,8 +340,15 @@ accepting any lexically-castable key/val types, but the function is quite long, and therefore not really suitable to inclusion in the header. + + + Known misgivings: + + - When buffer contains dollar signs which are preceeded by + a slash, the slash is stripped even if the $ does not + expand to anything. This is arguably behaviour. */ - size_t expandVarsInline( const EntityMap & src, std::string & buffer ); + size_t expandDollarRefsInline( const EntityMap & src, std::string & buffer ); |