Guiliani  Version 2.6 revision 7293 (documentation build 12)
CGUIFileSysWrapWin Class Reference

Implementation of CGUIFileSysWrap class for Windows systems. More...

#include <GUIFileSysWrapWin.h>

Inheritance diagram for CGUIFileSysWrapWin:

Public Member Functions

 CGUIFileSysWrapWin ()
 
 ~CGUIFileSysWrapWin ()
 
virtual eC_Bool CheckIfDirectoryExists (const eC_String &kPath) const
 
virtual eC_Bool CheckIfFileExists (const eC_String &kPath) const
 
virtual eC_Bool CheckIfFileOrDirectoryExists (const eC_String &kPath) const
 
virtual eC_Bool CpFile (eC_String kSource, eC_String kDest, eC_Bool bOverwrite=false, eC_Bool bCopyEvenIfIdentical=true)
 
virtual CGUIDirectoryDirAlloc (const eC_String &kPath, const CGUIDirectory::StringList_t &kNameFilter, eC_UInt uiFilter=CGUIDirectory::ALL, CGUIDirectory::SortFlag_t eSort=CGUIDirectory::NAME, eC_Bool bCaseInsensitive=true) const
 
virtual CGUIDirectoryDirAlloc (const eC_String &kPath="", const eC_String &kNameFilter="") const
 
virtual const eC_String & GetDirSeparator () const
 
virtual const CGUIDirInfo::DirInfoPtrList_tGetDrives ()
 
virtual eC_String GetExecutablePath ()
 
virtual time_t GetFileDateTime (const eC_String &kPath) const
 
virtual long GetFileSize (const eC_String &kPath) const
 
virtual eC_String GetHomePath () const
 
virtual const eC_String & GetRootPath () const
 
virtual eC_Bool IsDrive (const eC_String &kDirStr) const
 
virtual eC_Bool IsStrAbsolute (const eC_String &kStr) const
 
virtual eC_String MakePlatformPath (const eC_String &kOrgPath) const
 
virtual eC_File * OpenPlatformFile (const eC_String &kPath, eC_Flag uiMode=eC_File::FS_WRITEACCESS|eC_File::FS_READACCESS) const
 
virtual eC_Bool RemoveFile (const eC_String &kPath) const
 
virtual eC_Bool SetCurrentPath (const eC_String &kPath)
 
- Public Member Functions inherited from CGUIFileSysWrap
 CGUIFileSysWrap ()
 
virtual ~CGUIFileSysWrap ()
 Destructor, frees the drives list.
 
virtual eC_Bool CheckIfDirectoryExists (const eC_String &kPath) const =0
 
virtual eC_Bool CheckIfFileExists (const eC_String &kPath) const =0
 
virtual eC_Bool CheckIfFileOrDirectoryExists (const eC_String &kPath) const =0
 
virtual eC_Bool CpFile (eC_String kSource, eC_String kDest, eC_Bool bOverwrite=false, eC_Bool bCopyEvenIfIdentical=true)=0
 
virtual eC_Bool CreateRelativePath (const eC_String &kFromPath, const eC_String &kToPath, eC_String &kResultPath) const
 
void DeInit ()
 
virtual CGUIDirectoryDirAlloc (const eC_String &kPath, const CGUIDirectory::StringList_t &kNameFilter, eC_UInt uiFilter=CGUIDirectory::ALL, CGUIDirectory::SortFlag_t eSort=CGUIDirectory::NAME, eC_Bool bCaseInsensitive=true) const =0
 
virtual CGUIDirectoryDirAlloc (const eC_String &kPath="", const eC_String &kNameFilter="") const =0
 
eC_String GetCurrentPath () const
 
virtual const eC_String & GetDirSeparator () const =0
 
virtual const CGUIDirInfo::DirInfoPtrList_tGetDrives ()=0
 
virtual eC_String GetExecutablePath ()=0
 
eC_String GetFileBaseName (const eC_String &rkFileName) const
 Extracts the base name of a file from a name that includes a path. More...
 
virtual time_t GetFileDateTime (const eC_String &kPath) const
 
