stdStr Path::getExt(const stdStr& fileSpec) { size_t pos = fileSpec.find_last_of(TEXT(".")); if(pos < fileSpec.length()) return toLower(fileSpec.substr(pos+1,fileSpec.length()-pos)); return TEXT(""); }
stdStr Path::getName(const stdStr &fileSpec) { size_t pos = fileSpec.find_last_of(TEXT("/")); if(pos >= fileSpec.length()) pos = fileSpec.find_last_of(TEXT("\\")); if(pos >= fileSpec.length()) return toLower(fileSpec); return toLower(fileSpec.substr(pos+1,fileSpec.length()-pos)); }
stdStr Path::getPath(const stdStr &fileSpec) { size_t pos = fileSpec.find_last_of(TEXT("/")); if(pos >= fileSpec.length()) pos = fileSpec.find_last_of(TEXT("\\")); if(pos >= fileSpec.length()) return TEXT("."); if(fileSpec.find(TEXT("."),pos+1)) return toLower(fileSpec.substr(0,pos+1)); return fileSpec; }
std::wstring toUnicode(const stdStr& src) { std::wstring temp; for(size_t i=0; i<src.length(); ++i) temp += static_cast<wchar_t>(src[i]); return temp; }
stdStr Path::toUpper(const stdStr& src) { stdStr temp; for(size_t i=0; i<src.length(); ++i) temp += toupper(src[i]); return temp; }