12 #ifndef SkOSFile_DEFINED
13 #define SkOSFile_DEFINED
20 kRead_SkFILE_Flag = 0x01,
21 kWrite_SkFILE_Flag = 0x02
25 const static char SkPATH_SEPARATOR =
'\\';
27 const static char SkPATH_SEPARATOR =
'/';
30 FILE* sk_fopen(
const char path[], SkFILE_Flags);
31 void sk_fclose(FILE*);
33 size_t sk_fgetsize(FILE*);
36 bool sk_frewind(FILE*);
38 size_t sk_fread(
void* buffer,
size_t byteCount, FILE*);
39 size_t sk_fwrite(
const void* buffer,
size_t byteCount, FILE*);
41 char* sk_fgets(
char* str,
int size, FILE* f);
43 void sk_fflush(FILE*);
46 bool sk_fseek(FILE*,
size_t);
47 bool sk_fmove(FILE*,
long);
48 size_t sk_ftell(FILE*);
54 void* sk_fmmap(FILE* f,
size_t* length);
60 void* sk_fdmmap(
int fd,
size_t* length);
65 void sk_fmunmap(
const void* addr,
size_t length);
68 bool sk_fidentical(FILE* a, FILE* b);
73 int sk_fileno(FILE* f);
78 bool sk_exists(
const char *path, SkFILE_Flags = (SkFILE_Flags)0);
81 bool sk_isdir(
const char *path);
90 bool sk_mkdir(
const char* path);
97 Iter(
const char path[],
const char suffix[] = NULL);
100 void reset(
const char path[],
const char suffix[] = NULL);
107 static const size_t kStorageSize = 40;
109 SkAlignedSStorage<kStorageSize> fSelf;
126 static SkString Join(
const char* rootPath,
const char* relativePath);
static SkString Dirname(const char *fullPath)
Given a qualified file name returns the directory.
Functions for modifying SkStrings which represent paths on the filesystem.
Definition: SkOSFile.h:116
static SkString Basename(const char *fullPath)
Return the name of the file, ignoring the directory structure.
Definition: SkOSFile.h:92
Definition: SkOSFile.h:94
static SkString Join(const char *rootPath, const char *relativePath)
Assembles rootPath and relativePath into a single path, like this: rootPath/relativePath.
bool next(SkString *name, bool getDir=false)
If getDir is true, only returns directories.
Light weight class for managing strings.
Definition: SkString.h:121