eC_String GetFileName (const eC_String &rkFileName) const
 Extracts the file name from a file name that includes a path. More...
 
virtual long GetFileSize (const eC_String &kPath) const
 
eC_String GetFileSuffix (const eC_String &rkFileName) const
 Extracts the extension of a file name. More...
 
virtual eC_String GetHomePath () const =0
 
eC_String GetPath (const eC_String &rkFileName) const
 Extracts the path from a file name that includes a path. More...
 
const eC_String & GetPOSIXDirSeparator () const
 
virtual const eC_String & GetRootPath () const =0
 
const eC_String & GetWinDirSeparator () const
 
virtual eC_Bool IsDrive (const eC_String &kDirStr) const =0
 
virtual eC_Bool IsStrAbsolute (const eC_String &kStr) const =0
 
eC_Bool MakeAbsolutePath (const eC_String &kRelPath, eC_String &kAbsPath) const
 
virtual eC_String MakeDirectoryPath (const eC_String &kPath) const
 
virtual eC_Bool MakeNormalizedPlatformPath (const eC_String &kOrgPath, eC_String &kResultPath) const
 
virtual eC_String MakePlatformPath (const eC_String &kOrgPath) const =0
 
virtual eC_File * OpenPlatformFile (const eC_String &kPath, eC_Flag uiMode=eC_File::FS_WRITEACCESS|eC_File::FS_READACCESS) const
 
virtual eC_Bool RemoveFile (const eC_String &kPath) const =0
 
void SeparateString (const eC_String &kOrgStr, eC_String &kLeftStr, eC_String &kRightStr, const eC_String &kSeparator, eC_Bool bFromLeft) const
 
virtual eC_Bool SetCurrentPath (const eC_String &kPath)=0
 

Additional Inherited Members

- Static Public Member Functions inherited from CGUIFileSysWrap
static CGUIFileSysWrapGetInstance ()
 
- Static Public Attributes inherited from CGUIFileSysWrap
static const eC_String ms_DirSepPOSIX
 Directory seperator used for *NIX file system.
 
static const eC_String ms_DirSepWin
 Directory separator used for windows file system.
 
- Protected Attributes inherited from CGUIFileSysWrap
eC_String m_kCurrentPath
 
CGUIDirInfo::DirInfoPtrList_t m_kDrivesList
 

Detailed Description

Implementation of CGUIFileSysWrap class for Windows systems.

Constructor & Destructor Documentation

◆ CGUIFileSysWrapWin()

CGUIFileSysWrapWin::CGUIFileSysWrapWin ( )

Constructor.

◆ ~CGUIFileSysWrapWin()

CGUIFileSysWrapWin::~CGUIFileSysWrapWin ( )
inline

Destructor.

Member Function Documentation

◆ CheckIfDirectoryExists()

virtual eC_Bool CGUIFileSysWrapWin::CheckIfDirectoryExists ( const eC_String &  kPath) const
virtual

Checks if a directory at given path exists.

Parameters
kPathPath to directory for which the existence should be checked.
Returns
True If the directory specified via the path exists or False if its not a directory (for example file).

Implements CGUIFileSysWrap.

◆ CheckIfFileExists()

virtual eC_Bool CGUIFileSysWrapWin::CheckIfFileExists ( const eC_String &  kPath) const
virtual

Checks if a file at a given path exists.

Parameters
kPathPath to a file for which the existence should be checked.
Returns
True If the file specified via the path exists or False if it is not a file (for example a directory) or a symlink.

Implements CGUIFileSysWrap.

◆ CheckIfFileOrDirectoryExists()

virtual eC_Bool CGUIFileSysWrapWin::CheckIfFileOrDirectoryExists ( const eC_String &  kPath) const
virtual

Checks if a given path exists. The object specified might be a file or directory.

Parameters
kPathPath to a file or directory for which the existence should be checked.
Returns
True If the object specified via the path exists otherwise False.

Implements CGUIFileSysWrap.

◆ CpFile()

virtual eC_Bool CGUIFileSysWrapWin::CpFile ( eC_String  kSource,
eC_String  kDest,
eC_Bool  bOverwrite = false,
eC_Bool  bCopyEvenIfIdentical = true 
)
virtual

