Pyrogenesis  13997
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Typedefs | Enumerations | Functions
vfs Namespace Reference

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 Documentation

typedef Status(* vfs::FileCallback)(const VfsPath &pathname, const CFileInfo &fileInfo, const uintptr_t cbData)

called for files in a directory.

Parameters
pathnamefull pathname (since CFileInfo only gives the name).
fileInfofile information
cbDatauser-specified context
Returns
INFO::CONTINUE on success; any other value will immediately be returned to the caller (no more calls will be forthcoming).

CAVEAT: pathname and fileInfo are only valid until the function returns!

Definition at line 49 of file vfs_util.h.

Enumeration Type Documentation

Enumerator
DIR_RECURSIVE 

Definition at line 51 of file vfs_util.h.

Function Documentation

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

Parameters
fs
path
cbSee DirCallback
cbData
patternthat file names must match. '*' and '&' wildcards are allowed. 0 matches everything.
flagsDirFlags
Returns
Status

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).

Parameters
fs
pathnameFormatFormat string for the pathname; must contain one format specifier for an integer. Example: "screenshots/screenshot%04d.png"
nextNumberin: the first number to try; out: the next number. If 0, numbers corresponding to existing files are skipped.
nextPathnamereceives the output.

Definition at line 95 of file vfs_util.cpp.