Guiliani  Version 2.6 revision 7293 (documentation build 12)
CGUIDirInfo Class Referenceabstract

Describes a file in the file system. More...

#include <GUIDirInfo.h>

Inheritance diagram for CGUIDirInfo:

Classes

struct  GUIFileTime_t
 Timestamp of a file. More...
 

Public Types

typedef eC_TListDoubleLinked< CGUIDirInfo * > DirInfoPtrList_t
 Type define for the CGUIDirInfo list.
 

Public Member Functions

 CGUIDirInfo ()
 
 CGUIDirInfo (const CGUIDirInfo &kDirInfo)
 
 CGUIDirInfo (const eC_String &kFileName, const eC_String &kCurrentWorkingDirPath)
 
virtual ~CGUIDirInfo ()
 
void ChangeFilePath (const eC_String &kNewFilePath)
 
virtual eC_Bool CheckExist () const =0
 
eC_String GetAbsPath () const
 
eC_String GetAbsPath_File () const
 
eC_String GetFileBaseName () const
 
eC_String GetFileName () const
 
eC_String GetFileSuffix () const
 
virtual eC_UInt GetGroupID () const =0
 
virtual eC_String GetGroupName () const =0
 
virtual eC_UInt GetOwnerID () const =0
 
virtual eC_String GetOwnerName () const =0
 
eC_String GetPath () const
 
eC_String GetPath_File () const
 
virtual long long int GetSize () const =0
 
virtual GUIFileTime_t GetTimeCreated () const =0
 
virtual GUIFileTime_t GetTimeLatestModified () const =0
 
virtual GUIFileTime_t GetTimeLatestRead () const =0
 
virtual eC_Bool IsAbsPath () const
 
virtual eC_Bool IsDir () const =0
 
virtual eC_Bool IsExecutable () const =0
 
virtual eC_Bool IsFile () const =0
 
virtual eC_Bool IsHidden () const =0
 
virtual eC_Bool IsReadable () const =0
 
virtual eC_Bool IsRoot () const =0
 
virtual eC_Bool IsSymLink () const =0
 
virtual eC_Bool IsSystem () const =0
 
virtual eC_Bool IsWritable () const =0
 
void MakePathAbs ()
 
CGUIDirInfooperator= (const CGUIDirInfo &kDirInfo)
 
virtual eC_String ReadLink () const =0
 

Static Public Attributes

static const eC_UInt ID_UNKNOWN = static_cast<eC_UInt>(-1)
 Value used as "unknown" ID.
 

Protected Types

enum  FileTime_t { CreatedTime , ModifiedTime , ReadTime }
 

Protected Member Functions

virtual GUIFileTime_t GetTime (FileTime_t eFileTime) const =0
 

Protected Attributes

eC_String m_kCurrentWorkingDirPath
 
eC_String m_kFilePath
 

Detailed Description

Describes a file in the file system.

Each object of this class stores the path of a file. It can be changed with ChangeFilePath(). The absolute path of the file can be obtained by the method GetAbsPath_File(). GetAbsPath() gets the path of the file without the file name. The corresponding non-absolute paths can be obtained with the methods GetPath_File() and GetPath(). Whether the given path is an absolute path or not is checked by the method IsAbsPath(). The path can be changed to be absolute by the method MakePathAbs(). Use GetFileName() to get the file name. The base name and suffix information are obtained by the methods GetFileBaseName() and GetFileSuffix().

The type of file is checked by the methods IsDir(), IsFile() and IsSymLink(). If the file is a symlink, you can get the file that the symlink points to by the method ReadLink(). The group name, group id, owner name and owner id are checked by the method GetGroupName(), GetGroupID(), GetOwnerName() and GetOwnerID().

Each object also provides information about the time when the file was created, latest modified, or accessed by the methods GetTimeCreated(), GetTimeLatestModified() and GetTimeLatestRead(). As long as the target platform provides time zones and daylight savings time handling, the time returned is UTC. The access permissions are checked by the methods IsExecutable(), IsReadable(), IsWritable(). Use GetSize() to determine the size of the file.

Member Enumeration Documentation

◆ FileTime_t

enum CGUIDirInfo::FileTime_t
protected

The file time enumeration used in GetTime private method to identify, which time to get.

Constructor & Destructor Documentation

◆ CGUIDirInfo() [1/3]

CGUIDirInfo::CGUIDirInfo ( )

Default constructor. The file path is set to be empty string.

◆ CGUIDirInfo() [2/3]

CGUIDirInfo::CGUIDirInfo ( const eC_String &  kFileName,
const eC_String &  kCurrentWorkingDirPath 
)

Constructor with the given file path name.

Parameters
kFileNameThe path of the given file.
kCurrentWorkingDirPathThe path of the current working directory.