Copy a file. All file data and file meta information are copied from the source file to the destination file.

If the given destination is a directory that differs from the source directory, the source file is copied to the destination. If the source and destination directories are the same, this method does nothing and returns False.

If the given destination is a file and it is the same file as the source file, this method does nothing and returns False. Otherwise, it checks whether the destination file exists. If the destination file does not exist, a new file is created. Otherwise it checks whether the destination file can be overwritten. If that is the case, the destination file is overwritten if specified.

Parameters
kSourceThe source file name including path. If it is a relative path, the current working directory of the file system wrapper is used to complete the path.
kDestThe destination directory or file. If it is a relative path the current working directory of the file system wrapper is used to complete the path.
bOverwritePass true to overwrite the destination file if it already exists.
bCopyEvenIfIdenticalTrue if we want to copy the files even if they already exist and are identical (modification date, modification time and size). False if we want to skip copying the files which already exists and have the same date,time of modification and size.
Returns
True if successful, otherwise False.

Implements CGUIFileSysWrap.

◆ DirAlloc() [1/2]

virtual CGUIDirectory * CGUIFileSysWrapWin::DirAlloc ( const eC_String &  kPath,
const CGUIDirectory::StringList_t kNameFilter,
eC_UInt  uiFilter = CGUIDirectory::ALL,
CGUIDirectory::SortFlag_t  eSort = CGUIDirectory::NAME,
eC_Bool  bCaseInsensitive = true 
) const
virtual

Allocate a CGUIDirectoryWin instance for the given path. The instance should be deleted after the user finishes using it.

Parameters
kPathThe kPath for the directory that is passed as a parameter of the CGUIDirectory constructor.
kNameFilterThe name filters to filter the directory that is passed as a parameter of the CGUIDirectory constructor.
uiFilterThe filter attribute to filter the directory that is passed as a parameter of the CGUIDirectory constructor.
eSortThe sort kind to sort the directory that is passed as a parameter of the CGUIDirectory constructor.
bCaseInsensitiveThe bool value to indicate whether sort the elements in the directory case-insensitive or not. This is also a parameter of the CGUIDirectory constructor.
Returns
The resulting directory instance

Implements CGUIFileSysWrap.

◆ DirAlloc() [2/2]

virtual CGUIDirectory * CGUIFileSysWrapWin::DirAlloc ( const eC_String &  kPath = "",
const eC_String &  kNameFilter = "" 
) const
virtual

Allocate a CGUIDirectoryWin instance using the given path. The CGUIDirectory should be deleted after the user finishes using it.

Parameters
kPathThe directory path; directly passed to the CGUIDirectory constructor.
kNameFilterThe filter string; directly passed to the CGUIDirectory constructor.
Returns
Pointer to the allocated CGUIDirectory instance.

Implements CGUIFileSysWrap.

◆ GetDirSeparator()

virtual const eC_String & CGUIFileSysWrapWin::GetDirSeparator ( ) const
virtual

Gets the directory separator "\" under Windows system.

Returns
The directory separator.

Implements CGUIFileSysWrap.

◆ GetDrives()

virtual const CGUIDirInfo::DirInfoPtrList_t & CGUIFileSysWrapWin::GetDrives ( )
virtual

Gets a list of the drives on this system. In pocket pc 2003, we just returns a list contains the root directory.

Returns
The list of the drives. It returns a number of CGUIDirInfo objects of the path "C:", "D:", and so on for Windows systems.

Implements CGUIFileSysWrap.

◆ GetExecutablePath()

virtual eC_String CGUIFileSysWrapWin::GetExecutablePath ( )
virtual

Returns the absolute path to the current executable

Returns
executable path

Implements CGUIFileSysWrap.

◆ GetFileDateTime()

virtual time_t CGUIFileSysWrapWin::GetFileDateTime ( const eC_String &  kPath) const
virtual

Get the last time of modification of the file

Note
Not supported on Windows CE, return always -1
Parameters
kPathFull filename (including path) of the file which is getting the last modification
Returns
time and date of the last modification

