| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 #ifndef S_ISDIR // Not defined in stat.h on Windows. | 31 #ifndef S_ISDIR // Not defined in stat.h on Windows. |
| 32 #define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR) | 32 #define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR) |
| 33 #endif | 33 #endif |
| 34 | 34 |
| 35 #include <stdio.h> | 35 #include <stdio.h> |
| 36 #include <stdlib.h> | 36 #include <stdlib.h> |
| 37 #include <string.h> | 37 #include <string.h> |
| 38 | 38 |
| 39 #include "webrtc/typedefs.h" // For architecture defines | 39 #include "webrtc/typedefs.h" // For architecture defines |
| 40 | 40 |
| 41 #if defined(WEBRTC_IOS) |
| 42 // Defined in iosfileutils.mm. No header file to discourage use elsewhere. |
| 43 std::string IOSResourcePath(std::string name, std::string extension); |
| 44 #endif |
| 45 |
| 41 namespace webrtc { | 46 namespace webrtc { |
| 42 namespace test { | 47 namespace test { |
| 43 | 48 |
| 44 namespace { | 49 namespace { |
| 45 | 50 |
| 46 #ifdef WIN32 | 51 #ifdef WIN32 |
| 47 const char* kPathDelimiter = "\\"; | 52 const char* kPathDelimiter = "\\"; |
| 48 #else | 53 #else |
| 49 const char* kPathDelimiter = "/"; | 54 const char* kPathDelimiter = "/"; |
| 50 #endif | 55 #endif |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 #ifdef WIN32 | 203 #ifdef WIN32 |
| 199 return _mkdir(directory_name.c_str()) == 0; | 204 return _mkdir(directory_name.c_str()) == 0; |
| 200 #else | 205 #else |
| 201 return mkdir(directory_name.c_str(), S_IRWXU | S_IRWXG | S_IRWXO) == 0; | 206 return mkdir(directory_name.c_str(), S_IRWXU | S_IRWXG | S_IRWXO) == 0; |
| 202 #endif | 207 #endif |
| 203 } | 208 } |
| 204 return true; | 209 return true; |
| 205 } | 210 } |
| 206 | 211 |
| 207 std::string ResourcePath(std::string name, std::string extension) { | 212 std::string ResourcePath(std::string name, std::string extension) { |
| 213 #if defined (WEBRTC_IOS) |
| 214 return IOSResourcePath(name, extension); |
| 215 #endif // defined (WEBRTC_IOS) |
| 216 |
| 208 std::string platform = "win"; | 217 std::string platform = "win"; |
| 209 #ifdef WEBRTC_LINUX | 218 #ifdef WEBRTC_LINUX |
| 210 platform = "linux"; | 219 platform = "linux"; |
| 211 #endif // WEBRTC_LINUX | 220 #endif // WEBRTC_LINUX |
| 212 #ifdef WEBRTC_MAC | 221 #ifdef WEBRTC_MAC |
| 213 platform = "mac"; | 222 platform = "mac"; |
| 214 #endif // WEBRTC_MAC | 223 #endif // WEBRTC_MAC |
| 215 | 224 |
| 216 #ifdef WEBRTC_ARCH_64_BITS | 225 #ifdef WEBRTC_ARCH_64_BITS |
| 217 std::string architecture = "64"; | 226 std::string architecture = "64"; |
| (...skipping 30 matching lines...) Expand all Loading... |
| 248 if (fseek(f, 0, SEEK_END) == 0) { | 257 if (fseek(f, 0, SEEK_END) == 0) { |
| 249 size = ftell(f); | 258 size = ftell(f); |
| 250 } | 259 } |
| 251 fclose(f); | 260 fclose(f); |
| 252 } | 261 } |
| 253 return size; | 262 return size; |
| 254 } | 263 } |
| 255 | 264 |
| 256 } // namespace test | 265 } // namespace test |
| 257 } // namespace webrtc | 266 } // namespace webrtc |
| OLD | NEW |