libzypp: zypp::Arch Class Reference

libzypp 17.38.5

zypp::Arch Class Reference

Architecture. More...

`#include <zypp/Arch.h>`

## Classes
struct | CompatEntry
| Holds an architecture ID and its compatible relation. More...

## Public Member Functions
| Arch ()
| Default ctor Arc_noarch.
| Arch (IdString::IdType id_r)
| Ctor taking Arch as string.
| Arch (const IdString &idstr_r)
| Arch (const std::string &str_r)
| Arch (const char *cstr_r)

## Related Symbols
(Note that these are not member symbols.)
std::ostream & | operator<< (std::ostream &str, const Arch::CompatEntry &obj)
| Stream output.
bool | operator== (const Arch::CompatEntry &lhs, const Arch::CompatEntry &rhs)
bool | operator!= (const Arch::CompatEntry &lhs, const Arch::CompatEntry &rhs)
template<>
bool | operator() (const zypp::Arch &lhs, const zypp::Arch &rhs) const
| Default order for std::container based Arch::compare.
Builtin architecture constants.
Defined outside Arch as e.g. `Arch_i386`, because some names, like `i388`, are used as `#define`, thus unusable as identifier like `Arch::i386`.
const Arch Arch_empty | ZYPP_API
| This is an empty Arch represented by an empty string.
const Arch Arch_noarch | ZYPP_API
const Arch Arch_pentium4 | ZYPP_API
const Arch Arch_pentium3 | ZYPP_API
const Arch Arch_x86_64_v4 | ZYPP_API
const Arch Arch_x86_64_v3 | ZYPP_API
const Arch Arch_x86_64_v2 | ZYPP_API
const Arch Arch_x86_64 | ZYPP_API
const Arch Arch_athlon | ZYPP_API
const Arch Arch_i686 | ZYPP_API
const Arch Arch_i586 | ZYPP_API
const Arch Arch_i486 | ZYPP_API
const Arch Arch_i386 | ZYPP_API
const Arch Arch_s390x | ZYPP_API
const Arch Arch_s390 | ZYPP_API
const Arch Arch_ppc64le | ZYPP_API
const Arch Arch_ppc64p7 | ZYPP_API
const Arch Arch_ppc64 | ZYPP_API
const Arch Arch_ppc | ZYPP_API
const Arch Arch_ia64 | ZYPP_API
const Arch Arch_alphaev67 | ZYPP_API
const Arch Arch_alphaev6 | ZYPP_API
const Arch Arch_alphapca56 | ZYPP_API
const Arch Arch_alphaev56 | ZYPP_API
const Arch Arch_alphaev5 | ZYPP_API
const Arch Arch_alpha | ZYPP_API
const Arch Arch_sparc64v | ZYPP_API
const Arch Arch_sparc64 | ZYPP_API
const Arch Arch_sparcv9v | ZYPP_API
const Arch Arch_sparcv9 | ZYPP_API
const Arch Arch_sparcv8 | ZYPP_API
const Arch Arch_sparc | ZYPP_API
const Arch Arch_aarch64 | ZYPP_API
const Arch Arch_armv7tnh | ZYPP_API
const Arch Arch_armv7thl | ZYPP_API
const Arch Arch_armv7hnl | ZYPP_API
const Arch Arch_armv7hl | ZYPP_API
const Arch Arch_armv6hl | ZYPP_API
const Arch Arch_armv8hl | ZYPP_API
const Arch Arch_armv8l | ZYPP_API
const Arch Arch_armv7l | ZYPP_API
const Arch Arch_armv6l | ZYPP_API
const Arch Arch_armv5tejl | ZYPP_API
const Arch Arch_armv5tel | ZYPP_API
const Arch Arch_armv5tl | ZYPP_API
const Arch Arch_armv5l | ZYPP_API
const Arch Arch_armv4tl | ZYPP_API
const Arch Arch_armv4l | ZYPP_API
const Arch Arch_armv3l | ZYPP_API
const Arch Arch_riscv64 | ZYPP_API
const Arch Arch_sh3 | ZYPP_API
const Arch Arch_sh4 | ZYPP_API
const Arch Arch_sh4a | ZYPP_API
const Arch Arch_m68k | ZYPP_API
const Arch Arch_mips | ZYPP_API
const Arch Arch_mipsel | ZYPP_API
const Arch Arch_mips64 | ZYPP_API
const Arch Arch_mips64el | ZYPP_API
const Arch Arch_loong64 | ZYPP_API
std::ostream & | operator<< (std::ostream &str, const Arch &obj)
| stream output.
std::ostream & | dumpAsXmlOn (std::ostream &str, const Arch &obj)
| XML output.
Equality based on string value.
bool | operator== (const Arch &lhs, const Arch &rhs)
bool | operator== (const Arch &lhs, const std::string &rhs)
bool | operator== (const std::string &lhs, const Arch &rhs)
bool | operator!= (const Arch &lhs, const Arch &rhs)
bool | operator!= (const Arch &lhs, const std::string &rhs)
bool | operator!= (const std::string &lhs, const Arch &rhs)

