diff --git a/src/shared/utils.pas b/src/shared/utils.pas
index 4c4db7b0df59997698bca6e3d5861cb9ba9a01a0..0cedb13e86a64643fb396cfd646d5d589fb30ae9 100644 (file)
--- a/src/shared/utils.pas
+++ b/src/shared/utils.pas
function upcase1251 (ch: AnsiChar): AnsiChar; inline;
function locase1251 (ch: AnsiChar): AnsiChar; inline;
+function IsValid1251 (ch: Word): Boolean;
function IsPrintable1251 (ch: AnsiChar): Boolean;
function toLowerCase1251 (const s: AnsiString): AnsiString;
function utf8to1251 (s: AnsiString): AnsiString;
-// `pathname` will be modified if path is valid
-// `lastIsDir` should be `true` if we are searching for directory
-// nobody cares about shitdoze, so i'll use the same code path for it
+// findFileCI eats case-insensitive path, traverses it and rewrites it to a
+// case-sensetive. result value means success.
+// if file/dir not founded than pathname is in undefined state!
function findFileCI (var pathname: AnsiString; lastIsDir: Boolean=false): Boolean;
-// return fixed AnsiString or empty AnsiString
+// findDiskWad tries to find wad file and rewrites extension if needed
+// result is new filename or empty string
function findDiskWad (fname: AnsiString): AnsiString;
// slashes must be normalized!
function isWadNamesEqu (wna, wnb: AnsiString): Boolean;
result := ch;
end;
+function IsValid1251 (ch: Word): Boolean;
+begin
+ result := (ch = Ord('?')) or (wc2shitmap[ch] <> '?')
+end;
+
function IsPrintable1251 (ch: AnsiChar): Boolean;
begin
result := (ch >= #32) and (ch <> #127)
// ////////////////////////////////////////////////////////////////////////// //
-// `pathname` will be modified if path is valid
-// `lastIsDir` should be `true` if we are searching for directory
-// nobody cares about shitdoze, so i'll use the same code path for it
+// findFileCI eats case-insensitive path, traverses it and rewrites it to a
+// case-sensetive. result value means success.
+// if file/dir not founded than pathname is in undefined state!
function findFileCI (var pathname: AnsiString; lastIsDir: Boolean=false): Boolean;
var
sr: TSearchRec;