Esempio n. 1
0
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("");
}
Esempio n. 2
0
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));
}
Esempio n. 3
0
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;
}
Esempio n. 4
0
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;
}
Esempio n. 5
0
stdStr Path::toUpper(const stdStr& src)
{
  stdStr temp;
  for(size_t i=0; i<src.length(); ++i)
    temp += toupper(src[i]);
  return temp;
}