OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "webkit/fileapi/file_system_util.h" | 5 #include "webkit/fileapi/file_system_util.h" |
6 | 6 |
7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
8 | 8 |
9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 case kFileSystemTypePersistent: | 217 case kFileSystemTypePersistent: |
218 return fileapi::kPersistentName; | 218 return fileapi::kPersistentName; |
219 case kFileSystemTypeExternal: | 219 case kFileSystemTypeExternal: |
220 return fileapi::kExternalName; | 220 return fileapi::kExternalName; |
221 case kFileSystemTypeUnknown: | 221 case kFileSystemTypeUnknown: |
222 default: | 222 default: |
223 return std::string(); | 223 return std::string(); |
224 } | 224 } |
225 } | 225 } |
226 | 226 |
| 227 std::string FilePathToString(const FilePath& file_path) { |
| 228 #if defined(OS_WIN) |
| 229 return UTF16ToUTF8(file_path.value()); |
| 230 #elif defined(OS_POSIX) |
| 231 return file_path.value(); |
| 232 #endif |
| 233 } |
| 234 |
| 235 FilePath StringToFilePath(const std::string& file_path_string) { |
| 236 #if defined(OS_WIN) |
| 237 return FilePath(UTF8ToUTF16(file_path_string)); |
| 238 #elif defined(OS_POSIX) |
| 239 return FilePath(file_path_string); |
| 240 #endif |
| 241 } |
| 242 |
227 } // namespace fileapi | 243 } // namespace fileapi |
OLD | NEW |