Reimplemented from CGUIFileSysWrap.

◆ GetFileSize()

virtual long CGUIFileSysWrapWin::GetFileSize ( const eC_String &  kPath) const
virtual

Get the size of the file

Note
Not supported on Windows CE, return always -1
Parameters
kPathFull filename (including path) of the file which is getting the size
Returns
size of the file

Reimplemented from CGUIFileSysWrap.

◆ GetHomePath()

virtual eC_String CGUIFileSysWrapWin::GetHomePath ( ) const
virtual

Get the current user's home path. This method tries to obtain the value of the environment variable USERPROFILE. If it does not exist, the method tries to form the home path by concatenating the environment variables HOMEDRIVE and HOMEPATH. If they don't exist, the root path of the operating system is returned.

Returns
Home path of the current user.
Remarks
On PocketPC, this method always returns the root path.

Implements CGUIFileSysWrap.

◆ GetRootPath()

virtual const eC_String & CGUIFileSysWrapWin::GetRootPath ( ) const
virtual

Gets the absolute path for the root directory. It returns "C:" for the Windows operating system.

Returns
The absolute path for the root directory.

Implements CGUIFileSysWrap.

◆ IsDrive()

virtual eC_Bool CGUIFileSysWrapWin::IsDrive ( const eC_String &  kDirStr) const
virtual

Check whether the given directory string represents a drive or not.

Parameters
kDirStrThe directory string to be checked.
Returns
True if the directory name represents a drive; otherwise False.

Implements CGUIFileSysWrap.

◆ IsStrAbsolute()

virtual eC_Bool CGUIFileSysWrapWin::IsStrAbsolute ( const eC_String &  kStr) const
virtual

Help function to check whether the given path string is an absolute path or not.

Parameters
kStrThe given path.
Returns
True if it is an absolute path; otherwise False.

Implements CGUIFileSysWrap.

◆ MakePlatformPath()

virtual eC_String CGUIFileSysWrapWin::MakePlatformPath ( const eC_String &  kOrgPath) const
virtual

Adapt the path with the correct path separator "\" so that it conforms to Windows path naming. There is no trailing backslash in the returned path.

Parameters
kOrgPathThe original path to be adapted.
Returns
The adapted result path.

Implements CGUIFileSysWrap.

◆ OpenPlatformFile()

virtual eC_File * CGUIFileSysWrapWin::OpenPlatformFile ( const eC_String &  kPath,
eC_Flag  uiMode = eC_File::FS_WRITEACCESS|eC_File::FS_READACCESS 
) const
virtual

Opens the given file from the platform's filesystem. This method is useful for getting write-access to the filesystem. If you are looking for plain read-access and you wish to support Guiliani's Resource-File and Resource-Header feature, you should use the CGUIResourceFileHander and it's Open()-Interface instead.

Parameters
kPathFull filename (including path) of the file which shall be opened
uiModeRequested access mode (see eC_File for details)
Returns
Pointer to newly allocated and opened file. Note that it is in the caller's responsibility to close and free this file! You should check the returned file for errors using eC_File's interfaces.

Reimplemented from CGUIFileSysWrap.

◆ RemoveFile()

virtual eC_Bool CGUIFileSysWrapWin::RemoveFile ( const eC_String &  kPath) const
virtual

Removes the file specified with the given absolute path name

Parameters
kPathName of the file to be deleted
Returns
True if successful; otherwise False.

Implements CGUIFileSysWrap.

◆ SetCurrentPath()

virtual eC_Bool CGUIFileSysWrapWin::SetCurrentPath ( const eC_String &  kPath)
virtual

Sets the application's current working directory to a specified path. If the path is not an absolute path, it does not change the current working directory and returns False.

Under Pocket pc 2003, the SetCurrentDirectory is not supported, we just return false to indicate that the current path is not changed. There is no concept of current working directory under pocket pc 2003.

Parameters
kPathThe path
Returns
True if the directory was successfully changed; otherwise False.

Implements CGUIFileSysWrap.


The documentation for this class was generated from the following file: