![]() |
Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
|
Typedefs | |
| typedef Status(* | FileCallback) (const VfsPath &pathname, const CFileInfo &fileInfo, const uintptr_t cbData) |
| called for files in a directory. More... | |
| typedef Status(* | DirCallback) (const VfsPath &pathname, const uintptr_t cbData) |
| called for directories 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, DirCallback dircb=NULL, uintptr_t dircbData=0) |
| call back for each file in a directory tree, and optionally each directory. More... | |
| void | NextNumberedFilename (const PIVFS &fs, const VfsPath &pathnameFormat, size_t &nextNumber, VfsPath &nextPathname) |
| Determine the next available pathname with a given format. More... | |
called for directories in a directory.
| pathname | full pathname |
| cbData | user-specified context |
CAVEAT: pathname only valid until the function returns!
| 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!
| enum vfs::DirFlags |
| Status vfs::ForEachFile | ( | const PIVFS & | fs, |
| const VfsPath & | path, | ||
| FileCallback | cb, | ||
| uintptr_t | cbData, | ||
| const wchar_t * | pattern = 0, |
||
| size_t | flags = 0, |
||
| DirCallback | dircb = NULL, |
||
| uintptr_t | dircbData = 0 |
||
| ) |
call back for each file in a directory tree, and optionally each directory.
| fs | |
| path | |
| cb | FileCallback |
| cbData | |
| pattern | that file names must match. '*' and '&' wildcards are allowed. 0 matches everything. |
| flags | DirFlags |
| dircb | DirCallback |
| dircbData |
| Status vfs::GetPathnames | ( | const PIVFS & | fs, |
| const VfsPath & | path, | ||
| const wchar_t * | filter, | ||
| VfsPaths & | pathnames | ||
| ) |
| 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. |