Exemple #1
0
template<typename CharType> static PathName UnmangleNameOfFile_(const CharType* lpszFrom)
{
  PathName ret;
  char* lpszTo = ret.GetData();
  MIKTEX_ASSERT_STRING(lpszFrom);
  size_t len = StrLen(lpszFrom);
  if (len >= ret.GetCapacity())
  {
    MIKTEX_UNEXPECTED();
  }
  size_t idx;
  for (idx = 0; idx < len; ++idx)
  {
    if (lpszFrom[idx] == '*')
    {
      lpszTo[idx] = ' ';
    }
    else if (lpszFrom[idx] == '?')
    {
      lpszTo[idx] = '~';
    }
    else
    {
      lpszTo[idx] = lpszFrom[idx];
    }
  }
  lpszTo[idx] = 0;
  return ret;
}
Exemple #2
0
PathName WebAppInputLine::MangleNameOfFile(const char* lpszFrom)
{
  PathName ret;
  char* lpszTo = ret.GetData();
  MIKTEX_ASSERT_STRING(lpszFrom);
  size_t len = StrLen(lpszFrom);
  if (len >= ret.GetCapacity())
  {
    MIKTEX_UNEXPECTED();
  }
  size_t idx;
  for (idx = 0; idx < len; ++idx)
  {
    if (lpszFrom[idx] == ' ')
    {
      lpszTo[idx] = '*';
    }
    else if (lpszFrom[idx] == '~')
    {
      lpszTo[idx] = '?';
    }
    else if (lpszFrom[idx] == '\\')
    {
      lpszTo[idx] = '/';
    }
    else
    {
      lpszTo[idx] = lpszFrom[idx];
    }
  }
  lpszTo[idx] = 0;
  return ret;
}
Exemple #3
0
bool
Utils::GetEnvironmentString (/*[in]*/ const char *		lpszName,
			     /*[out]*/ PathName &		path)
{
  return (Utils::GetEnvironmentString(lpszName,
				      path.GetBuffer(),
				      path.GetCapacity()));
}