## IdStringType like interface.
We can't use the complete IdStringType mixin until _doCompare can be redefined on any level, not just as char*.
using | CompatSet = std::set<Arch, CompareByGT<Arch>>
| Reversed arch order, best Arch first.
const CompatEntry * | _entry
IdString | idStr () const
| String representation of Arch.
const std::string & | asString () const
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
const char * | c_str () const
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
bool | empty () const
| Test for an empty Arch (this is Arch_epmty, not Arch_noarch ).
unsigned | size () const
| Size of the string representation.
IdString::IdType | id () const
| Expert backdoor.
bool | isBuiltIn () const
| Whether this is a buitin (or known) architecture.
bool | compatibleWith (const Arch &targetArch_r) const
| Compatibility relation.
Arch | baseArch () const
int | compare (const Arch &rhs) const
| Arch comparison.
static Arch | baseArch (const Arch &targetArch_r)
static int | compare (const Arch &lhs, const Arch &rhs)
| Arch comparison (static version).
static CompatSet | compatSet (const Arch &targetArch_r)
| Return a set of all Arch's compatibleWith a targetArch_r.
static std::string | asString (const CompatSet &cset)
| Arch (const CompatEntry &)

## Detailed Description

Architecture.

Definition at line 36 of file Arch.h.

## Member Typedef Documentation

## ◆ CompatSet

using zypp::Arch::CompatSet = std::set<Arch, CompareByGT<Arch>>

Reversed arch order, best Arch first.

Definition at line 117 of file Arch.h.

## Constructor & Destructor Documentation

## ◆ Arch() [1/6]

zypp::Arch::Arch | ( |  | ) |

Default ctor Arc_noarch.

Definition at line 462 of file Arch.cc.

## ◆ Arch() [2/6]

zypp::Arch::Arch | ( | IdString::IdType | id_r | ) |
| explicit

Ctor taking Arch as string.

Definition at line 466 of file Arch.cc.

## ◆ Arch() [3/6]

zypp::Arch::Arch | ( | const IdString & | idstr_r | ) |
| explicit

Definition at line 470 of file Arch.cc.

## ◆ Arch() [4/6]

zypp::Arch::Arch | ( | const std::string & | str_r | ) |
| explicit

Definition at line 474 of file Arch.cc.

## ◆ Arch() [5/6]

zypp::Arch::Arch | ( | const char * | cstr_r | ) |
| explicit

Definition at line 478 of file Arch.cc.

## ◆ Arch() [6/6]

zypp::Arch::Arch | ( | const CompatEntry & | rhs | ) |
| private

Definition at line 482 of file Arch.cc.

## Member Function Documentation

## ◆ idStr()

IdString zypp::Arch::idStr | ( |  | ) | const

String representation of Arch.

Definition at line 491 of file Arch.cc.

## ◆ asString() [1/2]

const std::string & zypp::Arch::asString | ( |  | ) | const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 499 of file Arch.cc.

## ◆ c_str()

const char * zypp::Arch::c_str | ( |  | ) | const
| inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 59 of file Arch.h.

## ◆ empty()

bool zypp::Arch::empty | ( |  | ) | const
| inline

Test for an empty Arch (this is Arch_epmty, not Arch_noarch ).

Definition at line 63 of file Arch.h.

## ◆ size()

unsigned zypp::Arch::size | ( |  | ) | const
| inline

Size of the string representation.

Definition at line 67 of file Arch.h.

## ◆ id()

IdString::IdType zypp::Arch::id | ( |  | ) | const
| inline

Expert backdoor.

Definition at line 71 of file Arch.h.

## ◆ isBuiltIn()

bool zypp::Arch::isBuiltIn | ( |  | ) | const

Whether this is a buitin (or known) architecture.

Used e.g. in Capability to determine whether some trailing `".string"` is part ot the name or restriction to an architecture.

Definition at line 507 of file Arch.cc.

## ◆ compatibleWith()

bool zypp::Arch::compatibleWith | ( | const Arch & | targetArch_r | ) | const

Compatibility relation.

