Pyrogenesis
13997
|
Typedefs | |
typedef Status(* | FileCallback )(const VfsPath &pathname, const CFileInfo &fileInfo, const uintptr_t cbData) |
called for files in a directory. More... | |
Enumerations | |
enum | DirFlags { DIR_RECURSIVE = 1 } |
Functions | |
Status | GetPathnames (const PIVFS &fs, const VfsPath &path, const wchar_t *filter, VfsPaths &pathnames) |
Status | ForEachFile (const PIVFS &fs, const VfsPath &path, FileCallback cb, uintptr_t cbData, const wchar_t *pattern=0, size_t flags=0) |
call back for each file in a directory tree More... | |
void | NextNumberedFilename (const PIVFS &fs, const VfsPath &pathnameFormat, size_t &nextNumber, VfsPath &nextPathname) |
Determine the next available pathname with a given format. More... | |
typedef Status(* vfs::FileCallback)(const VfsPath &pathname, const CFileInfo &fileInfo, const uintptr_t cbData) |
called for files in a directory.
pathname | full pathname (since CFileInfo only gives the name). |
fileInfo | file information |
cbData | user-specified context |
CAVEAT: pathname and fileInfo are only valid until the function returns!
Definition at line 49 of file vfs_util.h.
enum vfs::DirFlags |
Enumerator | |
---|---|
DIR_RECURSIVE |
Definition at line 51 of file vfs_util.h.
Status vfs::ForEachFile | ( | const PIVFS & | fs, |
const VfsPath & | path, | ||
FileCallback | cb, | ||
uintptr_t | cbData, | ||
const wchar_t * | pattern = 0 , |
||
size_t | flags = 0 |
||
) |
call back for each file in a directory tree
fs | |
path | |
cb | See DirCallback |
cbData | |
pattern | that file names must match. '*' and '&' wildcards are allowed. 0 matches everything. |
flags | DirFlags |
Definition at line 58 of file vfs_util.cpp.
Status vfs::GetPathnames | ( | const PIVFS & | fs, |
const VfsPath & | path, | ||
const wchar_t * | filter, | ||
VfsPaths & | pathnames | ||
) |
Definition at line 40 of file vfs_util.cpp.
void vfs::NextNumberedFilename | ( | const PIVFS & | fs, |
const VfsPath & | pathnameFormat, | ||
size_t & | nextNumber, | ||
VfsPath & | nextPathname | ||
) |
Determine the next available pathname with a given format.
This is useful when creating new files without overwriting the previous ones (screenshots are a good example).
fs | |
pathnameFormat | Format string for the pathname; must contain one format specifier for an integer. Example: "screenshots/screenshot%04d.png" |
nextNumber | in: the first number to try; out: the next number. If 0, numbers corresponding to existing files are skipped. |
nextPathname | receives the output. |
Definition at line 95 of file vfs_util.cpp.