The Gaudi Framework
master (9f3f8895)
Toggle main menu visibility
Loading...
Searching...
No Matches
StringKey.cpp
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
#include <
Gaudi/Parsers/CommonParsers.h
>
12
#include <
GaudiKernel/StringKey.h
>
13
#include <
GaudiKernel/ToStream.h
>
14
21
22
std::string
Gaudi::StringKey::toString
()
const
{
return
Gaudi::Utils::toString
(
m_str
); }
23
const
std::string&
Gaudi::StringKey::__str__
()
const
{
return
m_str
; }
24
std::string
Gaudi::StringKey::__repr__
()
const
{
return
toString
(); }
25
bool
Gaudi::StringKey::__eq__
(
const
Gaudi::StringKey
& right )
const
{
return
*
this
== right; }
26
bool
Gaudi::StringKey::__eq__
( std::string_view right )
const
{
return
*
this
== right; }
27
bool
Gaudi::StringKey::__neq__
(
const
Gaudi::StringKey
& right )
const
{
return
*
this
!= right; }
28
bool
Gaudi::StringKey::__neq__
( std::string_view right )
const
{
return
*
this
!= right; }
29
std::ostream&
Gaudi::Utils::toStream
(
const
Gaudi::StringKey
& key, std::ostream& s ) {
30
return
Gaudi::Utils::toStream
( key.str(), s );
31
}
32
StatusCode
Gaudi::Parsers::parse
(
Gaudi::StringKey
& result, std::string_view input ) {
33
std::string _result;
34
StatusCode
sc =
parse
( _result, input );
35
result =
Gaudi::StringKey
( _result );
36
return
sc;
37
}
38
StatusCode
Gaudi::Parsers::parse
( std::vector<Gaudi::StringKey>& result, std::string_view input ) {
39
result.clear();
40
typedef
std::vector<std::string> Strings;
41
Strings _result;
42
StatusCode
sc =
parse
( _result, input );
43
if
( sc.
isFailure
() ) {
return
sc; }
44
result.reserve( _result.size() );
45
46
std::copy( _result.begin(), _result.end(), std::back_inserter( result ) );
47
48
return
StatusCode::SUCCESS
;
49
}
CommonParsers.h
The declaration of major parsing functions used e.g for (re)implementation of new extended properties...
parse
StatusCode parse(DataObjID &dest, std::string_view src)
Definition
DataObjID.cpp:58
StringKey.h
ToStream.h
implementation of various functions for streaming.
Gaudi::StringKey
Helper class for efficient "key" access for strings.
Definition
StringKey.h:68
Gaudi::StringKey::__repr__
std::string __repr__() const
the representation of the object
Definition
StringKey.cpp:24
Gaudi::StringKey::m_str
std::string m_str
the actual string
Definition
StringKey.h:146
Gaudi::StringKey::toString
std::string toString() const
string representation (for properties)
Definition
StringKey.cpp:22
Gaudi::StringKey::__eq__
bool __eq__(const StringKey &right) const
equality operator for python
Definition
StringKey.cpp:25
Gaudi::StringKey::__str__
const std::string & __str__() const
the representation of the object
Definition
StringKey.cpp:23
Gaudi::StringKey::__neq__
bool __neq__(const StringKey &right) const
non-equality operator for python
Definition
StringKey.cpp:27
StatusCode
This class is used for returning status codes from appropriate routines.
Definition
StatusCode.h:64
StatusCode::isFailure
bool isFailure() const
Definition
StatusCode.h:118
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition
StatusCode.h:99
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
Gaudi::Utils::toString
std::string toString(const TYPE &obj)
the generic implementation of the type conversion to the string
Definition
ToStream.h:329
Gaudi::Utils::toStream
std::ostream & toStream(ITERATOR first, ITERATOR last, std::ostream &s, const std::string &open, const std::string &close, const std::string &delim)
the helper function to print the sequence
Definition
ToStream.h:307
GaudiKernel
src
Lib
StringKey.cpp
Generated on
for The Gaudi Framework by
1.17.0