Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(182)

Side by Side Diff: include/core/SkOSFile.h

Issue 15941025: Add SkData::NewFromFD. (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Remove an indentation level. Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « include/core/SkData.h ('k') | include/core/SkTemplates.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 char* sk_fgets(char* str, int size, SkFILE* f); 47 char* sk_fgets(char* str, int size, SkFILE* f);
48 48
49 void sk_fflush(SkFILE*); 49 void sk_fflush(SkFILE*);
50 50
51 bool sk_fseek(SkFILE*, size_t); 51 bool sk_fseek(SkFILE*, size_t);
52 bool sk_fmove(SkFILE*, long); 52 bool sk_fmove(SkFILE*, long);
53 size_t sk_ftell(SkFILE*); 53 size_t sk_ftell(SkFILE*);
54 54
55 /** Maps a file into memory. Returns the address and length on success, NULL oth erwise. 55 /** Maps a file into memory. Returns the address and length on success, NULL oth erwise.
56 * The mapping is read only. 56 * The mapping is read only.
57 * When finished with the mapping, free the returned pointer with sk_fmunmap.
57 */ 58 */
58 void* sk_fmmap(SkFILE* f, size_t* length); 59 void* sk_fmmap(SkFILE* f, size_t* length);
59 60
60 /** Unmaps a file previously mapped by sk_fmmap. 61 /** Maps a file descriptor into memory. Returns the address and length on succes s, NULL otherwise.
62 * The mapping is read only.
63 * When finished with the mapping, free the returned pointer with sk_fmunmap.
64 */
65 void* sk_fdmmap(int fd, size_t* length);
66
67 /** Unmaps a file previously mapped by sk_fmmap or sk_fdmmap.
61 * The length parameter must be the same as returned from sk_fmmap. 68 * The length parameter must be the same as returned from sk_fmmap.
62 */ 69 */
63 void sk_fmunmap(const void* addr, size_t length); 70 void sk_fmunmap(const void* addr, size_t length);
64 71
65 /** 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. */
66 bool sk_fidentical(SkFILE* a, SkFILE* b); 73 bool sk_fidentical(SkFILE* a, SkFILE* b);
67 74
75 /** Returns the underlying file descriptor for the given file.
76 * The return value will be < 0 on failure.
77 */
78 int sk_fileno(SkFILE* f);
79
68 // Returns true if something (file, directory, ???) exists at this path. 80 // Returns true if something (file, directory, ???) exists at this path.
69 bool sk_exists(const char *path); 81 bool sk_exists(const char *path);
70 82
71 // Returns true if a directory exists at this path. 83 // Returns true if a directory exists at this path.
72 bool sk_isdir(const char *path); 84 bool sk_isdir(const char *path);
73 85
74 // Have we reached the end of the file? 86 // Have we reached the end of the file?
75 int sk_feof(SkFILE *); 87 int sk_feof(SkFILE *);
76 88
77 89
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 * Return the name of the file, ignoring the directory structure. 148 * Return the name of the file, ignoring the directory structure.
137 * Behaves like python's os.path.basename. If the fullPath is 149 * Behaves like python's os.path.basename. If the fullPath is
138 * /dir/subdir/, an empty string is returned. 150 * /dir/subdir/, an empty string is returned.
139 * @param fullPath Full path to the file. 151 * @param fullPath Full path to the file.
140 * @return SkString The basename of the file - anything beyond the 152 * @return SkString The basename of the file - anything beyond the
141 * final slash, or the full name if there is no slash. 153 * final slash, or the full name if there is no slash.
142 */ 154 */
143 static SkString SkBasename(const char* fullPath); 155 static SkString SkBasename(const char* fullPath);
144 }; 156 };
145 #endif 157 #endif
OLDNEW
« no previous file with comments | « include/core/SkData.h ('k') | include/core/SkTemplates.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698