Lines Matching refs:s
39 #define IS_DEVICE_PATH(s) ((s)[0] == '\\' && (s)[1] == '\\' && (s)[2] == '.' && (s)[3] == '\\') argument
40 #define IS_SUPER_PREFIX(s) ((s)[0] == '\\' && (s)[1] == '\\' && (s)[2] == '?' && (s)[3] == '\\') argument
41 #define IS_SUPER_OR_DEVICE_PATH(s) ((s)[0] == '\\' && (s)[1] == '\\' && ((s)[2] == '?' || (s)[2] ==… argument
44 #define IS_UNC_WITH_SLASH(s) ( \ argument
45 ((s)[0] == 'U' || (s)[0] == 'u') && \
46 ((s)[1] == 'N' || (s)[1] == 'n') && \
47 ((s)[2] == 'C' || (s)[2] == 'c') && \
48 (s)[3] == '\\')
50 bool IsDevicePath(CFSTR s) throw() in IsDevicePath() argument
54 s = s; in IsDevicePath()
68 if (!IS_DEVICE_PATH(s)) in IsDevicePath()
70 unsigned len = MyStringLen(s); in IsDevicePath()
71 if (len == 6 && s[5] == ':') in IsDevicePath()
73 …if (len < 18 || len > 22 || memcmp(s + kDevicePathPrefixSize, FTEXT("PhysicalDrive"), 13 * sizeof(… in IsDevicePath()
76 if (s[i] < '0' || s[i] > '9') in IsDevicePath()
83 bool IsSuperUncPath(CFSTR s) throw() { return (IS_SUPER_PREFIX(s) && IS_UNC_WITH_SLASH(s + kSuperPa… in IsSuperUncPath() argument
85 bool IsDrivePath(const wchar_t *s) throw() { return IS_LETTER_CHAR(s[0]) && s[1] == ':' && s[2] == … in IsDrivePath() argument
86 bool IsSuperPath(const wchar_t *s) throw() { return IS_SUPER_PREFIX(s); } in IsSuperPath() argument
87 bool IsSuperOrDevicePath(const wchar_t *s) throw() { return IS_SUPER_OR_DEVICE_PATH(s); } in IsSuperOrDevicePath() argument
91 bool IsDrivePath(CFSTR s) throw() { return IS_LETTER_CHAR(s[0]) && s[1] == ':' && s[2] == '\\'; } in IsDrivePath() argument
92 bool IsSuperPath(CFSTR s) throw() { return IS_SUPER_PREFIX(s); } in IsSuperPath() argument
93 bool IsSuperOrDevicePath(CFSTR s) throw() { return IS_SUPER_OR_DEVICE_PATH(s); } in IsSuperOrDevicePath() argument
96 bool IsAbsolutePath(const wchar_t *s) throw() in IsAbsolutePath() argument
98 return s[0] == WCHAR_PATH_SEPARATOR || IsDrivePath(s); in IsAbsolutePath()
105 static unsigned GetRootPrefixSize_Of_NetworkPath(CFSTR s) throw() in GetRootPrefixSize_Of_NetworkPath() argument
108 int pos = FindCharPosInString(s, '\\'); in GetRootPrefixSize_Of_NetworkPath()
111 int pos2 = FindCharPosInString(s + pos + 1, '\\'); in GetRootPrefixSize_Of_NetworkPath()
117 static unsigned GetRootPrefixSize_Of_SimplePath(CFSTR s) throw() in GetRootPrefixSize_Of_SimplePath() argument
119 if (IsDrivePath(s)) in GetRootPrefixSize_Of_SimplePath()
121 if (s[0] != '\\' || s[1] != '\\') in GetRootPrefixSize_Of_SimplePath()
123 unsigned size = GetRootPrefixSize_Of_NetworkPath(s + 2); in GetRootPrefixSize_Of_SimplePath()
127 static unsigned GetRootPrefixSize_Of_SuperPath(CFSTR s) throw() in GetRootPrefixSize_Of_SuperPath() argument
129 if (IS_UNC_WITH_SLASH(s + kSuperPathPrefixSize)) in GetRootPrefixSize_Of_SuperPath()
131 unsigned size = GetRootPrefixSize_Of_NetworkPath(s + kSuperUncPathPrefixSize); in GetRootPrefixSize_Of_SuperPath()
135 int pos = FindCharPosInString(s + kSuperPathPrefixSize, FCHAR_PATH_SEPARATOR); in GetRootPrefixSize_Of_SuperPath()
141 unsigned GetRootPrefixSize(CFSTR s) throw() in GetRootPrefixSize() argument
143 if (IS_DEVICE_PATH(s)) in GetRootPrefixSize()
145 if (IsSuperPath(s)) in GetRootPrefixSize()
146 return GetRootPrefixSize_Of_SuperPath(s); in GetRootPrefixSize()
147 return GetRootPrefixSize_Of_SimplePath(s); in GetRootPrefixSize()
152 static unsigned GetRootPrefixSize_Of_NetworkPath(const wchar_t *s) throw() in GetRootPrefixSize_Of_NetworkPath() argument
155 int pos = FindCharPosInString(s, L'\\'); in GetRootPrefixSize_Of_NetworkPath()
158 int pos2 = FindCharPosInString(s + pos + 1, L'\\'); in GetRootPrefixSize_Of_NetworkPath()
164 static unsigned GetRootPrefixSize_Of_SimplePath(const wchar_t *s) throw() in GetRootPrefixSize_Of_SimplePath() argument
166 if (IsDrivePath(s)) in GetRootPrefixSize_Of_SimplePath()
168 if (s[0] != '\\' || s[1] != '\\') in GetRootPrefixSize_Of_SimplePath()
170 unsigned size = GetRootPrefixSize_Of_NetworkPath(s + 2); in GetRootPrefixSize_Of_SimplePath()
174 static unsigned GetRootPrefixSize_Of_SuperPath(const wchar_t *s) throw() in GetRootPrefixSize_Of_SuperPath() argument
176 if (IS_UNC_WITH_SLASH(s + kSuperPathPrefixSize)) in GetRootPrefixSize_Of_SuperPath()
178 unsigned size = GetRootPrefixSize_Of_NetworkPath(s + kSuperUncPathPrefixSize); in GetRootPrefixSize_Of_SuperPath()
182 int pos = FindCharPosInString(s + kSuperPathPrefixSize, L'\\'); in GetRootPrefixSize_Of_SuperPath()
188 unsigned GetRootPrefixSize(const wchar_t *s) throw() in GetRootPrefixSize() argument
190 if (IS_DEVICE_PATH(s)) in GetRootPrefixSize()
192 if (IsSuperPath(s)) in GetRootPrefixSize()
193 return GetRootPrefixSize_Of_SuperPath(s); in GetRootPrefixSize()
194 return GetRootPrefixSize_Of_SimplePath(s); in GetRootPrefixSize()
199 bool IsAbsolutePath(const wchar_t *s) throw() { return s[0] == WCHAR_PATH_SEPARATOR } in IsAbsolutePath() argument
202 unsigned GetRootPrefixSize(CFSTR s) throw() { return s[0] == CHAR_PATH_SEPRATOR ? 1 : 0; } in GetRootPrefixSize() argument
204 unsigned GetRootPrefixSize(const wchar_t *s) throw() { return s[0] == CHAR_PATH_SEPRATOR ? 1 : 0; } in GetRootPrefixSize() argument
218 TCHAR s[MAX_PATH + 2]; in GetCurDir() local
219 s[0] = 0; in GetCurDir()
220 needLength = ::GetCurrentDirectory(MAX_PATH + 1, s); in GetCurDir()
221 path = fs2us(fas2fs(s)); in GetCurDir()
226 WCHAR s[MAX_PATH + 2]; in GetCurDir() local
227 s[0] = 0; in GetCurDir()
228 needLength = ::GetCurrentDirectoryW(MAX_PATH + 1, s); in GetCurDir()
229 path = s; in GetCurDir()
234 static bool ResolveDotsFolders(UString &s) in ResolveDotsFolders() argument
237 s.Replace(L'/', WCHAR_PATH_SEPARATOR); in ResolveDotsFolders()
241 wchar_t c = s[i]; in ResolveDotsFolders()
244 if (c == '.' && (i == 0 || s[i - 1] == WCHAR_PATH_SEPARATOR)) in ResolveDotsFolders()
246 wchar_t c1 = s[i + 1]; in ResolveDotsFolders()
249 wchar_t c2 = s[i + 2]; in ResolveDotsFolders()
256 if (s[k] == WCHAR_PATH_SEPARATOR) in ResolveDotsFolders()
269 s.Delete(i, num); in ResolveDotsFolders()
282 s.Delete(i, num); in ResolveDotsFolders()
304 static bool AreThereDotsFolders(CFSTR s) in AreThereDotsFolders() argument
308 FChar c = s[i]; in AreThereDotsFolders()
311 if (c == '.' && (i == 0 || s[i - 1] == CHAR_PATH_SEPARATOR)) in AreThereDotsFolders()
313 FChar c1 = s[i + 1]; in AreThereDotsFolders()
315 (c1 == '.' && (s[i + 2] == 0 || s[i + 2] == CHAR_PATH_SEPARATOR))) in AreThereDotsFolders()
343 int GetUseSuperPathType(CFSTR s) throw() in GetUseSuperPathType() argument
345 if (IsSuperOrDevicePath(s)) in GetUseSuperPathType()
348 if ((s)[2] != '.') in GetUseSuperPathType()
349 if (AreThereDotsFolders(s + kSuperPathPrefixSize)) in GetUseSuperPathType()
357 FChar c = s[i]; in GetUseSuperPathType()
362 FChar c2 = s[i + 1]; in GetUseSuperPathType()
368 if (i == 0 || s[i - 1] == CHAR_PATH_SEPARATOR) in GetUseSuperPathType()
370 if (s[i - 1] == '.') in GetUseSuperPathType()
372 if (i - 1 == 0 || s[i - 2] == CHAR_PATH_SEPARATOR) in GetUseSuperPathType()
394 static bool GetSuperPathBase(CFSTR s, UString &res) in GetSuperPathBase() argument
398 FChar c = s[0]; in GetSuperPathBase()
401 if (c == '.' && (s[1] == 0 || (s[1] == '.' && s[2] == 0))) in GetSuperPathBase()
404 if (IsSuperOrDevicePath(s)) in GetSuperPathBase()
408 if ((s)[2] == '.') in GetSuperPathBase()
413 if (!AreThereDotsFolders(s + kSuperPathPrefixSize)) in GetSuperPathBase()
416 UString temp = fs2us(s); in GetSuperPathBase()
436 if (s[1] == CHAR_PATH_SEPARATOR) in GetSuperPathBase()
438 UString temp = fs2us(s + 2); in GetSuperPathBase()
454 if (IsDrivePath(s)) in GetSuperPathBase()
456 UString temp = fs2us(s); in GetSuperPathBase()
505 temp = fs2us(s + 1); in GetSuperPathBase()
510 temp += fs2us(s); in GetSuperPathBase()
581 bool GetFullPath(CFSTR dirPrefix, CFSTR s, FString &res) in GetFullPath() argument
583 res = s; in GetFullPath()
587 if (s[0] != CHAR_PATH_SEPARATOR) in GetFullPath()
592 res += s; in GetFullPath()
597 unsigned prefixSize = GetRootPrefixSize(s); in GetFullPath()
600 if (!AreThereDotsFolders(s + prefixSize)) in GetFullPath()
603 UString rem = fs2us(s + prefixSize); in GetFullPath()
662 if (s[0] == CHAR_PATH_SEPARATOR) in GetFullPath()
664 temp = fs2us(s + 1); in GetFullPath()
669 temp += fs2us(s); in GetFullPath()