Returns
  `True` iff `this` is compatible with targetArch_r.
  Arch_noarch.compatibleWith( ... ) ==> always true;
  Arch_i686.compatibleWith( Arch_x86_64 ) ==> true;
  Arch_x86_64.compatibleWith( Arch_i686 ) ==> false;

Definition at line 515 of file Arch.cc.

## ◆ baseArch() [1/2]

Arch zypp::Arch::baseArch | ( |  | ) | const

Returns
  the arch before noarch if it's not a multilib arch (e.g. x86_64,sparc64v,sparc64,ppc64,s390x).

Definition at line 523 of file Arch.cc.

## ◆ baseArch() [2/2]

Arch zypp::Arch::baseArch | ( | const Arch & | targetArch_r | ) |
| inlinestatic

Definition at line 101 of file Arch.h.

## ◆ compare() [1/2]

int zypp::Arch::compare | ( | const Arch & | rhs | ) | const

Arch comparison.

Compatible architectures are treated as `less` (i.e. i686>i386>noarch). So `Arch_noarch` is the least Arch. Equivalent architectures (compatible in both directions) are ordered arbitrary.

Definition at line 560 of file Arch.cc.

## ◆ compare() [2/2]

int zypp::Arch::compare | ( | const Arch & | lhs,
|  | const Arch & | rhs )
| inlinestatic

Arch comparison (static version).

Definition at line 112 of file Arch.h.

## ◆ compatSet()

Arch::CompatSet zypp::Arch::compatSet | ( | const Arch & | targetArch_r | ) |
| static

Return a set of all Arch's compatibleWith a targetArch_r.

Note
  The set is ordered according to compare, thus iterating will start at targetArch_r and end with `Arch_noarch`.
  Arch::CompatSet cset( Arch::compatSet( Arch_x86_64 ) );
  cout << str::join( make_transform_iterator( cset.begin(), std::mem_fn(&Arch::asString) ),
  make_transform_iterator( cset.end(), std::mem_fn(&Arch::asString) ) )
  << endl;
  // Prints: x86_64 athlon i686 i586 i486 i386 noarch
  zypp::Arch::compatSet
  static CompatSet compatSet(const Arch &targetArch_r)
  Return a set of all Arch's compatibleWith a targetArch_r.
  Definition Arch.cc:568
  zypp::Arch::asString
  const std::string & asString() const
  This is an overloaded member function, provided for convenience. It differs from the above function o...
  Definition Arch.cc:499
  zypp::Arch::CompatSet
  std::set< Arch, CompareByGT< Arch > > CompatSet
  Reversed arch order, best Arch first.
  Definition Arch.h:117
  zypp::str::join
  std::string join(TIterator begin, TIterator end, const C_Str &sep_r=" ")
  Join strings using separator sep_r (defaults to BLANK).
  Definition String.h:846

Definition at line 568 of file Arch.cc.

## ◆ asString() [2/2]

std::string zypp::Arch::asString | ( | const CompatSet & | cset | ) |
| inlinestatic

Definition at line 135 of file Arch.h.

## Friends And Related Symbol Documentation

## ◆ ZYPP_API [1/59]

const Arch Arch_empty ZYPP_API
| related

This is an empty Arch represented by an empty string.

Sometimes used to indicate an any or an unknown Arch. Don't confuse this with Arch_noarch, which is in fact an architecture.

Definition at line 165 of file Arch.h.

## ◆ ZYPP_API [2/59]

const Arch Arch_noarch ZYPP_API
| related

Definition at line 168 of file Arch.h.

## ◆ ZYPP_API [3/59]

const Arch Arch_pentium4 ZYPP_API
| related

Definition at line 171 of file Arch.h.

## ◆ ZYPP_API [4/59]

const Arch Arch_pentium3 ZYPP_API
| related

Definition at line 173 of file Arch.h.

## ◆ ZYPP_API [5/59]

const Arch Arch_x86_64_v4 ZYPP_API
| related

Definition at line 176 of file Arch.h.

## ◆ ZYPP_API [6/59]

const Arch Arch_x86_64_v3 ZYPP_API
| related

Definition at line 178 of file Arch.h.

## ◆ ZYPP_API [7/59]

const Arch Arch_x86_64_v2 ZYPP_API
| related

Definition at line 180 of file Arch.h.

## ◆ ZYPP_API [8/59]

const Arch Arch_x86_64 ZYPP_API
| related

Definition at line 182 of file Arch.h.

## ◆ ZYPP_API [9/59]

const Arch Arch_athlon ZYPP_API
| related

