ewmscp  ..
posixFileCommon.h
Go to the documentation of this file.
1 #ifndef __posixFileCommon_h__
2 #define __posixFileCommon_h__
3 #include "ioHandle.h"
4 #include "pathHandler.h"
5 #include <forward_list>
6 class posixFileCommon: virtual public pathHandler {
7  public:
8  bool pathExists(const std::string& path) override;
9  std::unique_ptr<const genericStat> getStat(const std::string& path,
10  bool followLink) override;
11  std::string getXattr(const std::string& path,
12  const std::string& name) override;
13 };
14 
17 class posixFileIoCommon: virtual public ioHandle {
18  friend class gpfsIoCommon;
19  protected:
20  const std::string& path;
21  int fd = -1;
22  public:
24  friend class gpfsIoCommon;
25  friend class posixFileIoCommon;
26  protected:
27  void fill(posixFileIoCommon& handler);
28  public:
29  ~attrDataType() override = default;
30  void add(const std::string& name, const std::string& value);
31  void set(ioHandle* handle) override;
32  };
33  posixFileIoCommon(const std::string& aPath);
34  void setXattr(const std::string& name, const std::string& value) override;
35  std::string getXattr(const std::string& name) override;
36  void removeXattr(const std::string& name) override;
37  std::unique_ptr<const genericStat> getStat() override;
38  std::unique_ptr<ioHandle::attrDataType> getAttrData(const outputHandler::base* aOutputHandler) override;
39 };
40 
41 #endif
ioHandle::attrDataType
class for asttribute data, abstract base to be implemented for specific handlers
Definition: ioHandle.h:22
posixFileCommon::getXattr
std::string getXattr(const std::string &path, const std::string &name) override
Definition: posixFileCommon.cpp:63
posixFileIoCommon::getStat
std::unique_ptr< const genericStat > getStat() override
Definition: posixFileCommon.cpp:116
posixFileIoCommon::attrDataType::fill
void fill(posixFileIoCommon &handler)
Definition: posixFileCommon.cpp:203
gpfsIoCommon
Definition: gpfsCommon.h:8
posixFileIoCommon::fd
int fd
Definition: posixFileCommon.h:21
posixFileIoCommon::setXattr
void setXattr(const std::string &name, const std::string &value) override
Definition: posixFileCommon.cpp:122
posixFileIoCommon::attrDataType::add
void add(const std::string &name, const std::string &value)
Definition: posixFileCommon.cpp:168
posixFileIoCommon::attrDataType
Definition: posixFileCommon.h:23
outputHandler::base
Definition: outputHandler.h:17
ioHandle.h
posixFileIoCommon::attrDataType::set
void set(ioHandle *handle) override
set this set of attributes on the file described by handle
Definition: posixFileCommon.cpp:171
posixFileIoCommon::removeXattr
void removeXattr(const std::string &name) override
Definition: posixFileCommon.cpp:153
posixFileCommon::getStat
std::unique_ptr< const genericStat > getStat(const std::string &path, bool followLink) override
Definition: posixFileCommon.cpp:30
pathHandler
Definition: pathHandler.h:6
posixFileIoCommon
base class for posixFile reader and writer class with the common stuff like fd, path and xattr handli...
Definition: posixFileCommon.h:17
pathHandler.h
posixFileCommon
Definition: posixFileCommon.h:6
posixFileCommon::pathExists
bool pathExists(const std::string &path) override
Definition: posixFileCommon.cpp:20
ioHandle
class as base for inputHandler::base::reader and outputHandler::base::writer containing the common pa...
Definition: ioHandle.h:15
posixFileIoCommon::getAttrData
std::unique_ptr< ioHandle::attrDataType > getAttrData(const outputHandler::base *aOutputHandler) override
get attributes in the optimal way for setting with aOutputHandler
Definition: posixFileCommon.cpp:205
posixFileIoCommon::posixFileIoCommon
posixFileIoCommon(const std::string &aPath)
Definition: posixFileCommon.cpp:110
posixFileIoCommon::getXattr
std::string getXattr(const std::string &name) override
get one extended attribute value
Definition: posixFileCommon.cpp:132
posixFileIoCommon::attrDataType::~attrDataType
~attrDataType() override=default
posixFileIoCommon::path
const std::string & path
Definition: posixFileCommon.h:20