SophiaFramework UNIVERSE 5.3 |
BREW 2.0 | BREW 2.1 | BREW 3.1 | BREW 4.0 |
---|---|---|---|
O | O | O | O |
Public Functions | |
---|---|
SFCError |
CheckPathAccess(
ACharConstPtr path
, UInt32 desiredRights
, UInt32Ptr actualRights
) Check whether the caller has certain rights on the input path.
|
SFCError |
CheckPathAccess(
SFXAnsiStringConstRef path
, UInt32 desiredRights
, UInt32Ptr actualRights
) Check whether the caller has certain rights on the input path.
|
SFCError |
EnumInit(
ACharConstPtr dirName
, Bool dir = false
)
Initialize the SFBFileMgr Interface object for the enumeration of the files/directories in the specified directory.
|
SFCError |
EnumInit(
SFXAnsiStringConstRef dirName
, Bool dir = false
)
Initialize the SFBFileMgr Interface object for the enumeration of the files/directories in the specified directory.
|
Bool |
EnumNext(
AEEFileInfoPtr info
) Return file information for the next file/directory.
|
Bool |
EnumNextEx(
AEEFileInfoExPtr infoEx
) Return extended file information for the next file/directory.
|
SFCError |
GetFileUseInfo(
AEEFileUseInfoPtr useInfo
) Get the file usage infomation for the module.
|
AEEFileUseInfo |
GetFileUseInfo( Void ) Get the file usage infomation for the module.
|
UInt32 |
GetFreeSpace(
UInt32Ptr total = null
)
Get the number of free bytes currently available on file system.
|
SFCError |
GetFreeSpaceEx(
ACharConstPtr path
, UInt32Ptr total
, UInt32Ptr free
) Get the number of free bytes currently available on file system.
|
SFCError |
GetFreeSpaceEx(
SFXAnsiStringConstRef path
, UInt32Ptr total
, UInt32Ptr free
) Get the number of free bytes currently available on file system.
|
SFCError |
GetInfo(
ACharConstPtr fileName
, AEEFileInfoPtr info
) Get the information on a file identified by a file name.
|
SFCError |
GetInfo(
SFXAnsiStringConstRef fileName
, AEEFileInfoPtr info
) Get the information on a file identified by a file name.
|
AEEFileInfo |
GetInfo(
SFXAnsiStringConstRef fileName
) Get the information on a file identified by a file name.
|
SFCError |
GetInfoEx(
ACharConstPtr fileName
, AEEFileInfoExPtr infoEx
) Get the extended information of a file identified by a file name.
|
SFCError |
GetInfoEx(
SFXAnsiStringConstRef fileName
, AEEFileInfoExPtr infoEx
) Get the extended information of a file identified by a file name.
|
SFCError |
GetLastError( Void )
Get the reason for the failure when a file operation performed by the applet has failed.
|
SFCError |
MkDir(
ACharConstPtr dirName
)
Create a directory, specified by a directory name.
|
SFCError |
MkDir(
SFXAnsiStringConstRef dirName
)
Create a directory, specified by a directory name.
|
static SFBFileMgrSmp |
NewInstance(
SFCErrorPtr exception = null
)
Create a new SFBFileMgr instance.
|
static SFBFileMgrSmp |
NewInstance(
AEECLSID id
, SFCErrorPtr exception = null
)
Create a new SFBFileMgr instance.
|
SFBFileSmp |
OpenFile(
ACharConstPtr fileName
, AEEOpenFileMode mode
)
Open a file in specified mode.
|
SFBFileSmp |
OpenFile(
SFXAnsiStringConstRef fileName
, AEEOpenFileMode mode
)
Open a file in specified mode.
|
SFCError |
Remove(
ACharConstPtr fileName
)
Remove a file identified by a given filename.
|
SFCError |
Remove(
SFXAnsiStringConstRef fileName
)
Remove a file identified by a given filename.
|
SFCError |
Rename(
ACharConstPtr srcFileName
, ACharConstPtr destFileName
)
Rename the file from the source name to the destination name.
|
SFCError |
Rename(
SFXAnsiStringConstRef srcFileName
, SFXAnsiStringConstRef destFileName
)
Rename the file from the source name to the destination name.
|
SFCError |
ResolvePath(
ACharConstPtr path
, ACharPtr canonicalPath
, UInt32Ptr canonicalPathLen
) Resolve a filesystem path to the BREW canonical form.
|
SFCError |
ResolvePath(
SFXAnsiStringConstRef path
, SFXAnsiStringPtr canonicalPath
) Resolve a filesystem path to the BREW canonical form.
|
SFCError |
RmDir(
ACharConstPtr dirName
)
Remove a directory identified by a given directory name.
|
SFCError |
RmDir(
SFXAnsiStringConstRef dirName
)
Remove a directory identified by a given directory name.
|
SFCError |
SetDescription(
ACharConstPtr fileName
, WCharPtr description
)
Set the file description that is part of the extended file information.
|
SFCError |
SetDescription(
SFXAnsiStringConstRef fileName
, SFXWideStringPtr description
)
Set the file description that is part of the extended file information.
|
SFCError |
Test(
ACharConstPtr name
)
Test if the specified file/directory exists.
|
SFCError |
Test(
SFXAnsiStringConstRef name
)
Test if the specified file/directory exists.
|
SFCError |
UnUse(
ACharConstPtr fileName
)
Remove the class ID of the calling app
from the list of classes using the specified file.
|
SFCError |
UnUse(
SFXAnsiStringConstRef fileName
)
Remove the class ID of the calling app
from the list of classes using the specified file.
|
SFCError |
Use(
ACharConstPtr fileName
)
Add class ID of the calling app to the list of classes
using the specified file.
|
SFCError |
Use(
SFXAnsiStringConstRef fileName
)
Add class ID of the calling app to the list of classes
using the specified file.
|
Protected Functions | |
---|---|
static SFBBaseSmp |
FactoryByCreate(
AEECLSID id
, SFCErrorPtr exception = null
)
(inherits from SFBBase)
Create the instance for the specified ClassID's interface.
|
static SFBBaseSmp |
FactoryByQuery(
SFBQuerySmpConstRef query
, AEECLSID id
, SFCErrorPtr exception = null
)
(inherits from SFBBase)
Create the instance for the specified ClassID's interface using the SFBQuery instance.
|
[ public ] SFCError CheckPathAccess( ACharConstPtr path // the path to be checked UInt32 desiredRights // the desired rights UInt32Ptr actualRights // filled with the actual rights, ignored if null );
[ public ] SFCError CheckPathAccess( SFXAnsiStringConstRef path // the path to be checked UInt32 desiredRights // the desired rights UInt32Ptr actualRights // filled with the actual rights, ignored if null );
A bitwise-or of the following.
Introduced BREW Client 3.1
BREW API IFILEMGR_CheckPathAccess | BREW API IFILEMGR_ResolvePath | BREW API IFILEMGR_CheckPrivLevel | SFBFileMgr::ResolvePath | SFBShell::CheckPrivLevel
[ public ] SFCError EnumInit( ACharConstPtr dirName // null terminated string containing the root directory name Bool dir = false // when true, enumerate directories );
[ public ] SFCError EnumInit( SFXAnsiStringConstRef dirName // null terminated string containing the root directory name Bool dir = false // when true, enumerate directories );
[ public ] Bool EnumNext( AEEFileInfoPtr info // placeholder for file information );
Get file information for the next file, show file name as logs.
SFBFileMgrSmp fileMgr = SFBFileMgr::NewInstance(); FileInfo info = {0}; // initializing for the enumeration of the files. if (fileMgr->EnumInit("new_dir", false) == SUCCESS) { // get the information of next file. fileMgr->EnumNext(&info); // show file name in the log. DBGPRINTF("file name : %s", info.szName); }
BREW API IFILEMGR_EnumNext | SFBFileMgr::EnumInit | FileInfo
[ public ] Bool EnumNextEx( AEEFileInfoExPtr infoEx // placeholder for extended file information );
Get file extended information for the next file, show file name as logs.
SFBFileMgrSmp fileMgr = SFBFileMgr::NewInstance(); AEEFileInfoEx infoEx = {0}; AChar fileName[128] = {0}; WChar description[128] = {0}; AEECLSID cls[32] = {0}; // initializing for the enumeration of the files. if (fileMgr->EnumInit("new_dir", false) == SUCCESS) { // initializing the AEEFileInfoEx structure. infoEx.nStructSize = sizeof(AEEFileInfoEx); infoEx.pszFile = fileName; infoEx.nMaxFile = 128; infoEx.pszDescription = description; infoEx.nDescriptionSize = 128 * sizeof(WChar); infoEx.pClasses = cls; infoEx.nClassesSize = 32 * sizeof(AEECLSID); // get the extended information of next file. fileMgr->EnumNextEx(&infoEx); // show file name in the log. DBGPRINTF("file name : %s", infoEx.pszFile); }
BREW API IFILEMGR_EnumNextEx | SFBFileMgr::EnumInit | AEEFileInfoEx
[ public ] SFCError GetFileUseInfo( AEEFileUseInfoPtr useInfo // placeholder for file usage information );
[ public ] AEEFileUseInfo GetFileUseInfo(Void);
Get the file usage infomation.
SFBFileMgrSmp fileMgr = SFBFileMgr::NewInstance(); AEEFileUseInfo info = {0}; // get the file usage infomation. fileMgr->GetFileUseInfo(&info);
[ public ] UInt32 GetFreeSpace( UInt32Ptr total = null // placeholder for the total room in the file system );
[ public ] SFCError GetFreeSpaceEx( ACharConstPtr path // pointer a path string that specifies the file system whose space details are required UInt32Ptr total // placeholder for the total room in the file system UInt32Ptr free // placeholder for the available space in the file system );
[ public ] SFCError GetFreeSpaceEx( SFXAnsiStringConstRef path // a path string that specifies the file system whose space details are required UInt32Ptr total // placeholder for the total room in the file system UInt32Ptr free // placeholder for the available space in the file system );
Introduced BREW Client 3.1.3
[ public ] SFCError GetInfo( ACharConstPtr fileName // null terminated string containing the file name AEEFileInfoPtr info // placeholder for file information );
[ public ] SFCError GetInfo( SFXAnsiStringConstRef fileName // null terminated string containing the file name AEEFileInfoPtr info // placeholder for file information );
[ public ] AEEFileInfo GetInfo( SFXAnsiStringConstRef fileName // null terminated string containing the file name );
Get the information of a file.
SFBFileMgrSmp fileMgr = SFBFileMgr::NewInstance(); FileInfo info = {0}; // get the information of a file. fileMgr->GetInfo("sample.txt", &info);
[ public ] SFCError GetInfoEx( ACharConstPtr fileName // null terminated string containing a file name AEEFileInfoExPtr infoEx // placeholder for extended file information );
[ public ] SFCError GetInfoEx( SFXAnsiStringConstRef fileName // null terminated string containing a file name AEEFileInfoExPtr infoEx // placeholder for extended file information );
Get the extended information of a file.
SFBFileMgrSmp fileMgr = SFBFileMgr::NewInstance(); AEEFileInfoEx infoEx = {0}; AChar fileName[128] = {0}; WChar description[128] = {0}; AEECLSID cls[32] = {0}; // initialize the AEEFileInfoEx structure. infoEx.nStructSize = sizeof(AEEFileInfoEx); infoEx.pszFile = fileName; infoEx.nMaxFile = 128; infoEx.pszDescription = description; infoEx.nDescriptionSize = 128 * sizeof(WChar); infoEx.pClasses = cls; infoEx.nClassesSize = 32 * sizeof(AEECLSID); // get the extended information of a file. fileMgr->GetInfoEx("sample.txt", &infoEx);
BREW API IFILEMGR_GetInfoEx | AEEFileInfoEx | SFBFile::GetInfoEx
[ public ] SFCError GetLastError(Void);
[ public ] SFCError MkDir( ACharConstPtr dirName // null terminated string containing a directory name );
[ public ] SFCError MkDir( SFXAnsiStringConstRef dirName // null terminated string containing a directory name );
Create a directory.
SFBFileMgrSmp fileMgr = SFBFileMgr::NewInstance(); // create a directory. fileMgr->MkDir("new_dir");
[ public, static ] SFBFileMgrSmp NewInstance( SFCErrorPtr exception = null // Error );
[ public, static ] SFBFileMgrSmp NewInstance( AEECLSID id // Class ID SFCErrorPtr exception = null // Error );
[ public ] SFBFileSmp OpenFile( ACharConstPtr fileName // null terminated string containing the file name AEEOpenFileMode mode // file open mode );
[ public ] SFBFileSmp OpenFile( SFXAnsiStringConstRef fileName // null terminated string containing the file name AEEOpenFileMode mode // file open mode );
Create a file.
SFBFileMgrSmp fileMgr = SFBFileMgr::NewInstance(); SFBFileSmp file; // create a file. file = fileMgr->OpenFile("sample.txt",_OFM_CREATE); if (file != null) { // if use SophiaFramework Smart Pointer ( SFXBrewPointer ), // the close of file will be automatically done. // if users want to close a file manually, use // // file.Release(); }
[ public ] SFCError Remove( ACharConstPtr fileName // null terminated string containing the name of the file to to be removed );
[ public ] SFCError Remove( SFXAnsiStringConstRef fileName // null terminated string containing the name of the file to to be removed );
Remove a file.
SFBFileMgrSmp fileMgr = SFBFileMgr::NewInstance(); // remove a file. fileMgr->Remove("sample.txt");
[ public ] SFCError Rename( ACharConstPtr srcFileName // source file to be renamed ACharConstPtr destFileName // destination file );
[ public ] SFCError Rename( SFXAnsiStringConstRef srcFileName // source file to be renamed SFXAnsiStringConstRef destFileName // destination file );
Rename a directory.
SFBFileMgrSmp fileMgr = SFBFileMgr::NewInstance(); // rename a directory. fileMgr->Rename("tmp_dir","new_dir");
[ public ] SFCError ResolvePath( ACharConstPtr path // the path to be resolved ACharPtr canonicalPath // the output buffer, holds the canonical path, may be null UInt32Ptr canonicalPathLen // On entry, this provides the maximum number of bytes to write into pszOut[]. On exit, this holds the number of bytes written to pszOut[]. );
[ public ] SFCError ResolvePath( SFXAnsiStringConstRef path // the path to be resolved SFXAnsiStringPtr canonicalPath // the output buffer, holds the canonical path );
Introduced BREW Client 3.1
[ public ] SFCError RmDir( ACharConstPtr dirName // null terminated string containing a directory name );
[ public ] SFCError RmDir( SFXAnsiStringConstRef dirName // null terminated string containing a directory name );
Remove a directory.
SFBFileMgrSmp fileMgr = SFBFileMgr::NewInstance(); // remove a directory. fileMgr->RmDir("tmp_dir");
[ public ] SFCError SetDescription( ACharConstPtr fileName // null terminated string containing a file name WCharPtr description // wide character string containing the description );
[ public ] SFCError SetDescription( SFXAnsiStringConstRef fileName // null terminated string containing a file name SFXWideStringPtr description // wide character string containing the description );
Set the file description
SFBFileMgrSmp fileMgr = SFBFileMgr::NewInstance(); SFXWideString description("Sample File"); // set the file description fileMgr->SetDescription("sample.txt", &description);
[ public ] SFCError Test( ACharConstPtr name // null terminated string containing file/directory name );
[ public ] SFCError Test( SFXAnsiStringConstRef name // null terminated string containing file/directory name );
Check if a file exists.
SFBFileMgrSmp fileMgr = SFBFileMgr::NewInstance(); // check if a file exists. if (fileMgr->Test("sample.txt") == SUCCESS ) { // something to do if a file exists. // ... // ... // ... }
[ public ] SFCError UnUse( ACharConstPtr fileName // null terminated string containing a file name );
[ public ] SFCError UnUse( SFXAnsiStringConstRef fileName // null terminated string containing a file name );
The specified file will be deleted when the last app indicates that the file is no longer used or SFBFileMgr::Remove is called.
BREW API IFILEMGR_UnUse | SFBFileMgr::Use | SFBFileMgr::GetInfoEx | AEEFileInfoEx
[ public ] SFCError Use( ACharConstPtr fileName // null terminated string containing a file name );
[ public ] SFCError Use( SFXAnsiStringConstRef fileName // null terminated string containing a file name );
The specified file will not be deleted until the last app indicates that the file is no longer used or SFBFileMgr::Remove is called.
BREW API IFILEMGR_Use | SFBFileMgr::UnUse | SFBFileMgr::GetInfoEx | AEEFileInfoEx
Copyright(c) 2002 - 2024 Sophia Cradle Incorporated All Rights Reserved. |