cppfs  1.2.0.5b71c2c98fb9
Cross-platform C++ file system library supporting multiple backends (Local-FS, SSH)
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
cppfs::SshFileIterator Class Reference

File iterator for a remove file system accessed by SSH. More...

#include <cppfs/include/cppfs/ssh/SshFileIterator.h>

Inheritance diagram for cppfs::SshFileIterator:
Inheritance graph
[legend]
Collaboration diagram for cppfs::SshFileIterator:
Collaboration graph
[legend]

Public Member Functions

 SshFileIterator (std::shared_ptr< SshFileSystem > fs, const std::string &path)
 Constructor. More...
 
virtual ~SshFileIterator ()
 Destructor. More...
 
virtual std::unique_ptr< AbstractFileIteratorBackendclone () const override
 Create a copy of this iterator. More...
 
virtual AbstractFileSystemfs () const override
 Get file system. More...
 
virtual bool valid () const override
 Check if iterator points to a valid item. More...
 
virtual std::string path () const override
 Get path in file system on which the iterator operates. More...
 
virtual int index () const override
 Get current index of iterator in the directory. More...
 
virtual std::string name () const override
 Get name of current directory item. More...
 
virtual void next () override
 Advance to the next item. More...
 
- Public Member Functions inherited from cppfs::AbstractFileIteratorBackend
 AbstractFileIteratorBackend ()
 Constructor. More...
 
virtual ~AbstractFileIteratorBackend ()
 Destructor. More...
 

Protected Member Functions

void readNextEntry ()
 

Protected Attributes

std::shared_ptr< SshFileSystemm_fs
 File system that created this iterator. More...
 
std::string m_path
 Path to file or directory. More...
 
LIBSSH2_SFTP_HANDLE * m_dir
 Directory handle. More...
 
int m_index
 Current entry index. More...
 
std::string m_filename
 Current entry file name. More...
 
LIBSSH2_SFTP_ATTRIBUTES m_attrs
 Current entry attributes. More...
 

Detailed Description

File iterator for a remove file system accessed by SSH.

Constructor & Destructor Documentation

cppfs::SshFileIterator::SshFileIterator ( std::shared_ptr< SshFileSystem fs,
const std::string &  path 
)

Constructor.

Parameters
[in]fsFile system that created this iterator
[in]pathPath to file or directory
virtual cppfs::SshFileIterator::~SshFileIterator ( )
virtual

Destructor.

Member Function Documentation

virtual std::unique_ptr<AbstractFileIteratorBackend> cppfs::SshFileIterator::clone ( ) const
overridevirtual

Create a copy of this iterator.

Returns
File iterator

Implements cppfs::AbstractFileIteratorBackend.

virtual AbstractFileSystem* cppfs::SshFileIterator::fs ( ) const
overridevirtual

Get file system.

Returns
File system (must NOT be null)

Implements cppfs::AbstractFileIteratorBackend.

virtual bool cppfs::SshFileIterator::valid ( ) const
overridevirtual

Check if iterator points to a valid item.

Returns
'true' if valid, else 'false'

Implements cppfs::AbstractFileIteratorBackend.

virtual std::string cppfs::SshFileIterator::path ( ) const
overridevirtual

Get path in file system on which the iterator operates.

Returns
Path

Implements cppfs::AbstractFileIteratorBackend.

virtual int cppfs::SshFileIterator::index ( ) const
overridevirtual

Get current index of iterator in the directory.

Returns
Index, -1 if invalid

Implements cppfs::AbstractFileIteratorBackend.

virtual std::string cppfs::SshFileIterator::name ( ) const
overridevirtual

Get name of current directory item.

Returns
File name

Implements cppfs::AbstractFileIteratorBackend.

virtual void cppfs::SshFileIterator::next ( )
overridevirtual

Advance to the next item.

Implements cppfs::AbstractFileIteratorBackend.

void cppfs::SshFileIterator::readNextEntry ( )
protected

Member Data Documentation

std::shared_ptr<SshFileSystem> cppfs::SshFileIterator::m_fs
protected

File system that created this iterator.

std::string cppfs::SshFileIterator::m_path
protected

Path to file or directory.

LIBSSH2_SFTP_HANDLE* cppfs::SshFileIterator::m_dir
protected

Directory handle.

int cppfs::SshFileIterator::m_index
protected

Current entry index.

std::string cppfs::SshFileIterator::m_filename
protected

Current entry file name.

LIBSSH2_SFTP_ATTRIBUTES cppfs::SshFileIterator::m_attrs
protected

Current entry attributes.


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