Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
fhiclcpp
fhiclcpp
test
to_indented_string_prefix_annotated_test.cc
Go to the documentation of this file.
1
// ======================================================================
2
//
3
// test of to_indented_string with prefixed annotations
4
//
5
// ======================================================================
6
7
#include "
fhiclcpp/ParameterSet.h
"
8
9
#include <iostream>
10
#include <string>
11
12
int
13
main
()
14
{
15
16
// Configuration file lookup policy.
17
char
const
* fhicl_env =
getenv
(
"FHICL_FILE_PATH"
);
18
std::string
search_path;
19
if
(fhicl_env ==
nullptr
) {
20
std::cerr <<
"Expected environment variable FHICL_FILE_PATH is "
21
<<
"missing or empty: using \".\"\n"
;
22
search_path =
".:"
;
23
}
else
{
24
search_path =
std::string
(fhicl_env) +
":"
;
25
}
26
27
cet::filepath_lookup
policy(search_path);
28
std::string
const
in{
"to_indented_string_annotated_test.fcl"
};
29
30
auto
pset =
fhicl::ParameterSet::make
(in, policy);
31
32
pset.put<
int
>(
"another_number"
, 4);
33
pset.put_or_replace<
int
>(
"some_number"
, 8);
34
pset.put_or_replace<
double
>(
"double"
, 234.6);
35
36
std::cout << pset.to_indented_string(
37
0,
fhicl::detail::print_mode::prefix_annotated
)
38
<<
std::endl
;
39
}
string
std::string string
Definition:
nybbler.cc:12
fhicl::ParameterSet::make
static ParameterSet make(intermediate_table const &tbl)
Definition:
ParameterSet.cc:68
ParameterSet.h
fhicl::detail::print_mode::prefix_annotated
cet::filepath_lookup
Definition:
filepath_maker.h:52
cet::getenv
std::string getenv(std::string const &name)
Definition:
getenv.cc:15
main
int main()
Definition:
to_indented_string_prefix_annotated_test.cc:13
endl
QTextStream & endl(QTextStream &s)
Definition:
qtextstream.cpp:2030
Generated by
1.8.11