libzypp: zypp::IdString Class Reference

libzypp 17.25.10

Public Types | Public Member Functions | Static Public Attributes | Private Attributes | Related Functions | List of all members
zypp::IdString Class Reference

Access to the sat-pools string space. More...

`#include <IdString.h>`

Inheritance diagram for zypp::IdString:
[legend]

## Public Types
typedef sat::detail::IdType | IdType

## Public Member Functions
constexpr | IdString ()
| Default ctor, empty string. More...
constexpr | IdString (IdType id_r)
| Ctor from id. More...
| IdString (const char *str_r)
| Ctor from string. More...
| IdString (const char *str_r, unsigned len_r)
| Ctor from string (pointer,length). More...
| IdString (const std::string &str_r)
| Ctor from string. More...
| IdString (boost::string_ref str_r)
| Ctor from boost::string_ref. More...
constexpr | operator bool () const
| Evaluate in a boolean context `( != `Null` )`. More...
constexpr bool | empty () const
| Whether the string is empty. More...
unsigned | size () const
| The strings size. More...
const char * | c_str () const
| Conversion to `const char *` More...
std::string | asString () const
| Conversion to `std::string` More...
| operator std::string () const
| Explicit conversion to std::string. More...
bool | compareEQ (const IdString &rhs) const
| Fast compare equal. More...
int | compare (const IdString &rhs) const
| Compare IdString returning `-1,0,1`. More...
int | compare (const char *rhs) const
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
int | compare (const std::string &rhs) const
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
IdType | id () const
| Expert backdoor. More...

## Static Public Attributes
static const IdString | Null
| No or Null string ( Id `0` ). More...
static const IdString | Empty
| Empty string. More...

## Private Attributes
IdType | _id

## Related Functions
(Note that these are not member functions.)
std::ostream & | operator<< (std::ostream &str, const IdString &obj)
| Stream output. More...
std::ostream & | dumpOn (std::ostream &str, const IdString &obj)
| Stream output. More...
bool | operator== (const IdString &lhs, const IdString &rhs)
| Equal. More...
bool | operator!= (const IdString &lhs, const IdString &rhs)
| NotEqual. More...
bool | operator< (const IdString &lhs, const IdString &rhs)
| Less. More...
bool | operator<= (const IdString &lhs, const IdString &rhs)
| LessEqual. More...
bool | operator> (const IdString &lhs, const IdString &rhs)
| Greater. More...
bool | operator>= (const IdString &lhs, const IdString &rhs)
| GreaterEqual. More...

## Additional Inherited Members
Static Protected Member Functions inherited from zypp::sat::detail::PoolMember
static PoolImpl & | myPool ()

## Detailed Description

Access to the sat-pools string space.

Construction from string will place a copy of the string in the string space, if it is not already present.

While comparison differs between IdString::Null and IdString::Empty ( `NULL` and `""` ), both are represented by an empty string `""`.

Definition at line 42 of file IdString.h.

## Member Typedef Documentation

## ◆ IdType

typedef sat::detail::IdType zypp::IdString::IdType

Definition at line 45 of file IdString.h.

## Constructor & Destructor Documentation

## ◆ IdString() [1/6]

constexpr zypp::IdString::IdString | ( |  | ) |
| inlineconstexpr

Default ctor, empty string.

Definition at line 49 of file IdString.h.

## ◆ IdString() [2/6]

constexpr zypp::IdString::IdString | ( | IdType | id_r | ) |
| inlineexplicitconstexpr

Ctor from id.

Definition at line 52 of file IdString.h.

## ◆ IdString() [3/6]

zypp::IdString::IdString | ( | const char * | str_r | ) |
| explicit

Ctor from string.

Definition at line 31 of file IdString.cc.

## ◆ IdString() [4/6]

zypp::IdString::IdString | ( | const char * | str_r,
|  | unsigned | len_r
| ) |  |

Ctor from string (pointer,length).

Definition at line 35 of file IdString.cc.

## ◆ IdString() [5/6]

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

Ctor from string.

Definition at line 39 of file IdString.cc.

## ◆ IdString() [6/6]

zypp::IdString::IdString | ( | boost::string_ref | str_r | ) |
| explicit

Ctor from boost::string_ref.

Definition at line 43 of file IdString.cc.

## Member Function Documentation

## ◆ operator bool()

constexpr zypp::IdString::operator bool | ( |  | ) | const
| inlineexplicitconstexpr

Evaluate in a boolean context `( != `Null` )`.

Definition at line 81 of file IdString.h.

## ◆ empty()

constexpr bool zypp::IdString::empty | ( |  | ) | const
| inlineconstexpr

Whether the string is empty.

This is true for Null and Empty.

Definition at line 87 of file IdString.h.

## ◆ size()

unsigned zypp::IdString::size | ( |  | ) | const

The strings size.

Definition at line 47 of file IdString.cc.

## ◆ c_str()

const char * zypp::IdString::c_str | ( |  | ) | const

Conversion to `const char *`

Definition at line 50 of file IdString.cc.

## ◆ asString()

std::string zypp::IdString::asString | ( |  | ) | const
| inline

Conversion to `std::string`

Definition at line 98 of file IdString.h.

## ◆ operator std::string()

zypp::IdString::operator std::string | ( |  | ) | const
| inlineexplicit

Explicit conversion to std::string.

Definition at line 102 of file IdString.h.

## ◆ compareEQ()

bool zypp::IdString::compareEQ | ( | const IdString & | rhs | ) | const
| inline

Fast compare equal.

Definition at line 107 of file IdString.h.

## ◆ compare() [1/3]

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

Compare IdString returning `-1,0,1`.

Definition at line 53 of file IdString.cc.

## ◆ compare() [2/3]

int zypp::IdString::compare | ( | const char * | rhs | ) | 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 65 of file IdString.cc.

## ◆ compare() [3/3]

int zypp::IdString::compare | ( | const std::string & | rhs | ) | 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 117 of file IdString.h.

## ◆ id()

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

Expert backdoor.

Definition at line 122 of file IdString.h.

## Friends And Related Function Documentation

## ◆ operator<<()

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

Stream output.

Definition at line 80 of file IdString.cc.

## ◆ dumpOn()

std::ostream & dumpOn | ( | std::ostream & | str,
|  | const IdString & | obj
| ) |  |
| related

Stream output.

Definition at line 85 of file IdString.cc.

## ◆ operator==()

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

Equal.

Definition at line 137 of file IdString.h.

## ◆ operator!=()

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

NotEqual.

Definition at line 153 of file IdString.h.

## ◆ operator<()

bool operator< | ( | const IdString & | lhs,
|  | const IdString & | rhs
| ) |  |
| related

Less.

Definition at line 169 of file IdString.h.

## ◆ operator<=()

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

LessEqual.

Definition at line 185 of file IdString.h.

## ◆ operator>()

bool operator> | ( | const IdString & | lhs,
|  | const IdString & | rhs
| ) |  |
| related

Greater.

Definition at line 201 of file IdString.h.

## ◆ operator>=()

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

GreaterEqual.

Definition at line 217 of file IdString.h.

## Member Data Documentation

## ◆ Null

const IdString zypp::IdString::Null
| static

No or Null string ( Id `0` ).

Definition at line 74 of file IdString.h.

## ◆ Empty

const IdString zypp::IdString::Empty
| static

Empty string.

Definition at line 77 of file IdString.h.

## ◆ _id

IdType zypp::IdString::_id
| private

Definition at line 126 of file IdString.h.

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

- zypp/IdString.h
- zypp/IdString.cc