Skip to content

Commit 1c9bfec

Browse files
committed
[rfile] Move DecomposePath into Detail
1 parent 6b4c55c commit 1c9bfec

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

io/io/inc/ROOT/RFile.hxx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ ROOT::RLogChannel &RFileLog();
3232

3333
} // namespace Internal
3434

35+
namespace Detail {
36+
3537
/// Given a "path-like" string (like foo/bar/baz), returns a pair `{ dirName, baseName }`.
3638
/// `baseName` will be empty if the string ends with '/'.
3739
/// `dirName` will be empty if the string contains no '/'.
@@ -42,6 +44,8 @@ ROOT::RLogChannel &RFileLog();
4244
/// This function does not perform any copy: the returned string_views have the same lifetime as `path`.
4345
std::pair<std::string_view, std::string_view> DecomposePath(std::string_view path);
4446

47+
}
48+
4549
class RFileKeyIterable;
4650

4751
/**
@@ -75,7 +79,7 @@ public:
7579
/// Returns the absolute path of this key, i.e. the directory part plus the object name.
7680
const std::string &GetPath() const { return fPath; }
7781
/// Returns the base name of this key, i.e. the name of the object without the directory part.
78-
std::string GetBaseName() const { return std::string(DecomposePath(fPath).second); }
82+
std::string GetBaseName() const { return std::string(Detail::DecomposePath(fPath).second); }
7983
const std::string &GetTitle() const { return fTitle; }
8084
const std::string &GetClassName() const { return fClassName; }
8185
std::uint16_t GetCycle() const { return fCycle; }

io/io/src/RFile.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ static void EnsureFileOpenAndBinary(const TFile *tfile, std::string_view path)
179179
}
180180

181181
/////////////////////////////////////////////////////////////////////////////////////////////////
182-
std::pair<std::string_view, std::string_view> ROOT::Experimental::DecomposePath(std::string_view path)
182+
std::pair<std::string_view, std::string_view> ROOT::Experimental::Detail::DecomposePath(std::string_view path)
183183
{
184184
auto lastSlashIdx = path.rfind('/');
185185
if (lastSlashIdx == std::string_view::npos)

io/io/test/rfile.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ static std::string JoinKeyNames(const ROOT::Experimental::RFileKeyIterable &iter
5656

5757
TEST(RFile, DecomposePath)
5858
{
59-
using ROOT::Experimental::DecomposePath;
59+
using ROOT::Experimental::Detail::DecomposePath;
6060

6161
auto Pair = [](std::string_view a, std::string_view b) { return std::make_pair(a, b); };
6262

0 commit comments

Comments
 (0)