ewmscp  ..
Public Member Functions | List of all members
genericSftpStat Class Reference

#include <libsshCommon.h>

Inheritance diagram for genericSftpStat:
[legend]
Collaboration diagram for genericSftpStat:
[legend]

Public Member Functions

 genericSftpStat (const sftp_attributes_struct &attrs, const sftp_statvfs_struct &vfsStat)
 
- Public Member Functions inherited from genericStat
 genericStat (const struct stat &statBuf, const clock_type::duration &aTimeResolution)
 
 genericStat (const struct stat64 &statBuf, const clock_type::duration &aTimeResolution)
 
 genericStat ()
 
void getAtime (struct timespec &spec) const
 
void getMtime (struct timespec &spec) const
 
void getAtime (struct timeval &spec) const
 
void getMtime (struct timeval &spec) const
 
void getAtime (std::string &spec) const
 
void getMtime (std::string &spec) const
 
clock_type::time_point getMtime () const
 
bool isNewerThan (const genericStat &that) const
 
bool isSameMtimeAs (const genericStat &that) const
 
bool isDir () const
 
bool isLink () const
 
bool isRegularFile () const
 

Additional Inherited Members

- Public Types inherited from genericStat
typedef std::chrono::system_clock clock_type
 
- Public Attributes inherited from genericStat
dev_t device
 
size_t size
 
size_t sizeOnDisk
 
size_t blksize
 
clock_type::time_point aTime
 
clock_type::time_point mTime
 
clock_type::duration timeResolution
 
mode_t mode
 
uid_t ownerUid
 
gid_t ownerGid
 

Detailed Description

Definition at line 16 of file libsshCommon.h.

Constructor & Destructor Documentation

◆ genericSftpStat()

genericSftpStat::genericSftpStat ( const sftp_attributes_struct &  attrs,
const sftp_statvfs_struct &  vfsStat 
)

Definition at line 10 of file libsshCommon.cpp.

11  {
12  device = vfsStat.f_fsid;
13  size = attrs.size;
14  sizeOnDisk = attrs.size;
15  blksize = vfsStat.f_bsize;
16  aTime = clock_type::time_point(std::chrono::seconds(attrs.atime)
17  + std::chrono::nanoseconds(attrs.atime_nseconds));
18  mTime = clock_type::time_point(std::chrono::seconds(attrs.mtime)
19  + std::chrono::nanoseconds(attrs.mtime_nseconds));
20  timeResolution = std::chrono::microseconds(1);
21  mode = attrs.permissions;
22  ownerUid = attrs.uid;
23  ownerGid = attrs.gid;
24 }

References genericStat::aTime, genericStat::blksize, genericStat::device, genericStat::mode, genericStat::mTime, genericStat::ownerGid, genericStat::ownerUid, genericStat::size, genericStat::sizeOnDisk, and genericStat::timeResolution.


The documentation for this class was generated from the following files:
genericStat::ownerGid
gid_t ownerGid
Definition: genericStat.h:24
genericStat::mode
mode_t mode
Definition: genericStat.h:22
genericStat::mTime
clock_type::time_point mTime
Definition: genericStat.h:20
genericStat::sizeOnDisk
size_t sizeOnDisk
Definition: genericStat.h:17
genericStat::aTime
clock_type::time_point aTime
Definition: genericStat.h:19
genericStat::blksize
size_t blksize
Definition: genericStat.h:18
genericStat::size
size_t size
Definition: genericStat.h:16
genericStat::device
dev_t device
Definition: genericStat.h:15
genericStat::timeResolution
clock_type::duration timeResolution
Definition: genericStat.h:21
genericStat::ownerUid
uid_t ownerUid
Definition: genericStat.h:23