LArSoft
v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
parent_path.cc
Go to the documentation of this file.
1
// parent_path
3
//
4
// Return the parent of the supplied path. If this was a filename
5
// without path, return "." otherwise return either the containing
6
// directory if the path represents a file; or the parent directory if
7
// the path represents a directory.
8
//
9
// This is a thin wrapper around boost::filesystem::path::parent_path().
11
#include "
art/Utilities/parent_path.h
"
12
#include "boost/filesystem.hpp"
13
14
std::string
15
art::parent_path
(std::string
const
& in_path)
16
{
17
using namespace
std::string_literals
;
18
std::string result;
19
boost::filesystem::path
parent_path
(
20
boost::filesystem::path(in_path).
parent_path
());
21
if
(parent_path.empty()) {
22
result =
"."
s;
23
}
else
{
24
result = parent_path.native();
25
}
26
return
result;
27
}
string_literals
art::parent_path
std::string parent_path(std::string const &path)
Definition:
parent_path.cc:15
parent_path.h
art
Utilities
parent_path.cc
Generated on Thu May 2 2024 20:59:30 for LArSoft by
1.8.11