OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2006 The Android Open Source Project | 3 * Copyright 2006 The Android Open Source Project |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 | 9 |
10 // TODO: add unittests for all these operations | 10 // TODO: add unittests for all these operations |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 void sk_fmunmap(const void* addr, size_t length); | 70 void sk_fmunmap(const void* addr, size_t length); |
71 | 71 |
72 /** Returns true if the two point at the exact same filesystem object. */ | 72 /** Returns true if the two point at the exact same filesystem object. */ |
73 bool sk_fidentical(SkFILE* a, SkFILE* b); | 73 bool sk_fidentical(SkFILE* a, SkFILE* b); |
74 | 74 |
75 /** Returns the underlying file descriptor for the given file. | 75 /** Returns the underlying file descriptor for the given file. |
76 * The return value will be < 0 on failure. | 76 * The return value will be < 0 on failure. |
77 */ | 77 */ |
78 int sk_fileno(SkFILE* f); | 78 int sk_fileno(SkFILE* f); |
79 | 79 |
80 // Returns true if something (file, directory, ???) exists at this path. | 80 /** Returns true if something (file, directory, ???) exists at this path, |
81 bool sk_exists(const char *path); | 81 * and has the specified access flags. |
| 82 */ |
| 83 bool sk_exists(const char *path, SkFILE_Flags = (SkFILE_Flags)0); |
82 | 84 |
83 // Returns true if a directory exists at this path. | 85 // Returns true if a directory exists at this path. |
84 bool sk_isdir(const char *path); | 86 bool sk_isdir(const char *path); |
85 | 87 |
86 // Have we reached the end of the file? | 88 // Have we reached the end of the file? |
87 int sk_feof(SkFILE *); | 89 int sk_feof(SkFILE *); |
88 | 90 |
89 | 91 |
90 // Create a new directory at this path; returns true if successful. | 92 // Create a new directory at this path; returns true if successful. |
91 // If the directory already existed, this will return true. | 93 // If the directory already existed, this will return true. |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 * Return the name of the file, ignoring the directory structure. | 139 * Return the name of the file, ignoring the directory structure. |
138 * Behaves like python's os.path.basename. If the fullPath is | 140 * Behaves like python's os.path.basename. If the fullPath is |
139 * /dir/subdir/, an empty string is returned. | 141 * /dir/subdir/, an empty string is returned. |
140 * @param fullPath Full path to the file. | 142 * @param fullPath Full path to the file. |
141 * @return SkString The basename of the file - anything beyond the | 143 * @return SkString The basename of the file - anything beyond the |
142 * final slash, or the full name if there is no slash. | 144 * final slash, or the full name if there is no slash. |
143 */ | 145 */ |
144 static SkString SkBasename(const char* fullPath); | 146 static SkString SkBasename(const char* fullPath); |
145 }; | 147 }; |
146 #endif | 148 #endif |
OLD | NEW |