◆ CGUIDirInfo() [3/3]

CGUIDirInfo::CGUIDirInfo ( const CGUIDirInfo kDirInfo)

Copy constructor.

Parameters
kDirInfoThe source object to be copied.

◆ ~CGUIDirInfo()

virtual CGUIDirInfo::~CGUIDirInfo ( )
inlinevirtual

Destructor.

Member Function Documentation

◆ ChangeFilePath()

void CGUIDirInfo::ChangeFilePath ( const eC_String &  kNewFilePath)

Change old file path to new one.

Parameters
kNewFilePathNew path to be set.

◆ CheckExist()

virtual eC_Bool CGUIDirInfo::CheckExist ( ) const
pure virtual

Check whether the file does exist in the file system.

Returns
True if the file does exist, otherwise False.

Implemented in CGUIDirInfoPOSIX, and CGUIDirInfoWin.

◆ GetAbsPath()

eC_String CGUIDirInfo::GetAbsPath ( ) const

Get the absolute path excluding the file name. Example: for the construct new CGUIDirInfo("filename.ext", "path/subpath") GetAbsPath_File will return path/subpath

Returns
The absolute path excluding the file name.

◆ GetAbsPath_File()

eC_String CGUIDirInfo::GetAbsPath_File ( ) const

Get the absolute file path including the path and file name. Example: for the construct new CGUIDirInfo("filename.ext", "path/subpath") GetAbsPath_File will return path/subpath/filename.ext

Returns
The absolute path including the path and file name.

◆ GetFileBaseName()

eC_String CGUIDirInfo::GetFileBaseName ( ) const

Get the base name of the file name until the last '.'. Example: path/subpath/filename.ext.ext2 will become filename.ext

Returns
The base name of the file name until the last '.'.

◆ GetFileName()

eC_String CGUIDirInfo::GetFileName ( ) const

Get the file name excluding the path of this file. Example: path/subpath/filename.ext will become filename.ext

Returns
The file name excluding path.

◆ GetFileSuffix()

eC_String CGUIDirInfo::GetFileSuffix ( ) const

Get suffix of the file name from the last '.'. Example: path/subpath/filename.ext.ext2 will become ext2 If there is no suffix, an empty string is returned.

Returns
Suffix of the file name from the last '.'.

◆ GetGroupID()

virtual eC_UInt CGUIDirInfo::GetGroupID ( ) const
pure virtual

Get the group id of this file. Returns ID_UNKNOWN if groups are not supported.

Returns
The group id of this file.

Implemented in CGUIDirInfoPOSIX, and CGUIDirInfoWin.

◆ GetGroupName()

virtual eC_String CGUIDirInfo::GetGroupName ( ) const
pure virtual

Get the group name of this file. Returns an empty string if groups are not supported.

Returns
The group name of this file.

Implemented in CGUIDirInfoPOSIX, and CGUIDirInfoWin.

◆ GetOwnerID()

virtual eC_UInt CGUIDirInfo::GetOwnerID ( ) const
pure virtual

Get the ID of the file's owner. Returns ID_UNKNOWN if owner IDs are not supported.

Returns
the ID of the file's owner.

Implemented in CGUIDirInfoPOSIX, and CGUIDirInfoWin.

◆ GetOwnerName()

virtual eC_String CGUIDirInfo::GetOwnerName ( ) const
pure virtual

Get the name of the file's owner. Returns an empty string if owner names are not supported.

Returns
The name of the file's owner.

Implemented in CGUIDirInfoPOSIX, and CGUIDirInfoWin.

◆ GetPath()

eC_String CGUIDirInfo::GetPath ( ) const

Get the file path excluding the file's name. This may be a relative path or absolute path according to the path given in constructor or ChangeFilePath. If the file path is a drive or root path, it is returned.

Returns
The file path excluding the file's name.

◆ GetPath_File()

eC_String CGUIDirInfo::GetPath_File ( ) const

Get the file path including the file's name. This may be a relative path or absolute path according to the path given in constructor or ChangeFilePath.

Returns
The file path including the file's name.

◆ GetSize()

virtual long long int CGUIDirInfo::GetSize ( ) const
pure virtual

Get the size of the file.

Returns
The size of the file.

Implemented in CGUIDirInfoPOSIX, and CGUIDirInfoWin.

◆ GetTime()

virtual GUIFileTime_t CGUIDirInfo::GetTime ( FileTime_t  eFileTime) const
protectedpure virtual

Get the time according to the given file time type.

Parameters
eFileTimeThe file time type, i.e. Created, LatestModifed or LatestRead.
Returns
Time obtained at UTC.

Implemented in CGUIDirInfoPOSIX, and CGUIDirInfoWin.