Definition at line 184 of file Arch.h.

## ◆ ZYPP_API [10/59]

const Arch Arch_i686 ZYPP_API
| related

Definition at line 186 of file Arch.h.

## ◆ ZYPP_API [11/59]

const Arch Arch_i586 ZYPP_API
| related

Definition at line 188 of file Arch.h.

## ◆ ZYPP_API [12/59]

const Arch Arch_i486 ZYPP_API
| related

Definition at line 190 of file Arch.h.

## ◆ ZYPP_API [13/59]

const Arch Arch_i386 ZYPP_API
| related

Definition at line 192 of file Arch.h.

## ◆ ZYPP_API [14/59]

const Arch Arch_s390x ZYPP_API
| related

Definition at line 195 of file Arch.h.

## ◆ ZYPP_API [15/59]

const Arch Arch_s390 ZYPP_API
| related

Definition at line 197 of file Arch.h.

## ◆ ZYPP_API [16/59]

const Arch Arch_ppc64le ZYPP_API
| related

Definition at line 200 of file Arch.h.

## ◆ ZYPP_API [17/59]

const Arch Arch_ppc64p7 ZYPP_API
| related

Definition at line 203 of file Arch.h.

## ◆ ZYPP_API [18/59]

const Arch Arch_ppc64 ZYPP_API
| related

Definition at line 205 of file Arch.h.

## ◆ ZYPP_API [19/59]

const Arch Arch_ppc ZYPP_API
| related

Definition at line 207 of file Arch.h.

## ◆ ZYPP_API [20/59]

const Arch Arch_ia64 ZYPP_API
| related

Definition at line 210 of file Arch.h.

## ◆ ZYPP_API [21/59]

const Arch Arch_alphaev67 ZYPP_API
| related

Definition at line 213 of file Arch.h.

## ◆ ZYPP_API [22/59]

const Arch Arch_alphaev6 ZYPP_API
| related

Definition at line 215 of file Arch.h.

## ◆ ZYPP_API [23/59]

const Arch Arch_alphapca56 ZYPP_API
| related

Definition at line 217 of file Arch.h.

## ◆ ZYPP_API [24/59]

const Arch Arch_alphaev56 ZYPP_API
| related

Definition at line 219 of file Arch.h.

## ◆ ZYPP_API [25/59]

const Arch Arch_alphaev5 ZYPP_API
| related

Definition at line 221 of file Arch.h.

## ◆ ZYPP_API [26/59]

const Arch Arch_alpha ZYPP_API
| related

Definition at line 223 of file Arch.h.

## ◆ ZYPP_API [27/59]

const Arch Arch_sparc64v ZYPP_API
| related

Definition at line 226 of file Arch.h.

## ◆ ZYPP_API [28/59]

const Arch Arch_sparc64 ZYPP_API
| related

Definition at line 228 of file Arch.h.

## ◆ ZYPP_API [29/59]

const Arch Arch_sparcv9v ZYPP_API
| related

Definition at line 230 of file Arch.h.

## ◆ ZYPP_API [30/59]

const Arch Arch_sparcv9 ZYPP_API
| related

Definition at line 232 of file Arch.h.

## ◆ ZYPP_API [31/59]

const Arch Arch_sparcv8 ZYPP_API
| related

Definition at line 234 of file Arch.h.

## ◆ ZYPP_API [32/59]

const Arch Arch_sparc ZYPP_API
| related

Definition at line 236 of file Arch.h.

## ◆ ZYPP_API [33/59]

const Arch Arch_aarch64 ZYPP_API
| related

Definition at line 239 of file Arch.h.

## ◆ ZYPP_API [34/59]

const Arch Arch_armv7tnh ZYPP_API
| related

Definition at line 242 of file Arch.h.

## ◆ ZYPP_API [35/59]

const Arch Arch_armv7thl ZYPP_API
| related

Definition at line 244 of file Arch.h.

## ◆ ZYPP_API [36/59]

const Arch Arch_armv7hnl ZYPP_API
| related

Definition at line 247 of file Arch.h.

## ◆ ZYPP_API [37/59]

const Arch Arch_armv7hl ZYPP_API
| related

Definition at line 249 of file Arch.h.

## ◆ ZYPP_API [38/59]

const Arch Arch_armv6hl ZYPP_API
| related

Definition at line 251 of file Arch.h.

## ◆ ZYPP_API [39/59]

const Arch Arch_armv8hl ZYPP_API
| related

Definition at line 254 of file Arch.h.

## ◆ ZYPP_API [40/59]

const Arch Arch_armv8l ZYPP_API
| related

