libzypp 17.37.17
zypp::repo::RepoInfoBase Class Reference

Base class implementing common features of RepoInfo and ServiceInfo. More...

#include <zypp/repo/RepoInfoBase.h>

Inheritance diagram for zypp::repo::RepoInfoBase:

Classes

class  Impl
 RepoInfoBase data. More...

Public Member Functions

 RepoInfoBase ()
 RepoInfoBase (const std::string &alias)
virtual ~RepoInfoBase ()
 RepoInfoBase (const RepoInfoBase &)=default
 RepoInfoBase (RepoInfoBase &&) noexcept=default
RepoInfoBaseoperator= (const RepoInfoBase &)=default
RepoInfoBaseoperator= (RepoInfoBase &&) noexcept=default
std::string alias () const
 unique identifier for this source.
std::string escaped_alias () const
 Same as alias(), just escaped in a way to be a valid file name.
std::string name () const
 Repository name.
std::string rawName () const
 The raw metadata name (no default, no variables replaced).
std::string label () const
 Label for use in messages for the user interface.
std::string asUserString () const
 User string: label (alias or name)
bool enabled () const
 If enabled is false, then this repository must be ignored as if does not exists, except when checking for duplicate alias.
bool autorefresh () const
 If true, the repostory must be refreshed before creating resolvables from it.
Pathname filepath () const
 File where this repo was read from.
void setAlias (const std::string &alias)
 set the repository alias
void setName (const std::string &name)
 set the repository name
void setEnabled (bool enabled)
 enable or disable the repository
void setAutorefresh (bool autorefresh)
 enable or disable autorefresh
void setFilepath (const Pathname &filename)
 set the path to the .repo file
virtual std::ostream & dumpOn (std::ostream &str) const
 Write a human-readable representation of this RepoInfoBase object into the str stream.
virtual std::ostream & dumpAsIniOn (std::ostream &str) const
 Write this RepoInfoBase object into str in a .repo (ini) file format.
virtual std::ostream & dumpAsXmlOn (std::ostream &str, const std::string &content="") const
 Write an XML representation of this object with content (if available).

Private Attributes

RWCOW_pointer< Impl_pimpl
 Pointer to implementation.

Friends

std::ostream & operator<< (std::ostream &str, const RepoInfoBase &obj)

(Note that these are not member symbols.)

using RepoInfoBase_Ptr = shared_ptr<RepoInfoBase>
using RepoInfoBase_constPtr = shared_ptr<const RepoInfoBase>
bool operator== (const RepoInfoBase &lhs, const RepoInfoBase &rhs)
bool operator!= (const RepoInfoBase &lhs, const RepoInfoBase &rhs)
std::ostream & operator<< (std::ostream &str, const RepoInfoBase &obj)
 Stream output.

Detailed Description

Base class implementing common features of RepoInfo and ServiceInfo.

Note
Name is subject to repo variable replacement (
See also
RepoVariablesStringReplacer).

Definition at line 39 of file RepoInfoBase.h.

Constructor & Destructor Documentation

◆ RepoInfoBase() [1/4]

zypp::repo::RepoInfoBase::RepoInfoBase ( )

Definition at line 72 of file RepoInfoBase.cc.

◆ RepoInfoBase() [2/4]

zypp::repo::RepoInfoBase::RepoInfoBase ( const std::string & alias)

Definition at line 76 of file RepoInfoBase.cc.

◆ ~RepoInfoBase()

zypp::repo::RepoInfoBase::~RepoInfoBase ( )
virtual

Definition at line 80 of file RepoInfoBase.cc.

◆ RepoInfoBase() [3/4]

zypp::repo::RepoInfoBase::RepoInfoBase ( const RepoInfoBase & )
default

◆ RepoInfoBase() [4/4]

zypp::repo::RepoInfoBase::RepoInfoBase ( RepoInfoBase && )
defaultnoexcept

Member Function Documentation

◆ operator=() [1/2]

RepoInfoBase & zypp::repo::RepoInfoBase::operator= ( const RepoInfoBase & )
default

◆ operator=() [2/2]

RepoInfoBase & zypp::repo::RepoInfoBase::operator= ( RepoInfoBase && )
defaultnoexcept

◆ alias()

std::string zypp::repo::RepoInfoBase::alias ( ) const

unique identifier for this source.

If not specified It should be generated from the base url.

Normally, in a .repo file the section name is used ( [somerepo] )

Definition at line 104 of file RepoInfoBase.cc.

◆ escaped_alias()

std::string zypp::repo::RepoInfoBase::escaped_alias ( ) const

Same as alias(), just escaped in a way to be a valid file name.

Definition at line 107 of file RepoInfoBase.cc.

◆ name()

std::string zypp::repo::RepoInfoBase::name ( ) const

Repository name.

Short label or description of the repository. Defaults to alias. Subject to repo variable replacement (

See also
RepoVariablesStringReplacer). ie: "SUSE Linux 10.2 updates"

