The Gaudi Framework  master (e68eea06)
Loading...
Searching...
No Matches
Factory.h
Go to the documentation of this file.
1/***********************************************************************************\
2* (c) Copyright 1998-2025 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\***********************************************************************************/
11#pragma once
12
15#include <string>
16#include <string_view>
17
18namespace Gaudi::Parsers {
19 typedef std::string_view::const_iterator IteratorT;
21 template <typename ResultT>
22 inline StatusCode parse_( ResultT& result, std::string_view input ) {
23 Skipper skipper;
25 IteratorT iter = input.begin(), end = input.end();
26 return ( qi::phrase_parse( iter, end, g, skipper, result ) && ( iter == end ) ? StatusCode::SUCCESS
28 }
29 template <>
30 inline StatusCode parse_( std::string& result, std::string_view input ) {
31 Skipper skipper;
33 IteratorT iter = input.begin(), end = input.end();
34 if ( !( qi::phrase_parse( iter, end, g, skipper, result ) && ( iter == end ) ) ) { result = input; }
35 //@attention always
37 }
38 template <typename ResultT>
39 inline StatusCode parse( ResultT& result, std::string_view input ) {
40 return parse_( result, input );
41 }
42} // namespace Gaudi::Parsers
This class is used for returning status codes from appropriate routines.
Definition StatusCode.h:64
constexpr static const auto SUCCESS
Definition StatusCode.h:99
constexpr static const auto FAILURE
Definition StatusCode.h:100
SkipperGrammar< IteratorT > Skipper
Definition Factory.h:20
StatusCode parse(GaudiUtils::HashMap< K, V > &result, std::string_view input)
Basic parser for the types of HashMap used in DODBasicMapper.
std::string_view::const_iterator IteratorT
Definition Factory.h:19
StatusCode parse_(ResultT &result, std::string_view input)
Definition Factory.h:22