The Gaudi Framework
master (bdbe7744)
Toggle main menu visibility
Loading...
Searching...
No Matches
ParsersStandardSingle.cpp
Go to the documentation of this file.
1
/***********************************************************************************\
2
* (c) Copyright 1998-2026 CERN for the benefit of the LHCb and ATLAS collaborations *
3
* *
4
* This software is distributed under the terms of the Apache version 2 licence, *
5
* copied verbatim in the file "LICENSE". *
6
* *
7
* In applying this licence, CERN does not waive the privileges and immunities *
8
* granted to it by virtue of its status as an Intergovernmental Organization *
9
* or submit itself to any jurisdiction. *
10
\***********************************************************************************/
17
#ifndef __clang__
18
# pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
19
#endif
20
21
#include <
Gaudi/Parsers/CommonParsers.h
>
22
#include <
Gaudi/Parsers/Factory.h
>
23
#include <nlohmann/json.hpp>
24
#include <string>
25
#include <string_view>
26
#include <utility>
27
28
#define PARSERS_DEF_FOR_SINGLE( Type ) \
29
StatusCode Gaudi::Parsers::parse( Type& result, std::string_view input ) { \
30
return Gaudi::Parsers::parse_( result, input ); \
31
}
32
33
PARSERS_DEF_FOR_SINGLE
(
bool
)
34
PARSERS_DEF_FOR_SINGLE
(
char
)
35
PARSERS_DEF_FOR_SINGLE
(
unsigned
char
)
36
PARSERS_DEF_FOR_SINGLE
(
signed
char
)
37
PARSERS_DEF_FOR_SINGLE
(
int
)
38
PARSERS_DEF_FOR_SINGLE
(
short
)
39
PARSERS_DEF_FOR_SINGLE
(
unsigned
short
)
40
PARSERS_DEF_FOR_SINGLE
(
unsigned
int
)
41
PARSERS_DEF_FOR_SINGLE
(
long
)
42
PARSERS_DEF_FOR_SINGLE
(
unsigned
long
)
43
PARSERS_DEF_FOR_SINGLE
(
long
long
)
44
PARSERS_DEF_FOR_SINGLE
(
unsigned
long
long
)
45
PARSERS_DEF_FOR_SINGLE
(
double
)
46
PARSERS_DEF_FOR_SINGLE
(
float
)
47
PARSERS_DEF_FOR_SINGLE
(
long
double
)
48
PARSERS_DEF_FOR_SINGLE
( std::string )
49
50
StatusCode
Gaudi::Parsers::parse
( nlohmann::json& result, std::string_view input ) {
51
auto
parsed = nlohmann::json::parse( input,
nullptr
,
false
);
52
if
( parsed.is_discarded() )
return
StatusCode::FAILURE
;
53
result = std::move( parsed );
54
return
StatusCode::SUCCESS
;
55
}
CommonParsers.h
The declaration of major parsing functions used e.g for (re)implementation of new extended properties...
Factory.h
PARSERS_DEF_FOR_SINGLE
#define PARSERS_DEF_FOR_SINGLE(Type)
@fixme workaround for a warning in a Boost spirit header
Definition
ParsersStandardSingle.cpp:28
StatusCode
This class is used for returning status codes from appropriate routines.
Definition
StatusCode.h:64
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition
StatusCode.h:99
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition
StatusCode.h:100
Gaudi::Parsers::parse
StatusCode parse(GaudiUtils::HashMap< K, V > &result, std::string_view input)
Basic parser for the types of HashMap used in DODBasicMapper.
Definition
DODBasicMapper.cpp:21
GaudiKernel
src
Lib
ParsersStandardSingle.cpp
Generated on
for The Gaudi Framework by
1.17.0