OpenTREP Logo  0.6.0
C++ Open Travel Request Parsing Library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ServiceUtilities.cpp
Go to the documentation of this file.
1 // //////////////////////////////////////////////////////////////////////
2 // Import section
3 // //////////////////////////////////////////////////////////////////////
4 // STL
5 #include <cassert>
6 // Boost::Filesystem
7 #include <boost/filesystem.hpp>
8 // OpenTREP
11 
12 namespace OPENTREP {
13 
14  // //////////////////////////////////////////////////////////////////////
15  bool ServiceUtilities::isDirectory (const std::string& iPath) {
16  bool oIsDirectory = false;
17 
18  if (boost::filesystem::exists (iPath) == true) {
19 
20  if (boost::filesystem::is_directory (iPath) == true) {
21  oIsDirectory = true;
22 
23  } else {
24  OPENTREP_LOG_ERROR (iPath << " exists, but is not a directory");
25  }
26 
27  } else {
28  OPENTREP_LOG_ERROR (iPath << " does not exist");
29  }
30 
31  return oIsDirectory;
32  }
33 
34 }
#define OPENTREP_LOG_ERROR(iToBeLogged)
Definition: Logger.hpp:23
static bool isDirectory(const std::string &iPath)