OLD | NEW |
| (Empty) |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 // | |
5 // File compatibility routines. Useful to delete database files with. | |
6 | |
7 #ifndef CHROME_BROWSER_SYNC_UTIL_COMPAT_FILE_H_ | |
8 #define CHROME_BROWSER_SYNC_UTIL_COMPAT_FILE_H_ | |
9 | |
10 #include <fcntl.h> | |
11 #include <sys/stat.h> | |
12 #include <sys/types.h> | |
13 | |
14 #include "build/build_config.h" | |
15 #include "chrome/browser/sync/util/sync_types.h" | |
16 | |
17 extern const PathChar* const kPathSeparator; | |
18 | |
19 // Path calls for all OSes. | |
20 // Returns 0 on success, non-zero on failure. | |
21 int PathRemove(const PathString& path); | |
22 | |
23 #if defined(OS_WIN) | |
24 inline int PathRemove(const PathString& path) { | |
25 return _wremove(path.c_str()); | |
26 } | |
27 #elif (defined(OS_MACOSX) || defined(OS_LINUX)) | |
28 inline int PathRemove(const PathString& path) { | |
29 return unlink(path.c_str()); | |
30 } | |
31 #endif | |
32 | |
33 #endif // CHROME_BROWSER_SYNC_UTIL_COMPAT_FILE_H_ | |
OLD | NEW |