OpenTREP Logo  0.07.18
C++ Open Travel Request Parsing Library
Loading...
Searching...
No Matches
BasFileMgr.cpp
Go to the documentation of this file.
1// //////////////////////////////////////////////////////////////////////
2// Import section
3// //////////////////////////////////////////////////////////////////////
4// STL
5#include <cassert>
6// Boost (STL Extension)
7// Boost Filesystem (http://www.boost.org/doc/libs/1_48_0/libs/filesystem/doc/index.htm)
8#include <boost/version.hpp>
9#if BOOST_VERSION >= 103500
10#include <boost/filesystem.hpp>
11#else // BOOST_VERSION >= 103500
12#include <boost/filesystem/path.hpp>
13#include <boost/filesystem/operations.hpp>
14#endif // BOOST_VERSION >= 103500
15// Opentrep
17
18namespace boostfs = boost::filesystem;
19
20namespace OPENTREP {
21
22 // //////////////////////////////////////////////////////////////////////
23 bool BasFileMgr::doesExistAndIsReadable (const std::string& iFilepath) {
24 bool oFine = false;
25
26 boostfs::path lPath (iFilepath);
27
28 if (boostfs::exists (lPath) == false) {
29 return oFine;
30 }
31
32#if BOOST_VERSION >= 103500
33 if (boostfs::is_regular_file (lPath) == true) {
34 oFine = true;
35 }
36#endif // BOOST_VERSION >= 103500
37
38 return oFine;
39 }
40
41}
static bool doesExistAndIsReadable(const std::string &iFilepath)