Functions
to_indented_string_prefix_annotated_test.cc File Reference
#include "fhiclcpp/ParameterSet.h"
#include <iostream>
#include <string>

Go to the source code of this file.

Functions

int main ()
 

Function Documentation

int main ( void  )

Definition at line 13 of file to_indented_string_prefix_annotated_test.cc.

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(
38  << std::endl;
39 }
std::string string
Definition: nybbler.cc:12
static ParameterSet make(intermediate_table const &tbl)
Definition: ParameterSet.cc:68
std::string getenv(std::string const &name)
Definition: getenv.cc:15
QTextStream & endl(QTextStream &s)