/usr/include/x86_64-linux-gnu/zypp/ServiceInfo.h is in libzypp-dev 14.29.1-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 | /*---------------------------------------------------------------------\
| ____ _ __ __ ___ |
| |__ / \ / / . \ . \ |
| / / \ V /| _/ _/ |
| / /__ | | | | | | |
| /_____||_| |_| |_| |
| |
\---------------------------------------------------------------------*/
/** \file zypp/ServiceInfo.h
*
*/
#ifndef ZYPP_SERVICE_H
#define ZYPP_SERVICE_H
#include <set>
#include <string>
#include "zypp/Url.h"
#include "zypp/repo/ServiceType.h"
#include "zypp/RepoInfo.h"
///////////////////////////////////////////////////////////////////
namespace zypp
{ /////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////
//
// CLASS NAME : ServiceInfo
//
/** */
class ServiceInfo : public repo::RepoInfoBase
{
public:
/** Default ctor creates \ref noService.*/
ServiceInfo();
/**
* Creates ServiceInfo with specified alias.
*
* \param alias unique short name of service
*/
ServiceInfo( const std::string & alias );
/**
* ServiceInfo with alias and its URL
*
* \param alias unique shortname of service
* \param url url to service
*/
ServiceInfo( const std::string & alias, const Url& url );
virtual ~ServiceInfo();
public:
/** Represents an empty service. */
static const ServiceInfo noService;
public:
/**
* Gets url to service
*
* \return url to service
*/
Url url() const;
/**
* Sets url for this service
*
* \param url url to this service
*/
void setUrl( const Url& url );
/**
*
*/
repo::ServiceType type() const;
/**
* Set service type.
*
* \param type the new type
*/
void setType( const repo::ServiceType & type );
void setProbedType( const repo::ServiceType & t ) const;
/** \name Set of repos (repository aliases) to enable on next refresh.
*
* Per default new repositories are created in disabled state. But repositories
* mentioned here will be created in enabled state on the next refresh.
* Afterwards they get removed from the list.
*/
//@{
/** Container of repos. */
typedef std::set<std::string> ReposToEnable;
bool reposToEnableEmpty() const;
ReposToEnable::size_type reposToEnableSize() const;
ReposToEnable::const_iterator reposToEnableBegin() const;
ReposToEnable::const_iterator reposToEnableEnd() const;
/** Whether \c alias_r is mentioned in ReposToEnable. */
bool repoToEnableFind( const std::string & alias_r ) const;
/** Add \c alias_r to the set of ReposToEnable. */
void addRepoToEnable( const std::string & alias_r );
/** Remove \c alias_r from the set of ReposToEnable. */
void delRepoToEnable( const std::string & alias_r );
/** Clear the set of ReposToEnable. */
void clearReposToEnable();
//@}
/** \name Set of repos (repository aliases) to disable on next refresh.
*
* Repositories mentioned here will be disabled on the next refresh, in case they
* still exist. Afterwards they get removed from the list.
*/
//@{
/** Container of repos. */
typedef std::set<std::string> ReposToDisable;
bool reposToDisableEmpty() const;
ReposToDisable::size_type reposToDisableSize() const;
ReposToDisable::const_iterator reposToDisableBegin() const;
ReposToDisable::const_iterator reposToDisableEnd() const;
/** Whether \c alias_r is mentioned in ReposToDisable. */
bool repoToDisableFind( const std::string & alias_r ) const;
/** Add \c alias_r to the set of ReposToDisable. */
void addRepoToDisable( const std::string & alias_r );
/** Remove \c alias_r from the set of ReposToDisable. */
void delRepoToDisable( const std::string & alias_r );
/** Clear the set of ReposToDisable. */
void clearReposToDisable();
//@}
/** \name The original repo state as defined by the repoindex.xml upon last refresh.
*
* This state is remembered to detect any user modifications applied to the repos.
* It may not be available for all repos or in plugin services. In this case all
* changes requested by a service refresh are applied unconditionally.
*/
//@{
struct RepoState
{
bool enabled;
bool autorefresh;
unsigned priority;
RepoState()
: enabled( false ), autorefresh( true ), priority( RepoInfo::defaultPriority() )
{}
RepoState( const RepoInfo & repo_r )
: enabled( repo_r.enabled() ), autorefresh( repo_r.autorefresh() ), priority( repo_r.priority() )
{}
bool operator==( const RepoState & rhs ) const
{ return( enabled==rhs.enabled && autorefresh==rhs.autorefresh && priority==rhs.priority ); }
bool operator!=( const RepoState & rhs ) const
{ return ! operator==( rhs ); }
friend std::ostream & operator<<( std::ostream & str, const RepoState & obj );
};
typedef std::map<std::string,RepoState> RepoStates;
/** Access the remembered repository states. */
const RepoStates & repoStates() const;
/** Remember a new set of repository states. */
void setRepoStates( RepoStates newStates_r );
//@}
public:
/**
* Writes ServiceInfo to stream in ".service" format
*
* \param str stream where serialized version service is written
*/
virtual std::ostream & dumpAsIniOn( std::ostream & str ) const;
/**
* Write an XML representation of this ServiceInfo object.
*
* \param str
* \param content if not empty, produces <service ...>content</service>
* otherwise <service .../>
*/
virtual std::ostream & dumpAsXmlOn( std::ostream & str, const std::string & content = "" ) const;
/** \deprecated Use camel cased dumpAsXmlOn */
ZYPP_DEPRECATED std::ostream & dumpAsXMLOn( std::ostream & str, const std::string & content = "" ) const { return dumpAsXmlOn( str, content ); }
class Impl;
private:
RWCOW_pointer<Impl> _pimpl;
};
///////////////////////////////////////////////////////////////////
/** \relates ServiceInfo */
typedef shared_ptr<ServiceInfo> ServiceInfo_Ptr;
/** \relates ServiceInfo */
typedef shared_ptr<const ServiceInfo> ServiceInfo_constPtr;
/** \relates ServiceInfo */
typedef std::list<ServiceInfo> ServiceInfoList;
/** \relates ServiceInfo Stream output */
std::ostream & operator<<( std::ostream & str, const ServiceInfo & obj );
/////////////////////////////////////////////////////////////////
} // namespace zypp
///////////////////////////////////////////////////////////////////
#endif // ZYPP_SAT_REPOSITORY_H
|