Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1 | daniel-mar | 1 | //--------------------------------------------------------------------------- |
2 | |||
3 | #ifndef ZStringsH |
||
4 | #define ZStringsH |
||
5 | /* |
||
6 | ************************************************************************ |
||
7 | Copyright (C) 2009, 2010 by Russell J. Peters, Roger Aelbrecht |
||
8 | |||
9 | This file is part of TZipMaster Version 1.9. |
||
10 | |||
11 | TZipMaster is free software: you can redistribute it and/or modify |
||
12 | it under the terms of the GNU Lesser General Public License as published by |
||
13 | the Free Software Foundation, either version 3 of the License, or |
||
14 | (at your option) any later version. |
||
15 | |||
16 | TZipMaster is distributed in the hope that it will be useful, |
||
17 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
||
18 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||
19 | GNU Lesser General Public License for more details. |
||
20 | |||
21 | You should have received a copy of the GNU Lesser General Public License |
||
22 | along with TZipMaster. If not, see <http://www.gnu.org/licenses/>. |
||
23 | |||
24 | contact: problems@delphizip.org (include ZipMaster in the subject). |
||
25 | updates: http://www.delphizip.org |
||
26 | DelphiZip maillist subscribe at http://www.freelists.org/list/delphizip |
||
27 | ************************************************************************ |
||
28 | */ |
||
29 | //--------------------------------------------------------------------------- |
||
30 | #ifndef UNICODE |
||
31 | #error UNICODE required |
||
32 | #endif |
||
33 | #ifndef _UNICODE |
||
34 | #define _UNICODE |
||
35 | #endif |
||
36 | #include "DZ_StrW.h" |
||
37 | |||
38 | #ifndef CP_OEM |
||
39 | #define CP_OEM 1 |
||
40 | #endif |
||
41 | |||
42 | #define SLASH _T('/') |
||
43 | #define BSLASH _T('\\') |
||
44 | #define DOT _T('.') |
||
45 | #define COLON _T(':') |
||
46 | #define WILDALL _T('*') |
||
47 | #define WILDANY _T('?') |
||
48 | |||
49 | int __fastcall ValidUTF8(const DZStrA &str); |
||
50 | |||
51 | #define HOWRAW 0 |
||
52 | #define HOWUTF8 2 |
||
53 | #define HOWOEM 3 |
||
54 | DZStrW __fastcall StrIncSep(const DZStrW &p); |
||
55 | DZStrW __fastcall StrExcSep(const DZStrW &p); |
||
56 | DZStrW __fastcall StrIntSep(const DZStrW &p); |
||
57 | DZStrA __fastcall StrIntSep(const DZStrA &p); |
||
58 | DZStrW __fastcall StrExtSep(const DZStrW &p); |
||
59 | DZStrA __fastcall StrExtSep(const DZStrA &p); |
||
60 | |||
61 | DZStrA __fastcall StrToUTF8(const DZStrW &str); |
||
62 | DZStrA __fastcall StrToOEM(const DZStrW &str); |
||
63 | DZStrA __fastcall StrToOEM(const DZStrA &str); |
||
64 | DZStrW __fastcall OEMToStr(const char *str); |
||
65 | |||
66 | DZStrA __fastcall toHex(unsigned val, unsigned cnt); |
||
67 | int __fastcall Is_Drv(const DZStrW &spec); |
||
68 | int __fastcall Is_DrvEx(const DZStrW &spec); |
||
69 | bool __fastcall Is_AbsPath(const DZStrW& pth); |
||
70 | |||
71 | const int Z_BAD_DRIVE = -1; |
||
72 | const int Z_BAD_SEP = -2; |
||
73 | const int Z_BAD_SPACE = -3; // lead/trail space |
||
74 | const int Z_BAD_CLEN = -4; // component too long |
||
75 | const int Z_BAD_CHAR = -5; // invalid char |
||
76 | const int Z_BAD_NAME = -6; // has reserved name |
||
77 | const int Z_BAD_PARENT = -7; // attempt to back below root |
||
78 | const int Z_IS_THIS = -8; |
||
79 | const int Z_IS_PARENT = -9; |
||
80 | const int Z_WILD = 1; |
||
81 | int __fastcall CleanPath(const DZStrW& pathin, DZStrW& pathout);//, bool CheckA); |
||
82 | int __fastcall CheckComponent(const DZStrW& c); |
||
83 | int __fastcall DriveLen(const DZStrW &fspec); |
||
84 | |||
85 | bool __fastcall ZMatch(const DZStrW &thePattern, const DZStrW &theSpec); |
||
86 | DWORD __fastcall GetFileAttrs(const DZStrW& p); |
||
87 | bool __fastcall IsWild(const DZStrW& p); |
||
88 | |||
89 | const TCHAR* __fastcall Is_In(const TCHAR *p, TCHAR c); |
||
90 | const char* __fastcall Is_InA(const char *p, char c); |
||
91 | |||
92 | TCHAR __fastcall LastChar(const TCHAR *p); |
||
93 | |||
94 | const char* DupStr(const DZStrA& from); |
||
95 | const wchar_t* DupStr(const DZStrW& from); |
||
96 | |||
97 | DZStrW __fastcall GetArg(const DZStrW &CmdLine, unsigned &idx, bool AllowPW); |
||
98 | |||
99 | bool __fastcall DirExists(const DZStrW& path); |
||
100 | DZStrW __fastcall ExtractFilePath(const DZStrW path); |
||
101 | bool __fastcall ForceDirectories(const DZStrW Dir, int minlen); |
||
102 | |||
103 | #endif |