uitools_plat/cdl_api/inc/CdlCompilerToolkit/CdlTkUtil.h
changeset 1 b700e12870ca
parent 0 f58d6ec98e88
equal deleted inserted replaced
0:f58d6ec98e88 1:b700e12870ca
   143     * @param aChar the character to test
   143     * @param aChar the character to test
   144     * @return true if the character is valid for a C++ identifier
   144     * @return true if the character is valid for a C++ identifier
   145     */
   145     */
   146 	static bool IsCpp(char aChar);
   146 	static bool IsCpp(char aChar);
   147 
   147 
       
   148     /**
       
   149      * Is the character equal to '\\' or '/' ? 
       
   150      * @param aChar the character to test
       
   151      * @return true if the character is a path separator
       
   152      */
       
   153 	static bool IsPathSeparator(char aChar);
       
   154 	static std::string::size_type FindFirstPathSeparator(const std::string& s);
       
   155 	static std::string::size_type FindLastPathSeparator(const std::string& s);
   148 	/**
   156 	/**
   149     * This class contains a set of terms to replace in a string. It is used
   157     * This class contains a set of terms to replace in a string. It is used
   150 	* with CdlTkUtil::MultiReplace().
   158 	* with CdlTkUtil::MultiReplace().
   151     */
   159     */
   152 	class CReplaceSet : public std::vector<CReplaceTerm>
   160 	class CReplaceSet : public std::vector<CReplaceTerm>
   274 		const std::string ws(" \t\r\n");
   282 		const std::string ws(" \t\r\n");
   275 		std::string::const_iterator pChar = aString.begin();
   283 		std::string::const_iterator pChar = aString.begin();
   276 		std::string::const_iterator pWord = pChar;
   284 		std::string::const_iterator pWord = pChar;
   277 		for (; ; ++pChar)
   285 		for (; ; ++pChar)
   278 			{
   286 			{
   279 			if (pChar == aString.end() || ws.find_first_of(*pChar) != string::npos)
   287 			  if (pChar == aString.end() || ws.find_first_of(*pChar) != std::string::npos)
   280 				{
   288 				{
   281 				if (pWord != pChar)
   289 				if (pWord != pChar)
   282 					{
   290 					{
   283 					*pOut = std::string(pWord, pChar);
   291 					*pOut = std::string(pWord, pChar);
   284 					pOut++;
   292 					pOut++;