Functions
coding.cc File Reference
#include "fhiclcpp/coding.h"
#include "cetlib/canonical_number.h"
#include "cetlib/canonical_string.h"
#include "fhiclcpp/ParameterSet.h"
#include "fhiclcpp/ParameterSetRegistry.h"
#include <cstddef>
#include <cstdlib>
#include <limits>
#include <stdexcept>

Go to the source code of this file.

Functions

static std::string canon_nil ()
 
static ps_atom_t literal_true ()
 
static ps_atom_t literal_false ()
 
static ps_atom_t literal_infinity ()
 
static void atom_rep (any const &a, std::string &result)
 

Function Documentation

static void atom_rep ( any const &  a,
std::string result 
)
static

Definition at line 58 of file coding.cc.

59 {
60  if (is_table(a))
61  throw fhicl::exception(type_mismatch, "can't obtain atom from table");
62  if (is_sequence(a))
63  throw fhicl::exception(type_mismatch, "can't obtain atom from sequence");
64 
65  result = any_cast<std::string>(a);
66 #if 0
67  if( result.size() >= 2 && result[0] == '\"' && result.end()[-1] == '\"' )
68  result = cet::unescape( result.substr(1, result.size()-2) );
69 #endif // 0
70 }
static QCString result
std::string string
Definition: nybbler.cc:12
uint size() const
Definition: qcstring.h:201
std::string unescape(std::string const &str)
const double a
bool is_table(std::any const &val)
Definition: coding.h:55
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
bool is_sequence(std::any const &val)
Definition: coding.h:49
static std::string canon_nil ( )
inlinestatic

Definition at line 30 of file coding.cc.

31 {
32  static std::string const canon_nil(9, '\0');
33  return canon_nil;
34 }
std::string string
Definition: nybbler.cc:12
static std::string canon_nil()
Definition: coding.cc:30
static ps_atom_t literal_false ( )
inlinestatic

Definition at line 44 of file coding.cc.

45 {
46  static std::string literal_false("false");
47  return literal_false;
48 }
std::string string
Definition: nybbler.cc:12
static ps_atom_t literal_false()
Definition: coding.cc:44
static ps_atom_t literal_infinity ( )
inlinestatic

Definition at line 51 of file coding.cc.

52 {
53  static std::string literal_infinity("infinity");
54  return literal_infinity;
55 }
std::string string
Definition: nybbler.cc:12
static ps_atom_t literal_infinity()
Definition: coding.cc:51
static ps_atom_t literal_true ( )
inlinestatic

Definition at line 37 of file coding.cc.

38 {
39  static std::string literal_true("true");
40  return literal_true;
41 }
std::string string
Definition: nybbler.cc:12
static ps_atom_t literal_true()
Definition: coding.cc:37