This commit is contained in:
Pedro Pinto committed 2017-08-07 17:21:12 -04:00
commit 950e7b7e2d
350 files changed
+38599

No files matched your search

+25
View File
@@ -0,0 +1,25 @@
#include "file_utils.h"
#include "lib/os/os.h"
#include "bts_assert.h"
#include <boost/filesystem.hpp>
#include <boost/algorithm/string/predicate.hpp>
#include <boost/algorithm/string/replace.hpp>
namespace bts {
namespace utils {
void create_if_not_there (std::string const &path)
{
if (!boost::filesystem::exists (path))
bts_assert_msg (boost::filesystem::create_directories (path), "Unable to create directory");
}
std::string normalize_data_path (std::string const &input_path)
{
std::string result (input_path);
boost::algorithm::replace_first (result,"$data_path", os::bts_data_path ());
return result;
}
}}