PCL
|
Platform-independent information on file and directory items. More...
#include <FileInfo.h>
Public Member Functions | |
FileInfo () | |
FileInfo (const FileInfo &)=default | |
FileInfo (const String &path) | |
virtual | ~FileInfo () |
const FileAttributes & | Attributes () const |
void | Clear () |
String | CompleteSuffix () const |
String | Directory () const |
String | Drive () const |
bool | Exists () const |
String | Extension () const |
int | GroupId () const |
bool | IsDirectory () const |
bool | IsExecutable () const |
bool | IsFile () const |
bool | IsHidden () const |
bool | IsReadable () const |
bool | IsSymbolicLink () const |
bool | IsWritable () const |
const FileTime & | LastAccessed () const |
const FileTime & | LastModified () const |
String | Name () const |
String | NameAndExtension () const |
String | NameAndSuffix () const |
int | NumberOfHardLinks () const |
FileInfo & | operator= (const FileInfo &)=default |
const String & | Path () const |
void | Refresh () |
void | Refresh (const String &path) |
fsize_type | Size () const |
String | Suffix () const |
String | SymbolicLinkTarget () const |
const FileTime & | TimeCreated () const |
int | UserId () const |
Definition at line 250 of file FileInfo.h.
|
inline |
Default constructor. Constructs an empty FileInfo object without any information on existing file or directory items.
Definition at line 258 of file FileInfo.h.
|
inline |
Constructs a FileInfo object with information retrieved for the specified file or directory path.
Definition at line 267 of file FileInfo.h.
|
default |
Copy constructor.
|
inlinevirtual |
Virtual destructor.
Definition at line 280 of file FileInfo.h.
|
inline |
Returns a constant reference to the FileAttributes flags for this file or directory.
Definition at line 393 of file FileInfo.h.
void pcl::FileInfo::Clear | ( | ) |
Clears all the information in this object, leaving it in an invalid state corresponding to a nonexistent item.
String pcl::FileInfo::CompleteSuffix | ( | ) | const |
Returns the complete suffix of the path in this object, or an empty string if the path does not include a suffix.
The returned string includes the initial dot separator.
The complete suffix is the rightmost substring of the path, starting with the first occurrence of a dot character. For example, in 'foo.tar.gz' the complete suffix is '.tar.gz'.
String pcl::FileInfo::Directory | ( | ) | const |
Returns the parent directory component of the path in this object, or an empty string if the path does not include a parent directory.
On Windows, the drive component of the path is not included.
Examples:
String pcl::FileInfo::Drive | ( | ) | const |
Returns the Windows drive component of the path in this object, or an empty string if the path does not include a Windows drive specification.
This function only makes sense on Windows. On UNIX and Linux operating systems, this function always returns an empty string.
|
inline |
Returns true iff this object represents an existing file or directory.
Definition at line 384 of file FileInfo.h.
String pcl::FileInfo::Extension | ( | ) | const |
Returns the file extension component of the path in this object, or an empty string if the path does not include an extension.
The returned extension includes the initial dot separator.
Examples:
|
inline |
Returns the group id of the owner of the file or directory item represented by this object.
This member function only makes sense on UNIX/Linux platforms. On Windows it always returns zero.
Definition at line 526 of file FileInfo.h.
|
inline |
Returns true iff this object represents an existing directory.
Definition at line 401 of file FileInfo.h.
|
inline |
Returns true iff the user id and group id of the caller process have execution access permission for the item represented by this object.
This member function only makes sense on UNIX/Linux platforms. On Windows it always returns false.
On POSIX systems, this function returns true only if the item represented has the S_IXUSR file mode bit set. This means that this function will normally return true for directories, since S_IXUSR/S_IXGRP/S_IXOTH represent standard search permissions for a directory.
Definition at line 477 of file FileInfo.h.
|
inline |
Returns true iff this object represents an existing file.
Definition at line 409 of file FileInfo.h.
|
inline |
Returns true iff this object represents a hidden file or directory.
On Windows, this member function returns true if the file or directory represented by this object has the hidden attribute set. On UNIX and Linux operating systems, this function returns true when the file or directory name begins with a dot character.
Definition at line 442 of file FileInfo.h.
|
inline |
Returns true iff the user id and group id of the caller process have read access permission for the item represented by this object.
Definition at line 451 of file FileInfo.h.
|
inline |
Returns true iff this object represents a symbolic link.
This member function only makes sense on UNIX/Linux platforms. On Windows it always returns false.
Definition at line 420 of file FileInfo.h.
|
inline |
Returns true iff the user id and group id of the caller process have write access permission for the item represented by this object.
Definition at line 460 of file FileInfo.h.
|
inline |
Returns a constant reference to a FileTime structure corresponding to the last access time of this file or directory.
Definition at line 544 of file FileInfo.h.
|
inline |
Returns a constant reference to a FileTime structure corresponding to the last modification time of this file or directory.
Definition at line 553 of file FileInfo.h.
String pcl::FileInfo::Name | ( | ) | const |
Returns the file name component of the path in this object, or an empty string if the path does not include a name.
The file extension or suffix is not included.
Examples:
String pcl::FileInfo::NameAndExtension | ( | ) | const |
Returns the name and extension of the path in this object. Calling this member function is functionally equivalent to: Name() + Extension().
|
inline |
A synonym for NameAndExtension().
Definition at line 376 of file FileInfo.h.
|
inline |
Returns the number of existing hard links to the file or directory item represented by this object.
This member function only makes sense on UNIX/Linux platforms. On Windows it always returns zero.
Definition at line 502 of file FileInfo.h.
Assignment operator. Returns a reference to this object.
|
inline |
Returns the absolute path of this file or directory.
Definition at line 292 of file FileInfo.h.
void pcl::FileInfo::Refresh | ( | ) |
Retrieves up-to-date information for the item represented by this object.
void pcl::FileInfo::Refresh | ( | const String & | path | ) |
Retrieves information for the specified path.
|
inline |
Returns the size in bytes of the file or directory item represented by this object.
If this object represents a directory, a fixed size (usually 4096 bytes) is always returned on UNIX and Linux systems. On Windows, zero is always returned for directories.
Definition at line 490 of file FileInfo.h.
|
inline |
A synonym for Extension().
Definition at line 350 of file FileInfo.h.
String pcl::FileInfo::SymbolicLinkTarget | ( | ) | const |
Returns the target path of this symbolic link, or an empty string if this object does not represent a symbolic link.
This member function only makes sense on UNIX/Linux platforms. On Windows it always returns an empty string.
|
inline |
Returns a constant reference to a FileTime structure corresponding to the creation time of this file or directory.
Definition at line 535 of file FileInfo.h.
|
inline |
Returns the user id of the owner of the file or directory item represented by this object.
This member function only makes sense on UNIX/Linux platforms. On Windows it always returns zero.
Definition at line 514 of file FileInfo.h.