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 30 matching lines...) Expand all Loading... |
41 */ | 41 */ |
42 bool sk_frewind(SkFILE*); | 42 bool sk_frewind(SkFILE*); |
43 | 43 |
44 size_t sk_fread(void* buffer, size_t byteCount, SkFILE*); | 44 size_t sk_fread(void* buffer, size_t byteCount, SkFILE*); |
45 size_t sk_fwrite(const void* buffer, size_t byteCount, SkFILE*); | 45 size_t sk_fwrite(const void* buffer, size_t byteCount, SkFILE*); |
46 | 46 |
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 int sk_fseek(SkFILE*, size_t, int); | 51 bool sk_fseek(SkFILE*, size_t); |
| 52 bool sk_fmove(SkFILE*, long); |
52 size_t sk_ftell(SkFILE*); | 53 size_t sk_ftell(SkFILE*); |
53 | 54 |
| 55 /** Maps a file into memory. Returns the address and length on success, NULL oth
erwise. |
| 56 * The mapping is read only. |
| 57 */ |
| 58 void* sk_fmmap(SkFILE* f, size_t* length); |
| 59 |
| 60 /** Unmaps a file previously mapped by sk_fmmap. |
| 61 * The length parameter must be the same as returned from sk_fmmap. |
| 62 */ |
| 63 void sk_fmunmap(const void* addr, size_t length); |
| 64 |
| 65 /** Returns true if the two point at the exact same filesystem object. */ |
| 66 bool sk_fidentical(SkFILE* a, SkFILE* b); |
| 67 |
54 // Returns true if something (file, directory, ???) exists at this path. | 68 // Returns true if something (file, directory, ???) exists at this path. |
55 bool sk_exists(const char *path); | 69 bool sk_exists(const char *path); |
56 | 70 |
57 // Returns true if a directory exists at this path. | 71 // Returns true if a directory exists at this path. |
58 bool sk_isdir(const char *path); | 72 bool sk_isdir(const char *path); |
59 | 73 |
60 // Have we reached the end of the file? | 74 // Have we reached the end of the file? |
61 int sk_feof(SkFILE *); | 75 int sk_feof(SkFILE *); |
62 | 76 |
63 | 77 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 { | 113 { |
100 sk_free(fStr); | 114 sk_free(fStr); |
101 } | 115 } |
102 const uint16_t* get() const { return fStr; } | 116 const uint16_t* get() const { return fStr; } |
103 | 117 |
104 private: | 118 private: |
105 uint16_t* fStr; | 119 uint16_t* fStr; |
106 }; | 120 }; |
107 | 121 |
108 #endif | 122 #endif |
OLD | NEW |