LArSoft
v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
NameStackRegistry.cc
Go to the documentation of this file.
1
#include "
fhiclcpp/types/detail/NameStackRegistry.h
"
2
#include "
fhiclcpp/exception.h
"
3
#include <iostream>
4
#include <regex>
5
#include <string>
6
#include <vector>
7
8
namespace
fhicl
{
9
10
std::string
11
NameStackRegistry::full_key
(std::string
const
& name)
12
{
13
if
(name.empty()) {
14
throw
exception
{
error::other
,
"NameStackRegistry::full_key"
}
15
<<
"Cannot insert empty name into 'NameStackRegistry'.\n"
;
16
}
17
18
if
(
names_
.empty() ||
19
std::regex_match(name, std::regex{R
"(\[\d+\])"}))
// Sequence elements
20
names_
.emplace_back(name);
21
else
22
names_
.emplace_back(
"."
+ name);
23
return
std::accumulate(
names_
.begin(),
names_
.end(), std::string{});
24
}
25
}
26
27
// Local variables:
28
// mode: c++
29
// End:
NameStackRegistry.h
fhicl
parameter set interface
Definition:
ServiceProviderWrappers.h:37
fhicl::other
Definition:
exception.h:26
fhicl::NameStackRegistry::full_key
std::string full_key(std::string const &key)
Definition:
NameStackRegistry.cc:11
fhicl::NameStackRegistry::names_
std::vector< std::string > names_
Definition:
NameStackRegistry.h:85
fhicl::exception
cet::coded_exception< error, detail::translate > exception
Definition:
exception.h:33
exception.h
fhiclcpp
types
detail
NameStackRegistry.cc
Generated on Thu Jul 26 2018 13:09:45 for LArSoft by
1.8.11