Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
p6dir.h
Go to the documentation of this file.
1 
9 #if !defined(P6DIR_H__)
10 #define P6DIR_H__ 1
11 
12 #include "p6filetypes.h"
13 #include "p6random.h"
14 
15 namespace P6R {
16 
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20 
30 {
31  P6COMMETHOD next(P6R::P6UINT32 cElements,P6R::P6DIRENT *parElements,P6R::P6UINT32 *pcReturned) = 0;
32  P6COMMETHOD reset() = 0;
33 };
34 
35 // {8D5B1742-F0B9-498A-BE9B-C26E32C482DD}
36 #define IF_p6IEnumDirents {0x8D5B1742,0xF0B9,0x498A,{0xBE,0x9B,0xC2,0x6E,0x32,0xC4,0x82,0xDD}}
37 
45 interface p6IDir : p6ICom
46 {
57  P6COMMETHOD initialize() = 0;
58 
59 
82  P6COMMETHOD enumerate(const P6R::P6WCHAR *pszDirectory,P6R::P6DIRFLAGS fFlags,P6R::p6IEnumDirents **ppEnum) = 0;
83 
102  P6COMMETHOD stat(const P6R::P6WCHAR *pszFilename,P6R::P6DIRENT *pDirent) = 0;
103 
122  P6COMMETHOD access(const P6R::P6WCHAR *pszFilename,P6R::P6FACCESS nAccess) = 0;
123 
138  P6COMMETHOD rename(const P6R::P6WCHAR *pszFrom,const P6R::P6WCHAR *pszTo) = 0;
139 
154  P6COMMETHOD unlink(const P6R::P6WCHAR *pszPathname) = 0;
155 
174  P6COMMETHOD mkdir(const P6R::P6WCHAR *pszPathname,P6R::P6FILEMODE nMode) = 0;
175 
194  P6COMMETHOD mkpath(const P6R::P6WCHAR *pszPathname,P6R::P6FILEMODE nMode) = 0;
195 
196 
211  P6COMMETHOD rmdir(const P6R::P6WCHAR *pszPathname) = 0;
212 
226  P6COMMETHOD rmpath(const P6R::P6WCHAR *pszPathname) = 0;
227 
247  P6COMMETHOD normalizePath(P6R::P6WCHAR *pszFilename) = 0;
248 
270  P6COMMETHOD appendPathElement(P6R::P6WCHAR *pBuffer,P6R::P6SIZE cBuffer,const P6R::P6WCHAR *pszElement,P6R::P6SIZE *pcWritten) = 0;
271 
292  P6COMMETHOD getTempDir(P6R::P6WCHAR *pBuffer,P6R::P6UINT32 cBuffer) = 0;
293 
324  P6COMMETHOD getTempFile(P6R::p6IRandom *pRandom,P6R::P6WCHAR *pBuffer,P6R::P6UINT32 cBuffer) = 0;
325 };
326 
327 // {15E33328-C34D-431B-9804-3588EAF3D89E}
328 #define IF_p6IDir {0x15E33328,0xC34D,0x431B,{0x98,0x04,0x35,0x88,0xEA,0xF3,0xD8,0x9E}}
329 
330 // {272B33A1-5325-4874-B0C3-93FAD7FA4C5D}
331 #define COMP_p6Dir {0x272B33A1,0x5325,0x4874,{0xB0,0xC3,0x93,0xFA,0xD7,0xFA,0x4C,0x5D}}
332 
333 #ifdef __cplusplus
334 }
335 #endif
336 
337 } // namespace
338 
339 #endif
340 
virtual P6R::P6ERR getTempFile(P6R::p6IRandom *pRandom, P6R::P6WCHAR *pBuffer, P6R::P6UINT32 cBuffer)=0
Generate a temporary filename and return the name and temp path.
virtual P6R::P6ERR enumerate(const P6R::P6WCHAR *pszDirectory, P6R::P6DIRFLAGS fFlags, P6R::p6IEnumDirents **ppEnum)=0
This methods returns an enumerator which is used to iterate through directory entries for the specifi...
size_t P6SIZE
Definition: p6types.h:62
unsigned int P6UINT32
Definition: p6types.h:40
virtual P6R::P6ERR rmdir(const P6R::P6WCHAR *pszPathname)=0
Removes the specified directory.
virtual P6R::P6ERR reset()=0
virtual P6R::P6ERR next(P6R::P6UINT32 cElements, P6R::P6DIRENT *parElements, P6R::P6UINT32 *pcReturned)=0
An interface for the management of file system directory entries.
Definition: p6dir.h:45
Used to describe a directory entry by various methods such as p6IDir::stat() and p6IDir::enumerate()...
Definition: p6filetypes.h:206
virtual P6R::P6ERR appendPathElement(P6R::P6WCHAR *pBuffer, P6R::P6SIZE cBuffer, const P6R::P6WCHAR *pszElement, P6R::P6SIZE *pcWritten)=0
Appends a path element to a file system path, automatically appending a path separator if needed...
virtual P6R::P6ERR mkpath(const P6R::P6WCHAR *pszPathname, P6R::P6FILEMODE nMode)=0
Creates a the specified directory path, creating any need path elements.
[p6]COM Cryptographic Random Number Generator.
File and directory type definitions.
virtual P6R::P6ERR access(const P6R::P6WCHAR *pszFilename, P6R::P6FACCESS nAccess)=0
Determines what type of access (READ/WRITE) is allowed to the specified file/path from the current pr...
wchar_t P6WCHAR
Wide character type see p6i18n.h.
Definition: p6types.h:76
virtual P6R::P6ERR normalizePath(P6R::P6WCHAR *pszFilename)=0
This methods is used to normalize the specified pathname in place.
The base interface all [p6]COM components must derive from and implement.
Definition: p6comdef.h:96
Provides a cryptographically strong random number generator.
Definition: p6random.h:70
virtual P6R::P6ERR unlink(const P6R::P6WCHAR *pszPathname)=0
Delete the specified file.
virtual P6R::P6ERR getTempDir(P6R::P6WCHAR *pBuffer, P6R::P6UINT32 cBuffer)=0
Get the system temp directory.
P6UINT32 P6FACCESS
Describes the type containing the possible values for access to a filesystem resource.
Definition: p6filetypes.h:113
This interface is used to enumerate diretory entries.
Definition: p6dir.h:29
virtual P6R::P6ERR initialize()=0
Initializes the component for use.
#define P6COMMETHOD
Definition: p6types.h:872
P6UINT32 P6FILEMODE
Definition: p6filetypes.h:74
virtual P6R::P6ERR rename(const P6R::P6WCHAR *pszFrom, const P6R::P6WCHAR *pszTo)=0
Rename or move files and directories in the same directory or across directories. ...
virtual P6R::P6ERR stat(const P6R::P6WCHAR *pszFilename, P6R::P6DIRENT *pDirent)=0
This methods returns information about the specified file/path.
virtual P6R::P6ERR rmpath(const P6R::P6WCHAR *pszPathname)=0
Removes the specified directory and all its contents.
P6UINT32 P6DIRFLAGS
Defines a type which describes the control flags for use with the p6IDir::enumerate() method to contr...
Definition: p6filetypes.h:148
virtual P6R::P6ERR mkdir(const P6R::P6WCHAR *pszPathname, P6R::P6FILEMODE nMode)=0
Creates a new directory.