libzypp: zypp/repo/RepoVariables.h Source File

libzypp 17.38.14

RepoVariables.h
Go to the documentation of this file.
1/*---------------------------------------------------------------------\
2| ____ _ __ __ ___ |
3| |__ / \ / / . \ . \ |
4| / / \ V /| _/ _/ |
5| / /__ | | | | | | |
6| /_____||_| |_| |_| |
7| |
8\---------------------------------------------------------------------*/
11#ifndef ZYPP_REPO_VARIABLES_H_
12#define ZYPP_REPO_VARIABLES_H_
13
14#include <string>
15#include <zypp-core/base/Function.h>
16#include <zypp/base/ValueTransform.h>
17#include <zypp-core/Url.h>
18
20namespace zypp
21{
23 namespace repo
24 {
57 struct ZYPP_API RepoVarExpand
58 {
60 using VarRetriever = function<const std::string *(const std::string &)>;
61
63 std::string operator()( const std::string & value_r, VarRetriever varRetriever_r ) const;
64
66 std::string operator()( std::string && value_r, VarRetriever varRetriever_r ) const;
67 };
68
105 struct ZYPP_API RepoVariablesStringReplacer
106 {
107 std::string operator()( const std::string & value_r ) const;
108
110 std::string operator()( std::string && value_r ) const;
111 };
112
119 struct ZYPP_API RepoVariablesUrlReplacer
120 {
121 Url operator()( const Url & url_r ) const;
122 };
123 } // namespace repo
125
127 using RepoVariablesReplacedString = base::ValueTransform<std::string, repo::RepoVariablesStringReplacer>;
128
130 using RepoVariablesReplacedStringList = base::ContainerTransform<std::list<std::string>, repo::RepoVariablesStringReplacer>;
131
133 using RepoVariablesReplacedUrl = base::ValueTransform<Url, repo::RepoVariablesUrlReplacer>;
134
136 using RepoVariablesReplacedUrlList = base::ContainerTransform<std::list<Url>, repo::RepoVariablesUrlReplacer>;
137
138} // namespace zypp
140
141#endif
Function.h
Url.h
ValueTransform.h
zypp::Url
Url manipulation class.
Definition Url.h:93
zypp::repo
Definition DeltaCandidates.cc:30
zypp
Easy-to use interface to the ZYPP dependency resolver.
Definition CodePitfalls.doc:2
zypp::RepoVariablesReplacedUrl
base::ValueTransform< Url, repo::RepoVariablesUrlReplacer > RepoVariablesReplacedUrl
relates: RepoVariablesUrlReplacer Helper managing repo variables replaced urls
Definition RepoVariables.h:133
zypp::RepoVariablesReplacedUrlList
base::ContainerTransform< std::list< Url >, repo::RepoVariablesUrlReplacer > RepoVariablesReplacedUrlList
relates: RepoVariablesUrlReplacer Helper managing repo variables replaced url lists
Definition RepoVariables.h:136
zypp::RepoVariablesReplacedStringList
base::ContainerTransform< std::list< std::string >, repo::RepoVariablesStringReplacer > RepoVariablesReplacedStringList
relates: RepoVariablesStringReplacer Helper managing repo variables replaced string lists
Definition RepoVariables.h:130
zypp::ZYPP_API
const Arch Arch_empty ZYPP_API
relates: Arch This is an empty Arch represented by an empty string.
Definition Arch.h:173
zypp::RepoVariablesReplacedString
base::ValueTransform< std::string, repo::RepoVariablesStringReplacer > RepoVariablesReplacedString
relates: RepoVariablesStringReplacer Helper managing repo variables replaced strings
Definition RepoVariables.h:127
zypp::base::ContainerTransform
Helper managing a container of raw values with transformed representation.
Definition ValueTransform.h:96
zypp::base::ValueTransform
Helper managing raw values with transformed representation.
Definition ValueTransform.h:36
zypp::repo::RepoVarExpand
Functor expanding repo variables in a string.
Definition RepoVariables.h:58
zypp::repo::RepoVarExpand::VarRetriever
function< const std::string *(const std::string &)> VarRetriever
Function taking a variable name and returning a pointer to the variable value or nullptr if unset.
Definition RepoVariables.h:60
zypp::repo::RepoVarExpand::operator()
std::string operator()(const std::string &value_r, VarRetriever varRetriever_r) const
Return a copy of value_r with embedded variables expanded.
Definition RepoVariables.cc:381
zypp::repo::RepoVariablesStringReplacer
Functor replacing repository variables.
Definition RepoVariables.h:106
zypp::repo::RepoVariablesStringReplacer::operator()
std::string operator()(const std::string &value_r) const
Definition RepoVariables.cc:558
zypp::repo::RepoVariablesUrlReplacer
Functor replacing repository variables.
Definition RepoVariables.h:120
zypp::repo::RepoVariablesUrlReplacer::operator()
Url operator()(const Url &url_r) const
Definition RepoVariables.cc:567