◆ GetTimeCreated()

virtual GUIFileTime_t CGUIDirInfo::GetTimeCreated ( ) const
pure virtual

Get the time when the file was created.

Returns
The time (UTC) when the file was created.

Implemented in CGUIDirInfoPOSIX, and CGUIDirInfoWin.

◆ GetTimeLatestModified()

virtual GUIFileTime_t CGUIDirInfo::GetTimeLatestModified ( ) const
pure virtual

Get the time when the file was modified last time.

Returns
The time (UTC) when the file was modified last time.

Implemented in CGUIDirInfoPOSIX, and CGUIDirInfoWin.

◆ GetTimeLatestRead()

virtual GUIFileTime_t CGUIDirInfo::GetTimeLatestRead ( ) const
pure virtual

Get the time when the file is read last time.

Returns
The time (UTC) when the file was read last time.

Implemented in CGUIDirInfoPOSIX, and CGUIDirInfoWin.

◆ IsAbsPath()

virtual eC_Bool CGUIDirInfo::IsAbsPath ( ) const
virtual

Check whether the given file path is an absolute path or not.

Returns
True if it is an absolute path, False if it is relative.

◆ IsDir()

virtual eC_Bool CGUIDirInfo::IsDir ( ) const
pure virtual

Check whether the file is a directory.

Returns
True if it is a directory, otherwise False.

Implemented in CGUIDirInfoPOSIX, and CGUIDirInfoWin.

◆ IsExecutable()

virtual eC_Bool CGUIDirInfo::IsExecutable ( ) const
pure virtual

Check whether the file is executable or not.

Returns
True if the file is executable, otherwise False.

Implemented in CGUIDirInfoPOSIX, and CGUIDirInfoWin.

◆ IsFile()

virtual eC_Bool CGUIDirInfo::IsFile ( ) const
pure virtual

Check whether the file is a file (not a directory).

Returns
True if it is a file, otherwise False.

Implemented in CGUIDirInfoPOSIX, and CGUIDirInfoWin.

◆ IsHidden()

virtual eC_Bool CGUIDirInfo::IsHidden ( ) const
pure virtual

Check whether the file is a hidden file.

Returns
True if it is a hidden file, otherwise False.

Implemented in CGUIDirInfoPOSIX, and CGUIDirInfoWin.

◆ IsReadable()

virtual eC_Bool CGUIDirInfo::IsReadable ( ) const
pure virtual

Check whether the file is readable or not.

Returns
True if the file is readable, otherwise False.

Implemented in CGUIDirInfoPOSIX, and CGUIDirInfoWin.

◆ IsRoot()

virtual eC_Bool CGUIDirInfo::IsRoot ( ) const
pure virtual

Check whether the given file is a root directory or not.

Returns
True if the directory is a root directory; otherwise False.

Implemented in CGUIDirInfoPOSIX, and CGUIDirInfoWin.

◆ IsSymLink()

virtual eC_Bool CGUIDirInfo::IsSymLink ( ) const
pure virtual

Check whether the file is a symlink.

Returns
True if it is a symlink, otherwise False.

Implemented in CGUIDirInfoPOSIX, and CGUIDirInfoWin.

◆ IsSystem()

virtual eC_Bool CGUIDirInfo::IsSystem ( ) const
pure virtual

Check whether the file is a system file.

Returns
True if it is a hidden file, otherwise False.

Implemented in CGUIDirInfoPOSIX, and CGUIDirInfoWin.

◆ IsWritable()

virtual eC_Bool CGUIDirInfo::IsWritable ( ) const
pure virtual

Check whether the file is writable or not.

Returns
True if the file is writable, otherwise False.

Implemented in CGUIDirInfoPOSIX, and CGUIDirInfoWin.

◆ MakePathAbs()

void CGUIDirInfo::MakePathAbs ( )

Make the path to be absolute if it is a relative path. If the path is already absolute, do nothing.

◆ operator=()

CGUIDirInfo & CGUIDirInfo::operator= ( const CGUIDirInfo kDirInfo)

Assignment operator.

Parameters
kDirInfoThe source object to be copied.
Returns
Reference to this object.

◆ ReadLink()

virtual eC_String CGUIDirInfo::ReadLink ( ) const
pure virtual

Get the name a symlink points to, or an empty string if the object isn't a symbolic link.

Returns
The file name that the symlink points to.

Implemented in CGUIDirInfoPOSIX, and CGUIDirInfoWin.

Member Data Documentation

◆ m_kCurrentWorkingDirPath

eC_String CGUIDirInfo::m_kCurrentWorkingDirPath
protected

Stores the path of the current working directory.

◆ m_kFilePath

eC_String CGUIDirInfo::m_kFilePath
protected

Stores the file path.


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