Example #1
0
	String getArgV(const StringRef& find , bool getValue , const StringRef& def) {
		if (find.isWide() || def.isWide()) {
			return getArgV((const wchar_t**)__wargv+1 , __argc-1 , find.w_str() , getValue , def.w_str());
		} else {
			return getArgV((const char**)__argv+1 , __argc-1 , find.a_str() , getValue , def.a_str());
		}
	}
Example #2
0
	bool fileExists(const StringRef& file) {
		if (file.isWide()) {
			return _access(file.a_str(), 0) == 0;
		} else {
			return _waccess(file.w_str(), 0) == 0;
		}
	}
Example #3
0
	__int64 chtoint64(const StringRef& str , unsigned char base) {
		if (str.isWide()) {
			const wchar_t* s = str.w_str();
			int sign = checkIntChar(s, base);
			return sign * _wcstoui64(s, 0, base);
		} else {
			const char* s = str.a_str();
			int sign = checkIntChar(s, base);
			return sign * _strtoui64(s, 0, base);
		}
	}
Example #4
0
	int chtoint(const StringRef& str , unsigned char base) {
		if (str.isWide()) {
			const wchar_t* s = str.w_str();
			int sign = checkIntChar(s, base);
			return sign * wcstoul(s, 0, base);
		} else {
			const char* s = str.a_str();
			int sign = checkIntChar(s, base);
			return sign * strtoul(s, 0, base);
		}
		//return strToNumber<unsigned int>(str, base);
	}
Example #5
0
	bool isDirectory(const StringRef& path) {
		if (path == ".") return true;
		DWORD attr;
		if (path.isWide()) {
			attr = GetFileAttributesA(path.a_str());
		} else {
			attr = GetFileAttributesW(path.w_str());
		}
		if (attr == INVALID_FILE_ATTRIBUTES) 
			return false;
		else
			return (attr & FILE_ATTRIBUTE_DIRECTORY) != 0;
	}