Joedb 9.1.4
The Journal-Only Embedded Database
Loading...
Searching...
No Matches
SFTP_File.h
Go to the documentation of this file.
1#ifndef joedb_ssh_SFTP_File_declared
2#define joedb_ssh_SFTP_File_declared
3
4#include "joedb/ssh/SFTP.h"
5
6namespace joedb
7{
8 namespace ssh
9 {
10 ////////////////////////////////////////////////////////////////////////////
12 ////////////////////////////////////////////////////////////////////////////
13 {
14 private:
15 const sftp_file file;
16
17 public:
18 SFTP_File(SFTP &sftp, const char *name, int access_type, mode_t mode):
19 file
20 (
21 sftp_open
22 (
23 sftp.get(),
24 name,
25 access_type,
26 mode
27 )
28 )
29 {
30 if (file == nullptr)
31 sftp.throw_error();
32 }
33
34 sftp_file get() const
35 {
36 return file;
37 }
38
40 {
41 sftp_close(file);
42 }
43 };
44 }
45}
46
47#endif
void throw_error(const char *message="sftp error: ") const
Definition SFTP.cpp:28
sftp_file get() const
Definition SFTP_File.h:34
SFTP_File(SFTP &sftp, const char *name, int access_type, mode_t mode)
Definition SFTP_File.h:18
Definition Blob.h:7