38 #if GTEST_OS_WINDOWS_MOBILE
40 #elif GTEST_OS_WINDOWS
43 #elif GTEST_OS_SYMBIAN
45 # include <sys/syslimits.h>
49 #endif // GTEST_OS_WINDOWS_MOBILE
52 # define GTEST_PATH_MAX_ _MAX_PATH
53 #elif defined(PATH_MAX)
54 # define GTEST_PATH_MAX_ PATH_MAX
55 #elif defined(_XOPEN_PATH_MAX)
56 # define GTEST_PATH_MAX_ _XOPEN_PATH_MAX
58 # define GTEST_PATH_MAX_ _POSIX_PATH_MAX
59 #endif // GTEST_OS_WINDOWS
72 const char kAlternatePathSeparator =
'/';
73 const char kAlternatePathSeparatorString[] =
"/";
74 # if GTEST_OS_WINDOWS_MOBILE
80 const DWORD kInvalidFileAttributes = 0xffffffff;
83 # endif // GTEST_OS_WINDOWS_MOBILE
87 #endif // GTEST_OS_WINDOWS
91 #if GTEST_HAS_ALT_PATH_SEP_
100 #if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_WINDOWS_PHONE || GTEST_OS_WINDOWS_RT
104 #elif GTEST_OS_WINDOWS
106 return FilePath(_getcwd(cwd,
sizeof(cwd)) == NULL ?
"" : cwd);
109 char* result = getcwd(cwd,
sizeof(cwd));
115 # endif // GTEST_OS_NACL
116 return FilePath(result == NULL ?
"" : cwd);
117 #endif // GTEST_OS_WINDOWS_MOBILE
128 0,
pathname_.length() - dot_extension.length()));
138 #if GTEST_HAS_ALT_PATH_SEP_
139 const char*
const last_alt_sep = strrchr(
c_str(), kAlternatePathSeparator);
141 if (last_alt_sep != NULL &&
142 (last_sep == NULL || last_alt_sep > last_sep)) {
157 return last_sep ?
FilePath(last_sep + 1) : *
this;
202 return relative_path;
210 #if GTEST_OS_WINDOWS_MOBILE
211 LPCWSTR unicode = String::AnsiToUtf16(
pathname_.c_str());
212 const DWORD attributes = GetFileAttributes(unicode);
214 return attributes != kInvalidFileAttributes;
218 #endif // GTEST_OS_WINDOWS_MOBILE
234 #if GTEST_OS_WINDOWS_MOBILE
235 LPCWSTR unicode = String::AnsiToUtf16(path.
c_str());
236 const DWORD attributes = GetFileAttributes(unicode);
238 if ((attributes != kInvalidFileAttributes) &&
239 (attributes & FILE_ATTRIBUTE_DIRECTORY)) {
246 #endif // GTEST_OS_WINDOWS_MOBILE
269 ((name[0] >=
'a' && name[0] <=
'z') ||
270 (name[0] >=
'A' && name[0] <=
'Z')) &&
292 full_pathname.
Set(
MakeFileName(directory, base_name, number++, extension));
294 return full_pathname;
326 #if GTEST_OS_WINDOWS_MOBILE
328 LPCWSTR unicode = String::AnsiToUtf16(removed_sep.
c_str());
329 int result = CreateDirectory(unicode, NULL) ? 0 : -1;
331 #elif GTEST_OS_WINDOWS
334 int result = mkdir(
pathname_.c_str(), 0777);
335 #endif // GTEST_OS_WINDOWS_MOBILE
363 char* dest_ptr =
dest;
364 memset(dest_ptr, 0,
pathname_.length() + 1);
366 while (*src !=
'\0') {
371 #if GTEST_HAS_ALT_PATH_SEP_
372 if (*dest_ptr == kAlternatePathSeparator) {