Definition at line 256 of file Arch.h.

## ◆ ZYPP_API [41/59]

const Arch Arch_armv7l ZYPP_API
| related

Definition at line 258 of file Arch.h.

## ◆ ZYPP_API [42/59]

const Arch Arch_armv6l ZYPP_API
| related

Definition at line 260 of file Arch.h.

## ◆ ZYPP_API [43/59]

const Arch Arch_armv5tejl ZYPP_API
| related

Definition at line 262 of file Arch.h.

## ◆ ZYPP_API [44/59]

const Arch Arch_armv5tel ZYPP_API
| related

Definition at line 264 of file Arch.h.

## ◆ ZYPP_API [45/59]

const Arch Arch_armv5tl ZYPP_API
| related

Definition at line 266 of file Arch.h.

## ◆ ZYPP_API [46/59]

const Arch Arch_armv5l ZYPP_API
| related

Definition at line 268 of file Arch.h.

## ◆ ZYPP_API [47/59]

const Arch Arch_armv4tl ZYPP_API
| related

Definition at line 270 of file Arch.h.

## ◆ ZYPP_API [48/59]

const Arch Arch_armv4l ZYPP_API
| related

Definition at line 272 of file Arch.h.

## ◆ ZYPP_API [49/59]

const Arch Arch_armv3l ZYPP_API
| related

Definition at line 274 of file Arch.h.

## ◆ ZYPP_API [50/59]

const Arch Arch_riscv64 ZYPP_API
| related

Definition at line 277 of file Arch.h.

## ◆ ZYPP_API [51/59]

const Arch Arch_sh3 ZYPP_API
| related

Definition at line 280 of file Arch.h.

## ◆ ZYPP_API [52/59]

const Arch Arch_sh4 ZYPP_API
| related

Definition at line 283 of file Arch.h.

## ◆ ZYPP_API [53/59]

const Arch Arch_sh4a ZYPP_API
| related

Definition at line 285 of file Arch.h.

## ◆ ZYPP_API [54/59]

const Arch Arch_m68k ZYPP_API
| related

Definition at line 288 of file Arch.h.

## ◆ ZYPP_API [55/59]

const Arch Arch_mips ZYPP_API
| related

Definition at line 291 of file Arch.h.

## ◆ ZYPP_API [56/59]

const Arch Arch_mipsel ZYPP_API
| related

Definition at line 293 of file Arch.h.

## ◆ ZYPP_API [57/59]

const Arch Arch_mips64 ZYPP_API
| related

Definition at line 295 of file Arch.h.

## ◆ ZYPP_API [58/59]

const Arch Arch_mips64el ZYPP_API
| related

Definition at line 297 of file Arch.h.

## ◆ ZYPP_API [59/59]

const Arch Arch_loong64 ZYPP_API
| related

Definition at line 300 of file Arch.h.

## ◆ operator<<() [1/2]

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

stream output.

Definition at line 306 of file Arch.h.

## ◆ dumpAsXmlOn()

std::ostream & dumpAsXmlOn | ( | std::ostream & | str,
|  | const Arch & | obj )
| related

XML output.

Definition at line 310 of file Arch.h.

## ◆ operator==() [1/4]

bool operator== | ( | const Arch & | lhs,
|  | const Arch & | rhs )
| related

Definition at line 316 of file Arch.h.

## ◆ operator==() [2/4]

bool operator== | ( | const Arch & | lhs,
|  | const std::string & | rhs )
| related

Definition at line 320 of file Arch.h.

## ◆ operator==() [3/4]

bool operator== | ( | const std::string & | lhs,
|  | const Arch & | rhs )
| related

Definition at line 324 of file Arch.h.

## ◆ operator!=() [1/4]

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

Definition at line 328 of file Arch.h.

## ◆ operator!=() [2/4]

bool operator!= | ( | const Arch & | lhs,
|  | const std::string & | rhs )
| related

Definition at line 332 of file Arch.h.

## ◆ operator!=() [3/4]

bool operator!= | ( | const std::string & | lhs,
|  | const Arch & | rhs )
| related

Definition at line 336 of file Arch.h.

## ◆ operator()()

bool operator() | ( | const zypp::Arch & | lhs,
|  | const zypp::Arch & | rhs ) const
| related

Default order for std::container based Arch::compare.

Definition at line 370 of file Arch.h.

## Member Data Documentation

## ◆ _entry

const CompatEntry* zypp::Arch::_entry
| private

Definition at line 148 of file Arch.h.

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

- zypp/Arch.h
- zypp/Arch.cc