ewmscp  ..
inputHandlerLibssh.h
Go to the documentation of this file.
1 #ifndef __inputHandlerLibssh_h__
2 #define __inputHandlerLibssh_h__
3 #include "inputHandler.h"
4 #include "libsshCommon.h"
5 #include <deque>
6 #include <dirent.h>
7 #include <string>
8 #include <sys/stat.h>
9 #include <sys/types.h>
10 
11 
12 namespace inputHandler {
13 
14  class libssh: public base, virtual public libsshCommon {
16  public:
17 
18  class readerLibssh: public reader, virtual public libsshIoCommon {
19  protected:
20 
21  public:
22  readerLibssh(const std::string& aPath,
23  libsshCommon& aHandler,
25  const genericStat& inititalStat);
26  ~readerLibssh() override;
27  void seek(size_t pos) override;
28  bool readBlock(block &b) override;
29  void checkUnchangedness() override;
30  };
31  libssh();
32  ~libssh() override = default;
33  std::unique_ptr<reader> newReader(const std::string& aPath,
35  const genericStat& inititalStat) override;
36  bool readLinkTarget(const std::string& path,
37  std::vector<char>& target) override;
38 
39 
40  class SftpDirectory: public Directory {
42  sftp_dir dir;
43  public:
44  SftpDirectory(libsshCommon& aHandler,
45  const std::string& aPath);
46  ~SftpDirectory() noexcept(false) override;
47  std::unique_ptr<Entry> getNextEntry(bool ignoreMissing) override;
48  };
49  std::unique_ptr<Directory> getDirectory(const std::string& path) override;
50 
51  };
52 
53 } // end namespace inputHandler
54 #endif
inputHandler::libssh::readerLibssh::checkUnchangedness
void checkUnchangedness() override
Definition: inputHandlerLibssh.cpp:138
inputHandler::libssh::libssh
libssh()
Definition: inputHandlerLibssh.cpp:20
inputHandler::libssh::newReader
std::unique_ptr< reader > newReader(const std::string &aPath, copyRequest::stateType &state, const genericStat &inititalStat) override
get a reader for the file at path
Definition: inputHandlerLibssh.cpp:24
inputHandler
Definition: inputHandler.h:29
inputHandler::libssh::SftpDirectory::~SftpDirectory
~SftpDirectory() noexcept(false) override
Definition: inputHandlerLibssh.cpp:167
genericStat
generic stat abstraction class Used to abstract the variants of the stat structure.
Definition: genericStat.h:12
libsshCommon
Definition: libsshCommon.h:25
libsshCommon.h
inputHandler::libssh::SftpDirectory::handler
libsshCommon & handler
Definition: inputHandlerLibssh.h:41
inputHandler::base::factoryTemplate
Definition: inputHandler.h:55
copyRequest::stateType
Definition: copyRequestTypes.h:66
libsshIoCommon
Definition: libsshCommon.h:56
inputHandler::libssh::readLinkTarget
bool readLinkTarget(const std::string &path, std::vector< char > &target) override
read link target from a symlink
Definition: inputHandlerLibssh.cpp:34
block
data block, used to hold the data that are being copied (or checksummed).
Definition: block.h:7
inputHandler::libssh::readerLibssh
Definition: inputHandlerLibssh.h:18
inputHandler::libssh::getDirectory
std::unique_ptr< Directory > getDirectory(const std::string &path) override
Definition: inputHandlerLibssh.cpp:194
inputHandler::libssh::readerLibssh::seek
void seek(size_t pos) override
Definition: inputHandlerLibssh.cpp:92
inputHandler::base
class for handling input This is the (abstract) base class for handling input, both reading a file vi...
Definition: inputHandler.h:35
inputHandler::libssh::readerLibssh::~readerLibssh
~readerLibssh() override
Definition: inputHandlerLibssh.cpp:73
inputHandler::libssh::SftpDirectory
Definition: inputHandlerLibssh.h:40
inputHandler::libssh::SftpDirectory::dir
sftp_dir dir
Definition: inputHandlerLibssh.h:42
inputHandler::libssh::readerLibssh::readBlock
bool readBlock(block &b) override
Definition: inputHandlerLibssh.cpp:97
inputHandler::libssh::factory
static factoryTemplate< libssh > factory
Definition: inputHandlerLibssh.h:15
inputHandler::libssh
Definition: inputHandlerLibssh.h:14
inputHandler::libssh::~libssh
~libssh() override=default
inputHandler::libssh::SftpDirectory::getNextEntry
std::unique_ptr< Entry > getNextEntry(bool ignoreMissing) override
Definition: inputHandlerLibssh.cpp:180
inputHandler::libssh::SftpDirectory::SftpDirectory
SftpDirectory(libsshCommon &aHandler, const std::string &aPath)
Definition: inputHandlerLibssh.cpp:159
inputHandler::libssh::readerLibssh::readerLibssh
readerLibssh(const std::string &aPath, libsshCommon &aHandler, copyRequest::stateType &state, const genericStat &inititalStat)
Definition: inputHandlerLibssh.cpp:57
inputHandler.h