ewmscp  ..
Public Member Functions | Private Attributes | List of all members
inputHandler::davix::DavixDirectory Class Reference

#include <inputHandlerDavix.h>

Inheritance diagram for inputHandler::davix::DavixDirectory:
[legend]
Collaboration diagram for inputHandler::davix::DavixDirectory:
[legend]

Public Member Functions

 DavixDirectory (const std::string &aPath, davixCommon &aHandler)
 
 ~DavixDirectory () noexcept(false) override
 
std::unique_ptr< EntrygetNextEntry (bool ignoreMissing) override
 
- Public Member Functions inherited from inputHandler::base::Directory
 Directory (const std::string &aPath)
 
virtual ~Directory () noexcept(false)
 

Private Attributes

DAVIX_DIR * dir
 
davixCommonhandler
 

Additional Inherited Members

- Protected Member Functions inherited from unwindCheck
 unwindCheck ()=default
 
 ~unwindCheck ()=default
 
bool isUnwinding () const
 
- Protected Attributes inherited from inputHandler::base::Directory
const std::string path
 

Detailed Description

Definition at line 33 of file inputHandlerDavix.h.

Constructor & Destructor Documentation

◆ DavixDirectory()

inputHandler::davix::DavixDirectory::DavixDirectory ( const std::string &  aPath,
davixCommon aHandler 
)

Definition at line 28 of file inputHandlerDavix.cpp.

28  :
29  Directory(aPath),
30  handler(aHandler) {
31  errorReport report(__func__, "opendirpp", path);
32  dir = handler.posix.opendirpp(&handler.params, path, report);
33  if (dir == nullptr) {
34  report.throwUp();
35  }
36  }

References dir, handler, davixCommon::params, inputHandler::base::Directory::path, davixCommon::posix, and errorReport::throwUp().

Here is the call graph for this function:

◆ ~DavixDirectory()

inputHandler::davix::DavixDirectory::~DavixDirectory ( )
overridenoexcept

Definition at line 37 of file inputHandlerDavix.cpp.

37  {
38  errorReport report(__func__, "closedirpp", path);
39  if (handler.posix.closedirpp(dir, report)) {
40  if (isUnwinding()) {
42  path, "close directory during unwind ",
43  report.getMessage());
44  } else {
45  report.throwUp();
46  }
47  }
48  }

References errMsg::debug, errMsg::emit(), errorReport::getMessage(), and errorReport::throwUp().

Here is the call graph for this function:

Member Function Documentation

◆ getNextEntry()

std::unique_ptr< base::Directory::Entry > inputHandler::davix::DavixDirectory::getNextEntry ( bool  ignoreMissing)
overridevirtual

Implements inputHandler::base::Directory.

Definition at line 49 of file inputHandlerDavix.cpp.

49  {
50  errorReport report(__func__, "readdirpp", path);
51  struct stat statbuf;
52  auto entry = handler.posix.readdirpp(dir, &statbuf, report);
53  if (entry == nullptr) {
54  return nullptr;
55  }
56  auto genstat = std::unique_ptr<const genericStat>(new genericStat(statbuf, std::chrono::seconds(1)));
57  return std::unique_ptr<Entry>(new Entry(entry->d_name, genstat));
58  }

Member Data Documentation

◆ dir

DAVIX_DIR* inputHandler::davix::DavixDirectory::dir
private

Definition at line 34 of file inputHandlerDavix.h.

Referenced by DavixDirectory().

◆ handler

davixCommon& inputHandler::davix::DavixDirectory::handler
private

Definition at line 35 of file inputHandlerDavix.h.

Referenced by DavixDirectory().


The documentation for this class was generated from the following files:
errMsg::location
class for defining the location of a error message in the source code.
Definition: errMsgQueue.h:14
unwindCheck::isUnwinding
bool isUnwinding() const
Definition: unwindCheck.h:19
genericStat
generic stat abstraction class Used to abstract the variants of the stat structure.
Definition: genericStat.h:12
inputHandler::davix::DavixDirectory::handler
davixCommon & handler
Definition: inputHandlerDavix.h:35
errMsg::level::debug
@ debug
inputHandler::base::Directory::Directory
Directory(const std::string &aPath)
Definition: inputHandler.h:183
errorReport
class for easy error handling with davix ensures proper cleanup of the error report when going out of...
Definition: davixCommon.h:12
davixCommon::posix
Davix::DavPosix posix
Definition: davixCommon.h:198
inputHandler::base::Directory::path
const std::string path
Definition: inputHandler.h:161
errMsg::emit
void emit(level aLogLevel, const location &loc, const std::string &aObject, const std::string &aAction, const Args &... args)
function to create and enqueue a message, this is the only way that messages should be created!
Definition: errMsgQueue.h:148
inputHandler::davix::DavixDirectory::dir
DAVIX_DIR * dir
Definition: inputHandlerDavix.h:34
davixCommon::params
Davix::RequestParams params
Definition: davixCommon.h:197