cppfs
1.2.0.5b71c2c98fb9
Cross-platform C++ file system library supporting multiple backends (Local-FS, SSH)
|
File handle for the local file system. More...
#include <cppfs/include/cppfs/posix/LocalFileHandle.h>
Public Member Functions | |
LocalFileHandle (std::shared_ptr< LocalFileSystem > fs, const std::string &path) | |
Constructor. More... | |
LocalFileHandle (std::shared_ptr< LocalFileSystem > fs, std::string &&path) | |
Constructor. More... | |
virtual | ~LocalFileHandle () |
Destructor. More... | |
virtual std::unique_ptr< AbstractFileHandleBackend > | clone () const override |
Create a copy of this handle. More... | |
virtual AbstractFileSystem * | fs () const override |
Get file system. More... | |
virtual void | updateFileInfo () override |
Update file information. More... | |
virtual std::string | path () const override |
Get path. More... | |
virtual bool | exists () const override |
Check if file or directory exists. More... | |
virtual bool | isFile () const override |
Check if item is a file. More... | |
virtual bool | isDirectory () const override |
Check if item is a directory. More... | |
virtual bool | isSymbolicLink () const override |
Check if item is a symbolic link. More... | |
virtual std::vector< std::string > | listFiles () const override |
List files in directory. More... | |
virtual std::unique_ptr< AbstractFileIteratorBackend > | begin () const override |
Get iterator that points to the first directory entry. More... | |
virtual unsigned int | size () const override |
Get file size. More... | |
virtual unsigned int | accessTime () const override |
Get time of last access. More... | |
virtual unsigned int | modificationTime () const override |
Get time of last modification. More... | |
virtual unsigned int | userId () const override |
Get ID of owning user. More... | |
virtual void | setUserId (unsigned int uid) override |
Set owning user. More... | |
virtual unsigned int | groupId () const override |
Get ID of owning group. More... | |
virtual void | setGroupId (unsigned int gid) override |
Set owning group. More... | |
virtual unsigned long | permissions () const override |
Get file permissions. More... | |
virtual void | setPermissions (unsigned long permissions) override |
Set file permissions. More... | |
virtual bool | createDirectory () override |
Create directory. More... | |
virtual bool | removeDirectory () override |
Remove directory. More... | |
virtual bool | copy (AbstractFileHandleBackend &dest) override |
Copy file. More... | |
virtual bool | move (AbstractFileHandleBackend &dest) override |
Move file. More... | |
virtual bool | createLink (AbstractFileHandleBackend &dest) override |
Create hard link. More... | |
virtual bool | createSymbolicLink (AbstractFileHandleBackend &dest) override |
Create symbolic link. More... | |
virtual bool | rename (const std::string &filename) override |
Rename file or directory. More... | |
virtual bool | remove () override |
Remove file. More... | |
virtual std::unique_ptr< std::istream > | createInputStream (std::ios_base::openmode mode) const override |
Create input stream to read from the file. More... | |
virtual std::unique_ptr< std::ostream > | createOutputStream (std::ios_base::openmode mode) override |
Create output stream to write to the file. More... | |
LocalFileHandle (std::shared_ptr< LocalFileSystem > fs, const std::string &path) | |
Constructor. More... | |
virtual | ~LocalFileHandle () |
Destructor. More... | |
virtual std::unique_ptr< AbstractFileHandleBackend > | clone () const override |
Create a copy of this handle. More... | |
virtual AbstractFileSystem * | fs () const override |
Get file system. More... | |
virtual void | updateFileInfo () override |
Update file information. More... | |
virtual std::string | path () const override |
Get path. More... | |
virtual bool | exists () const override |
Check if file or directory exists. More... | |
virtual bool | isFile () const override |
Check if item is a file. More... | |
virtual bool | isDirectory () const override |
Check if item is a directory. More... | |
virtual bool | isSymbolicLink () const override |
Check if item is a symbolic link. More... | |
virtual std::vector< std::string > | listFiles () const override |
List files in directory. More... | |
virtual std::unique_ptr< AbstractFileIteratorBackend > | begin () const override |
Get iterator that points to the first directory entry. More... | |
virtual unsigned int | size () const override |
Get file size. More... | |
virtual unsigned int | accessTime () const override |
Get time of last access. More... | |
virtual unsigned int | modificationTime () const override |
Get time of last modification. More... | |
virtual unsigned int | userId () const override |
Get ID of owning user. More... | |
virtual void | setUserId (unsigned int uid) override |
Set owning user. More... | |
virtual unsigned int | groupId () const override |
Get ID of owning group. More... | |
virtual void | setGroupId (unsigned int gid) override |
Set owning group. More... | |
virtual unsigned long | permissions () const override |
Get file permissions. More... | |
virtual void | setPermissions (unsigned long permissions) override |
Set file permissions. More... | |
virtual bool | createDirectory () override |
Create directory. More... | |
virtual bool | removeDirectory () override |
Remove directory. More... | |
virtual bool | copy (AbstractFileHandleBackend &dest) override |
Copy file. More... | |
virtual bool | move (AbstractFileHandleBackend &dest) override |
Move file. More... | |
virtual bool | createLink (AbstractFileHandleBackend &dest) override |
Create hard link. More... | |
virtual bool | createSymbolicLink (AbstractFileHandleBackend &dest) override |
Create symbolic link. More... | |
virtual bool | rename (const std::string &filename) override |
Rename file or directory. More... | |
virtual bool | remove () override |
Remove file. More... | |
virtual std::unique_ptr< std::istream > | createInputStream (std::ios_base::openmode mode) const override |
Create input stream to read from the file. More... | |
virtual std::unique_ptr< std::ostream > | createOutputStream (std::ios_base::openmode mode) override |
Create output stream to write to the file. More... | |
Public Member Functions inherited from cppfs::AbstractFileHandleBackend | |
AbstractFileHandleBackend () | |
Constructor. More... | |
virtual | ~AbstractFileHandleBackend () |
Destructor. More... | |
Protected Member Functions | |
void | readFileInfo () const |
void | readLinkInfo () const |
void | readFileInfo () const |
Protected Attributes | |
std::shared_ptr< LocalFileSystem > | m_fs |
File system that created this handle. More... | |
std::string | m_path |
Path to file or directory. More... | |
void * | m_fileInfo |
Information about the current file (resolves links, created on demand) More... | |
void * | m_linkInfo |
Information about the current file (does not resolve links, created on demand) More... | |
File handle for the local file system.
cppfs::LocalFileHandle::LocalFileHandle | ( | std::shared_ptr< LocalFileSystem > | fs, |
const std::string & | path | ||
) |
Constructor.
[in] | fs | File system that created this handle |
[in] | path | Path to file or directory |
cppfs::LocalFileHandle::LocalFileHandle | ( | std::shared_ptr< LocalFileSystem > | fs, |
std::string && | path | ||
) |
Constructor.
[in] | fs | File system that created this handle |
[in] | path | Path to file or directory |
|
virtual |
Destructor.
cppfs::LocalFileHandle::LocalFileHandle | ( | std::shared_ptr< LocalFileSystem > | fs, |
const std::string & | path | ||
) |
Constructor.
[in] | fs | File system that created this handle |
[in] | path | Path to file or directory |
|
virtual |
Destructor.
|
overridevirtual |
|
overridevirtual |
|
overridevirtual |
Update file information.
Implements cppfs::AbstractFileHandleBackend.
|
overridevirtual |
|
overridevirtual |
Check if file or directory exists.
Implements cppfs::AbstractFileHandleBackend.
|
overridevirtual |
Check if item is a file.
Implements cppfs::AbstractFileHandleBackend.
|
overridevirtual |
Check if item is a directory.
Implements cppfs::AbstractFileHandleBackend.
|
overridevirtual |
Check if item is a symbolic link.
Implements cppfs::AbstractFileHandleBackend.
|
overridevirtual |
List files in directory.
Implements cppfs::AbstractFileHandleBackend.
|
overridevirtual |
Get iterator that points to the first directory entry.
Implements cppfs::AbstractFileHandleBackend.
|
overridevirtual |
Get file size.
Implements cppfs::AbstractFileHandleBackend.
|
overridevirtual |
|
overridevirtual |
|
overridevirtual |
|
overridevirtual |
|
overridevirtual |
|
overridevirtual |
|
overridevirtual |
|
overridevirtual |
Set file permissions.
[in] | permissions | File permissions |
Implements cppfs::AbstractFileHandleBackend.
|
overridevirtual |
Create directory.
Implements cppfs::AbstractFileHandleBackend.
|
overridevirtual |
Remove directory.
Implements cppfs::AbstractFileHandleBackend.
|
overridevirtual |
Copy file.
[in] | dest | Destination file or directory (must be of the same type as this file handle) |
Implements cppfs::AbstractFileHandleBackend.
|
overridevirtual |
Move file.
[in] | dest | Destination file or directory (must be of the same type as this file handle) |
Implements cppfs::AbstractFileHandleBackend.
|
overridevirtual |
Create hard link.
[in] | dest | Destination file or directory (must be of the same type as this file handle) |
Implements cppfs::AbstractFileHandleBackend.
|
overridevirtual |
Create symbolic link.
[in] | dest | Destination file or directory (must be of the same type as this file handle) |
Implements cppfs::AbstractFileHandleBackend.
|
overridevirtual |
Rename file or directory.
[in] | filename | File name |
Implements cppfs::AbstractFileHandleBackend.
|
overridevirtual |
Remove file.
Implements cppfs::AbstractFileHandleBackend.
|
overridevirtual |
Create input stream to read from the file.
[in] | mode | Opening mode flags |
Implements cppfs::AbstractFileHandleBackend.
|
overridevirtual |
Create output stream to write to the file.
[in] | mode | Opening mode flags |
Implements cppfs::AbstractFileHandleBackend.
|
protected |
|
protected |
|
overridevirtual |
|
overridevirtual |
|
overridevirtual |
Update file information.
Implements cppfs::AbstractFileHandleBackend.
|
overridevirtual |
|
overridevirtual |
Check if file or directory exists.
Implements cppfs::AbstractFileHandleBackend.
|
overridevirtual |
Check if item is a file.
Implements cppfs::AbstractFileHandleBackend.
|
overridevirtual |
Check if item is a directory.
Implements cppfs::AbstractFileHandleBackend.
|
overridevirtual |
Check if item is a symbolic link.
Implements cppfs::AbstractFileHandleBackend.
|
overridevirtual |
List files in directory.
Implements cppfs::AbstractFileHandleBackend.
|
overridevirtual |
Get iterator that points to the first directory entry.
Implements cppfs::AbstractFileHandleBackend.
|
overridevirtual |
Get file size.
Implements cppfs::AbstractFileHandleBackend.
|
overridevirtual |
|
overridevirtual |
|
overridevirtual |
|
overridevirtual |
|
overridevirtual |
|
overridevirtual |
|
overridevirtual |
|
overridevirtual |
Set file permissions.
[in] | permissions | File permissions |
Implements cppfs::AbstractFileHandleBackend.
|
overridevirtual |
Create directory.
Implements cppfs::AbstractFileHandleBackend.
|
overridevirtual |
Remove directory.
Implements cppfs::AbstractFileHandleBackend.
|
overridevirtual |
Copy file.
[in] | dest | Destination file or directory (must be of the same type as this file handle) |
Implements cppfs::AbstractFileHandleBackend.
|
overridevirtual |
Move file.
[in] | dest | Destination file or directory (must be of the same type as this file handle) |
Implements cppfs::AbstractFileHandleBackend.
|
overridevirtual |
Create hard link.
[in] | dest | Destination file or directory (must be of the same type as this file handle) |
Implements cppfs::AbstractFileHandleBackend.
|
overridevirtual |
Create symbolic link.
[in] | dest | Destination file or directory (must be of the same type as this file handle) |
Implements cppfs::AbstractFileHandleBackend.
|
overridevirtual |
Rename file or directory.
[in] | filename | File name |
Implements cppfs::AbstractFileHandleBackend.
|
overridevirtual |
Remove file.
Implements cppfs::AbstractFileHandleBackend.
|
overridevirtual |
Create input stream to read from the file.
[in] | mode | Opening mode flags |
Implements cppfs::AbstractFileHandleBackend.
|
overridevirtual |
Create output stream to write to the file.
[in] | mode | Opening mode flags |
Implements cppfs::AbstractFileHandleBackend.
|
protected |
|
protected |
File system that created this handle.
|
protected |
Path to file or directory.
|
mutableprotected |
Information about the current file (resolves links, created on demand)
Information about the current file (created on demand)
|
mutableprotected |
Information about the current file (does not resolve links, created on demand)