Classes | |
| struct | RootObjNode |
| struct | RootObjTree |
| A representation of all objects involved in a rootls-style ROOT file listing. More... | |
| struct | RootSource |
Typedefs | |
| using | NodeIdx_t = std::uint32_t |
Enumerations | |
| enum | EGetMatchingPathsFlags { kRecursive = 1 << 0 , kIgnoreFailedMatches = 1 << 1 , kOpenFilesAsWritable = 1 << 2 } |
| enum class | ENodeFullPathOpt { kExcludeFilename , kIncludeFilename } |
Functions | |
| RootSource | GetMatchingPathsInFile (std::string_view fileName, std::string_view pattern, std::uint32_t flags) |
| Given a file and a "path pattern", returns a RootSource containing the tree of matched objects. | |
| RootObjNode | NodeFromKey (TKey &key) |
| std::string | NodeFullPath (const RootObjTree &tree, NodeIdx_t nodeIdx, ENodeFullPathOpt opt) |
| Given a node, returns its full path. If opt == kIncludeFilename, the path is prepended by "filename.root:". | |
| RootSource | ParseRootSource (std::string_view sourceRaw, std::uint32_t flags) |
| Given a string like "file.root:dir/obj", converts it to a RootSource. | |
| std::vector< ROOT::CmdLine::RootSource > | ParseRootSources (const std::vector< std::string > &sourcesRaw, std::uint32_t flags) |
| Given a list of strings like "file.root:dir/obj", converts each string to a RootSource. | |
| void | PrintObjTree (const RootObjTree &tree, std::ostream &out=std::cout) |
| Prints out the structure of the object tree. Helpful for debugging. | |
| ROOT::RResult< std::pair< std::string_view, std::string_view > > | SplitIntoFileNameAndPattern (std::string_view sourceRaw) |
| Given a string like "root://file.root:a/b/c", splits it into { "root://file.root", "a/b/c" }. | |
| using ROOT::CmdLine::NodeIdx_t = std::uint32_t |
Definition at line 29 of file RootObjTree.hxx.
| Enumerator | ||
|---|---|---|
| kRecursive | 1 << 0 | Recurse into subdirectories when matching objects. |
| kIgnoreFailedMatches | 1 << 1 | |
| kOpenFilesAsWritable | 1 << 2 | |
Definition at line 105 of file RootObjTree.hxx.
|
strong |
| Enumerator | |
|---|---|
| kExcludeFilename | |
| kIncludeFilename | |
Definition at line 92 of file RootObjTree.hxx.
| ROOT::CmdLine::RootSource ROOT::CmdLine::GetMatchingPathsInFile | ( | std::string_view | fileName, |
| std::string_view | pattern, | ||
| std::uint32_t | flags ) |
Given a file and a "path pattern", returns a RootSource containing the tree of matched objects.
If pattern is non-empty, not a single '*' and it doesn't match any object in fileName, an error will be appended to RootSource::fErrors unless kIgnoreFailedMatches is part of flags.
| fileName | The name of the ROOT file to look into |
| pattern | A glob-like pattern (basically a ls pattern). May be empty to match anything. |
| flags | A bitmask of EGetMatchingPathsFlags |
Definition at line 26 of file RootObjTree.cxx.
|
inline |
Definition at line 45 of file RootObjTree.hxx.
| std::string ROOT::CmdLine::NodeFullPath | ( | const RootObjTree & | tree, |
| NodeIdx_t | nodeIdx, | ||
| ENodeFullPathOpt | opt ) |
Given a node, returns its full path. If opt == kIncludeFilename, the path is prepended by "filename.root:".
Definition at line 254 of file RootObjTree.cxx.
| ROOT::CmdLine::RootSource ROOT::CmdLine::ParseRootSource | ( | std::string_view | sourceRaw, |
| std::uint32_t | flags ) |
Given a string like "file.root:dir/obj", converts it to a RootSource.
As a result of a successful call, a ROOT file is opened and may be accessed from RootSource::fObjectTree.fFile. Note that the file will not be registered to the global list and doesn't have to be explicitly closed, being stored in a unique_ptr.
The string may start with one of the known file protocols: "http", "https", "root", "gs", "s3" (e.g. "https://file.root").
If the source fails to get created, its fErrors list will be non-empty.
| flags | A bitmask of EGetMatchingPathsFlags |
Definition at line 181 of file RootObjTree.cxx.
| std::vector< ROOT::CmdLine::RootSource > ROOT::CmdLine::ParseRootSources | ( | const std::vector< std::string > & | sourcesRaw, |
| std::uint32_t | flags ) |
Given a list of strings like "file.root:dir/obj", converts each string to a RootSource.
The string may start with one of the known file protocols: "http", "https", "root", "gs", "s3" (e.g. "https://file.root").
If one or more sources fail to get created, each sources's fErrors list will be non-empty.
| flags | A bitmask of EGetMatchingPathsFlags |
Definition at line 199 of file RootObjTree.cxx.
| void ROOT::CmdLine::PrintObjTree | ( | const RootObjTree & | tree, |
| std::ostream & | out = std::cout ) |
Prints out the structure of the object tree. Helpful for debugging.
Definition at line 211 of file RootObjTree.cxx.
| ROOT::RResult< std::pair< std::string_view, std::string_view > > ROOT::CmdLine::SplitIntoFileNameAndPattern | ( | std::string_view | sourceRaw | ) |
Given a string like "root://file.root:a/b/c", splits it into { "root://file.root", "a/b/c" }.
Definition at line 150 of file RootObjTree.cxx.