Definition at line 110 of file RepoInfoBase.cc.

◆ rawName()

std::string zypp::repo::RepoInfoBase::rawName ( ) const

The raw metadata name (no default, no variables replaced).

Definition at line 117 of file RepoInfoBase.cc.

◆ label()

std::string zypp::repo::RepoInfoBase::label ( ) const

Label for use in messages for the user interface.

Returns an alias or name, according to ZConfig::repoLabelIsAlias().

Definition at line 120 of file RepoInfoBase.cc.

◆ asUserString()

std::string zypp::repo::RepoInfoBase::asUserString ( ) const
inline

User string: label (alias or name)

Definition at line 87 of file RepoInfoBase.h.

◆ enabled()

bool zypp::repo::RepoInfoBase::enabled ( ) const

If enabled is false, then this repository must be ignored as if does not exists, except when checking for duplicate alias.

Definition at line 98 of file RepoInfoBase.cc.

◆ autorefresh()

bool zypp::repo::RepoInfoBase::autorefresh ( ) const

If true, the repostory must be refreshed before creating resolvables from it.

Definition at line 101 of file RepoInfoBase.cc.

◆ filepath()

Pathname zypp::repo::RepoInfoBase::filepath ( ) const

File where this repo was read from.

Note
could be an empty pathname for repo infos created in memory.

Definition at line 127 of file RepoInfoBase.cc.

◆ setAlias()

void zypp::repo::RepoInfoBase::setAlias ( const std::string & alias)

set the repository alias

See also
alias
Parameters
alias

Definition at line 89 of file RepoInfoBase.cc.

◆ setName()

void zypp::repo::RepoInfoBase::setName ( const std::string & name)

set the repository name

See also
name
Parameters
name

Definition at line 92 of file RepoInfoBase.cc.

◆ setEnabled()

void zypp::repo::RepoInfoBase::setEnabled ( bool enabled)

enable or disable the repository

See also
enabled
Parameters
enabled

Definition at line 83 of file RepoInfoBase.cc.

◆ setAutorefresh()

void zypp::repo::RepoInfoBase::setAutorefresh ( bool autorefresh)

enable or disable autorefresh

See also
autorefresh
Parameters
enabled

Definition at line 86 of file RepoInfoBase.cc.

◆ setFilepath()

void zypp::repo::RepoInfoBase::setFilepath ( const Pathname & filename)

set the path to the .repo file

The path to the .repo file where this repository was defined, or empty if nowhere.

Parameters
pathFile path

Definition at line 95 of file RepoInfoBase.cc.

◆ dumpOn()

std::ostream & zypp::repo::RepoInfoBase::dumpOn ( std::ostream & str) const
virtual

Write a human-readable representation of this RepoInfoBase object into the str stream.

Useful for logging.

Reimplemented in zypp::RepoInfo.

Definition at line 131 of file RepoInfoBase.cc.

◆ dumpAsIniOn()

std::ostream & zypp::repo::RepoInfoBase::dumpAsIniOn ( std::ostream & str) const
virtual

Write this RepoInfoBase object into str in a .repo (ini) file format.

Raw values, no variable replacement.

Reimplemented in zypp::RepoInfo, and zypp::ServiceInfo.

Definition at line 143 of file RepoInfoBase.cc.

◆ dumpAsXmlOn()

std::ostream & zypp::repo::RepoInfoBase::dumpAsXmlOn ( std::ostream & str,
const std::string & content = "" ) const
virtual

Write an XML representation of this object with content (if available).

Repo variables replaced.

Reimplemented in zypp::RepoInfo, and zypp::ServiceInfo.

Definition at line 155 of file RepoInfoBase.cc.

◆ RepoInfoBase_Ptr

Definition at line 187 of file RepoInfoBase.h.

◆ RepoInfoBase_constPtr

Definition at line 189 of file RepoInfoBase.h.

◆ operator<< [1/2]

std::ostream & operator<< ( std::ostream & str,
const RepoInfoBase & obj )
friend

Definition at line 160 of file RepoInfoBase.cc.

◆ operator==()

bool operator== ( const RepoInfoBase & lhs,
const RepoInfoBase & rhs )
related

Definition at line 173 of file RepoInfoBase.h.

◆ operator!=()

bool operator!= ( const RepoInfoBase & lhs,
const RepoInfoBase & rhs )
related

Definition at line 177 of file RepoInfoBase.h.

◆ operator<<() [2/2]

std::ostream & operator<< ( std::ostream & str,
const RepoInfoBase & obj )
related

Stream output.

Definition at line 160 of file RepoInfoBase.cc.

Member Data Documentation

◆ _pimpl

RWCOW_pointer<Impl> zypp::repo::RepoInfoBase::_pimpl
private

Pointer to implementation.

Definition at line 168 of file RepoInfoBase.h.


The documentation for this class was generated from the following files: