ewmscp  ..
Public Member Functions | Protected Attributes | List of all members
dcapIoCommon Class Reference

#include <dcapCommon.h>

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

Public Member Functions

 dcapIoCommon (const std::string &aPath)
 
std::unique_ptr< const genericStatgetStat () override
 
- Public Member Functions inherited from ioHandle
 ioHandle ()
 
virtual ~ioHandle () noexcept(false)
 
virtual bool parallelizable () const
 tell if this handler is capable of parallel IO. Unsually not the case More...
 
virtual void setXattr (const std::string &, const std::string &)
 
virtual std::string getXattr (const std::string &)
 get one extended attribute value More...
 
virtual void removeXattr (const std::string &)
 
virtual size_t getBlockSize () const
 
virtual void setBlockSize (size_t newSize)
 
virtual std::unique_ptr< attrDataTypegetAttrData (const outputHandler::base *)
 get attributes in the optimal way for setting with aOutputHandler More...
 
virtual std::unique_ptr< acl::listgetAclData ()
 get acls More...
 

Protected Attributes

const std::string path
 
int fd = -1
 
- Protected Attributes inherited from ioHandle
size_t blockSize
 in bytes, block size to be used when reading or writing More...
 

Detailed Description

Definition at line 74 of file dcapCommon.h.

Constructor & Destructor Documentation

◆ dcapIoCommon()

dcapIoCommon::dcapIoCommon ( const std::string &  aPath)

Definition at line 181 of file dcapCommon.cpp.

181  :
182  path(dcapCommon::fixPathUrl(aPath)) {
183 }

Member Function Documentation

◆ getStat()

std::unique_ptr< const genericStat > dcapIoCommon::getStat ( )
overridevirtual

Implements ioHandle.

Definition at line 189 of file dcapCommon.cpp.

189  {
190  dCapLock extraOptionLock;
191  struct dcapStat statBuf;
192  throwcall::dcap::good0(dc_fstat(fd, &statBuf), "can't stat", path);
193  return std::unique_ptr<const genericStat>(new genericStat(statBuf, std::chrono::seconds(1)));
194 }

References dcapStat, fd, throwcall::dcap::good0(), and path.

Here is the call graph for this function:

Member Data Documentation

◆ fd

int dcapIoCommon::fd = -1
protected

◆ path

const std::string dcapIoCommon::path
protected

The documentation for this class was generated from the following files:
dCapLock
Definition: dcapCommon.h:40
genericStat
generic stat abstraction class Used to abstract the variants of the stat structure.
Definition: genericStat.h:12
dcapStat
#define dcapStat
Definition: dcapCommon.h:7
dcapIoCommon::path
const std::string path
Definition: dcapCommon.h:76
dcapCommon::fixPathUrl
static std::string fixPathUrl(const std::string &path)
Definition: dcapCommon.cpp:127
throwcall::dcap::good0
void good0(T call, const Args &... args)
Definition: dcapCommon.h:21
dcapIoCommon::fd
int fd
Definition: dcapCommon.h:77