86class MIKTEXNOVTABLE Utils
92 Utils(
const Utils& other) =
delete;
95 Utils& operator=(
const Utils& other) =
delete;
98 Utils(Utils&& other) =
delete;
101 Utils& operator=(Utils&& other) =
delete;
120#if defined(MIKTEX_WINDOWS)
122 static MIKTEXCORECEEAPI(
bool) GetDefPrinter(std::string& printerName);
129 static MIKTEXCORECEEAPI(std::string) GetExeName();
142 static MIKTEXCORECEEAPI(std::string) MakeProgramVersionString(
const std::string& programName,
const VersionNumber& versionNumber);
145 static MIKTEXCORECEEAPI(std::string) GetOSVersionString();
148 static MIKTEXCORECEEAPI(
GitInfo) GetGitInfo();
151 static MIKTEXCORECEEAPI(
bool) HaveGetGitInfo();
158 static MIKTEXCORECEEAPI(
const char*) GetRelativizedPath(
const char* lpszPath,
const char* lpszRoot);
173 static MIKTEXCORECEEAPI(
void) SetEnvironmentString(
const std::string& valueName,
const std::string& value);
176 static MIKTEXCORECEEAPI(
void) RemoveEnvironmentString(
const std::string& valueName);
179 static MIKTEXCORECEEAPI(
void) PrintException(
const std::exception& e);
187 static MIKTEXCORECEEAPI(
bool) ReadLine(std::string& str, FILE* stream,
bool keepLineEnding);
190 static MIKTEXCORECEEAPI(std::string) Hexify(
const void* pv, std::size_t nBytes,
bool lowerCase);
193 static MIKTEXCORECEEAPI(std::string) Hexify(
const void* pv, std::size_t nBytes);
196 static MIKTEXCORECEEAPI(
bool) ParseDvipsFontMapLine(
const std::string& line,
DvipsFontMapEntry& fontMapEntry);
201#if !HAVE_MIKTEX_USER_INFO
203 static MIKTEXCORECEEAPI(
void) RegisterMiKTeXUser();
206#if !HAVE_MIKTEX_USER_INFO
208 static MIKTEXCORECEEAPI(
bool) IsRegisteredMiKTeXUser();
212 static MIKTEXCORECEEAPI(
void) ShowWebPage(
const std::string& url);
215#if defined(MIKTEX_WINDOWS)
216 static MIKTEXCORECEEAPI(
MiKTeX::Util::PathName) GetFolderPath(
int nFolder,
int nFallbackFolder,
bool getCurrentPath);
220 static MIKTEXCORECEEAPI(
void) CheckHeap();
226 static MIKTEXCOREEXPORT std::pair<bool, MiKTeX::Util::PathName> MIKTEXCEECALL ExpandTilde(
const std::string& s);
229 static bool IsPureAscii(
const char* lpsz)
231 MIKTEX_ASSERT_STRING(lpsz);
232 for (; *lpsz != 0; ++lpsz)
234 if (
static_cast<unsigned>(*lpsz) > 127)
243 static bool IsPureAscii(
const std::string& str)
245 return IsPureAscii(str.c_str());
249 static MIKTEXCORECEEAPI(
bool) IsUTF8(
const char* lpsz,
bool allowPureAscii);
252 static bool IsUTF8(
const char* lpsz)
254 return IsUTF8(lpsz,
true);
258 static bool Equals(
const char* str1,
const char* str2)
260 return strcmp(str1, str2) == 0;
264 static bool EqualsIgnoreCase(
const char* str1,
const char* str2)
266 MIKTEX_ASSERT(IsPureAscii(str1) && IsPureAscii(str2));
268 return _stricmp(str1, str2) == 0;
270 return strcasecmp(str1, str2) == 0;
275 static bool EqualsIgnoreCase(
const std::string& str1,
const std::string& str2)
277 return EqualsIgnoreCase(str1.c_str(), str2.c_str());
281 static std::string
MakeLower(
const std::string& str)
283 MIKTEX_ASSERT(IsPureAscii(str));
284 std::string str2(str.size(), 0);
285 std::transform(str.begin(), str.end(), str2.begin(), ::tolower);
290 static MIKTEXCORECEEAPI(
unsigned long long) ToUnsignedLongLong(
const std::string& s);
293 static MIKTEXCORECEEAPI(std::size_t) ToSizeT(
const std::string& s);
296 static MIKTEXCORECEEAPI(std::time_t) ToTimeT(
const std::string& s);
299 static MIKTEXCOREEXPORT std::pair<bool, bool> MIKTEXCEECALL CheckPath();
302 static MIKTEXCORECEEAPI(
bool) CheckPath(
bool repair);
304#if defined(MIKTEX_WINDOWS)
306 static MIKTEXCORECEEAPI(
void) RegisterShellFileAssoc(
const std::string& extension,
const std::string& progId,
bool takeOwnership);
309#if defined(MIKTEX_WINDOWS)
311 static MIKTEXCORECEEAPI(
void) UnregisterShellFileAssoc(
const std::string& extension,
const std::string& progId);
314#if defined(MIKTEX_WINDOWS)
316 static MIKTEXCORECEEAPI(
void) RegisterShellFileType(
const std::string& progId,
const std::string& userFriendlyName,
const std::string& iconPath);
319#if defined(MIKTEX_WINDOWS)
321 static MIKTEXCORECEEAPI(
void) UnregisterShellFileType(
const std::string& progId);
324#if defined(MIKTEX_WINDOWS)
326 static MIKTEXCORECEEAPI(
void) RegisterShellVerb(
const std::string& progId,
const std::string& verb,
const std::string& command,
const std::string& ddeExec);
329#if defined(MIKTEX_WINDOWS)
331 static MIKTEXCORECEEAPI(std::string) MakeProgId(
const std::string& progId);
Information about an entry in a Dvips font map file.
Definition Utils.h:52
std::string psName
Name of the PostScript font.
Definition Utils.h:56
std::string specialInstructions
Special instructions to be embedded into the PostScript document.
Definition Utils.h:58
std::string encFile
Name of the encoding vector file.
Definition Utils.h:60