27#ifndef FICHIER_LIBSSH_HPP
28#define FICHIER_LIBSSH_HPP
31#include "../my_config.h"
59 class fichier_libssh :
public fichier_global
64 fichier_libssh(
const std::shared_ptr<user_interaction> & dialog,
65 const std::shared_ptr<libssh_connection> & ptr,
66 const std::string & chemin,
73 fichier_libssh(
const fichier_libssh & ref) =
delete;
76 fichier_libssh(fichier_libssh && ref)
noexcept =
delete;
79 fichier_libssh & operator = (
const fichier_libssh & ref) =
delete;
82 fichier_libssh & operator = (fichier_libssh && ref)
noexcept =
delete;
89 virtual void change_ownership(
const std::string & user,
const std::string & group)
override
90 {
throw Efeature(gettext(
"user/group ownership not implemented for this repository")); };
94 virtual void change_permission(U_I perm)
override;
97 virtual infinint get_size()
const override;
100 virtual void fadvise(advise adv)
const override {};
103 virtual bool skippable(skippability direction,
const infinint & amount)
override;
104 virtual bool skip(
const infinint & pos)
override;
105 virtual bool skip_to_eof()
override;
106 virtual bool skip_relative(S_I x)
override;
107 virtual bool truncatable(
const infinint & pos)
const override;
108 virtual infinint get_position()
const override;
112 virtual void inherited_truncate(
const infinint & pos)
override;
113 virtual void inherited_read_ahead(
const infinint & amount)
override;
114 virtual void inherited_sync_write()
override {};
115 virtual void inherited_flush_read()
override {};
116 virtual void inherited_terminate()
override { myclose(); };
119 virtual U_I fichier_global_inherited_write(
const char *a, U_I size)
override;
120 virtual bool fichier_global_inherited_read(
char *a, U_I size, U_I & read, std::string & message)
override;
123 std::shared_ptr<libssh_connection> connect;
126 infinint current_pos;
134 rahead(): handle(nullptr) {};
135 rahead(
const rahead & ref) =
delete;
136 rahead(rahead && ref)
noexcept { handle = ref.handle; ref.handle =
nullptr; };
137 rahead & operator = (
const rahead & ref) =
delete;
138 rahead & operator = (rahead && ref)
noexcept { std::swap(handle, ref.handle);
return *
this; };
139 ~rahead() {
if(handle !=
nullptr) sftp_aio_free(handle); };
142 static const U_I read_ahead_window_size = 100*1024*1024;
147 std::deque<rahead> rareq;
158 void clear_readahead() { rareq.clear(); ralu = rasize = 0; };
159 void update_aio_reqs();
166 void check_pos_from_libssh();
thin C++ adaptation layer to Cygwin specifities
class fichier_global definition. This class is a pure virtual class class fichier_global is an abstra...
gf_mode
generic_file openning modes
are defined here basic integer types that tend to be portable
class holding libssh related data structure for an ssh and sftp session
libdar namespace encapsulate all libdar symbols
defines the interaction interface between libdar and users.