OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2004 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 |
11 #if defined(WEBRTC_WIN) | 11 #if defined(WEBRTC_WIN) |
12 #include "webrtc/base/win32.h" | 12 #include "webrtc/base/win32.h" |
13 #include <shellapi.h> | 13 #include <shellapi.h> |
14 #include <shlobj.h> | 14 #include <shlobj.h> |
15 #include <tchar.h> | 15 #include <tchar.h> |
16 #endif // WEBRTC_WIN | 16 #endif // WEBRTC_WIN |
kwiberg-webrtc
2016/04/19 09:21:01
Your editor seems to be auto-cleaning trailing whi
kjellander_webrtc
2016/04/19 09:53:53
Well, it's just this file so I'm gonna let them be
| |
17 | 17 |
18 #include "webrtc/base/common.h" | 18 #include "webrtc/base/common.h" |
19 #include "webrtc/base/fileutils.h" | 19 #include "webrtc/base/fileutils.h" |
20 #include "webrtc/base/logging.h" | 20 #include "webrtc/base/logging.h" |
21 #include "webrtc/base/pathutils.h" | 21 #include "webrtc/base/pathutils.h" |
22 #include "webrtc/base/stringutils.h" | 22 #include "webrtc/base/stringutils.h" |
23 #include "webrtc/base/urlencode.h" | 23 #include "webrtc/base/urlencode.h" |
24 | 24 |
25 namespace rtc { | 25 namespace rtc { |
26 | 26 |
27 static const char EMPTY_STR[] = ""; | 27 static const char EMPTY_STR[] = ""; |
28 | 28 |
29 // EXT_DELIM separates a file basename from extension | 29 // EXT_DELIM separates a file basename from extension |
30 const char EXT_DELIM = '.'; | 30 const char EXT_DELIM = '.'; |
31 | 31 |
32 // FOLDER_DELIMS separate folder segments and the filename | 32 // FOLDER_DELIMS separate folder segments and the filename |
33 const char* const FOLDER_DELIMS = "/\\"; | 33 const char* const FOLDER_DELIMS = "/\\"; |
34 | 34 |
35 // DEFAULT_FOLDER_DELIM is the preferred delimiter for this platform | 35 // DEFAULT_FOLDER_DELIM is the preferred delimiter for this platform |
36 #if WEBRTC_WIN | 36 #if WEBRTC_WIN |
37 const char DEFAULT_FOLDER_DELIM = '\\'; | 37 const char DEFAULT_FOLDER_DELIM = '\\'; |
38 #else // !WEBRTC_WIN | 38 #else // !WEBRTC_WIN |
39 const char DEFAULT_FOLDER_DELIM = '/'; | 39 const char DEFAULT_FOLDER_DELIM = '/'; |
40 #endif // !WEBRTC_WIN | 40 #endif // !WEBRTC_WIN |
41 | 41 |
42 /////////////////////////////////////////////////////////////////////////////// | 42 /////////////////////////////////////////////////////////////////////////////// |
43 // Pathname - parsing of pathnames into components, and vice versa | 43 // Pathname - parsing of pathnames into components, and vice versa |
44 /////////////////////////////////////////////////////////////////////////////// | 44 /////////////////////////////////////////////////////////////////////////////// |
45 | 45 |
46 bool Pathname::IsFolderDelimiter(char ch) { | 46 bool Pathname::IsFolderDelimiter(char ch) { |
47 return (NULL != ::strchr(FOLDER_DELIMS, ch)); | 47 return (NULL != ::strchr(FOLDER_DELIMS, ch)); |
48 } | 48 } |
49 | 49 |
50 char Pathname::DefaultFolderDelimiter() { | 50 char Pathname::DefaultFolderDelimiter() { |
51 return DEFAULT_FOLDER_DELIM; | 51 return DEFAULT_FOLDER_DELIM; |
52 } | 52 } |
53 | 53 |
54 Pathname::Pathname() | 54 Pathname::Pathname() |
55 : folder_delimiter_(DEFAULT_FOLDER_DELIM) { | 55 : folder_delimiter_(DEFAULT_FOLDER_DELIM) { |
56 } | 56 } |
57 | 57 |
58 Pathname::Pathname(const Pathname&) = default; | |
59 | |
58 Pathname::Pathname(const std::string& pathname) | 60 Pathname::Pathname(const std::string& pathname) |
59 : folder_delimiter_(DEFAULT_FOLDER_DELIM) { | 61 : folder_delimiter_(DEFAULT_FOLDER_DELIM) { |
60 SetPathname(pathname); | 62 SetPathname(pathname); |
61 } | 63 } |
62 | 64 |
63 Pathname::Pathname(const std::string& folder, const std::string& filename) | 65 Pathname::Pathname(const std::string& folder, const std::string& filename) |
64 : folder_delimiter_(DEFAULT_FOLDER_DELIM) { | 66 : folder_delimiter_(DEFAULT_FOLDER_DELIM) { |
65 SetPathname(folder, filename); | 67 SetPathname(folder, filename); |
66 } | 68 } |
67 | 69 |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
243 // sanity checking | 245 // sanity checking |
244 return (isalpha(drive[0]) && | 246 return (isalpha(drive[0]) && |
245 drive[1] == ':' && | 247 drive[1] == ':' && |
246 drive[2] == '\\'); | 248 drive[2] == '\\'); |
247 } | 249 } |
248 #endif | 250 #endif |
249 | 251 |
250 /////////////////////////////////////////////////////////////////////////////// | 252 /////////////////////////////////////////////////////////////////////////////// |
251 | 253 |
252 } // namespace rtc | 254 } // namespace rtc |
OLD | NEW |