Пример #1
0
	DLLEXPORT char *stripCRLF(char *tempf) {
		/* old Method */
		tempf = str_replaceAll(tempf,"\r","");
		tempf = str_replaceAll(tempf,"\n","");
		return tempf;
		

		/*new method
		int n = strpos("\n", tempf);
		int r = strpos("\r", tempf);

		printf("[n:%d/r:%d]\n", n, r);

		if ((n > 0) && (r > 0)) {
			if (n < r) {
				//strncpy(tempf,tempf,n-1);
				return strLtrim(tempf,strlen(tempf)-n+1);
			}
			else if (r < n) {
				//strncpy(tempf,tempf,r-1);
				return strLtrim(tempf,strlen(tempf)-r+1);
			}
		}
		else
		{
			return tempf;
		}
		*/
	}
Пример #2
0
	DLLEXPORT char *stripspace(char *tempf) {
		tempf = str_replaceAll(tempf," ","");
		tempf = str_replaceAll(tempf,"\t","");
		tempf = str_replaceAll(tempf,"\r\n\r\n","\r\n");
		tempf = str_replaceAll(tempf,"\r\r","\r");
		tempf = str_replaceAll(tempf,"\n\n","\n");
		return tempf;
	}
	UString os_path(const UString& path)
	{
		UString temp = path;
#ifdef VIX_SYS_WINDOWS
		str_replaceAll(temp, UNIX_PATH_DELIM, WIN_PATH_DELIM);
#else
		str_replaceAll(temp, "\\", "/");
#endif
		return temp;
	}