zypp::IdString Class Reference

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

#include <IdString.h>

Inheritance diagram for zypp::IdString:
[legend]

List of all members.

Public Types

typedef sat::detail::IdType IdType

Public Member Functions

 IdString ()
 Default ctor, empty string.
 IdString (IdType id_r)
 Ctor from id.
 IdString (const char *str_r)
 Ctor from string.
 IdString (const std::string &str_r)
 Ctor from string.
bool empty () const
 Whether the string is empty.
unsigned size () const
 The strings size.
const char * c_str () const
 Conversion to const char *.
std::string asString () const
 Conversion to std::string.
bool compareEQ (const IdString &rhs) const
 Fast compare equal.
int compare (const IdString &rhs) const
 Compare IdString returning -1,0,1.
int compare (const char *rhs) const
int compare (const std::string &rhs) const
IdType id () const
 Expert backdoor.

Static Public Attributes

static const IdString Null
 No or Null string ( Id 0 ).
static const IdString Empty
 Empty string.

Private Member Functions

friend base::SafeBool () const
bool boolTest () const

Private Attributes

IdType _id

Related Functions

(Note that these are not member functions.)

std::ostream & operator<< (std::ostream &str, const IdString &obj)
std::ostream & dumpOn (std::ostream &str, const IdString &obj)
bool operator== (const IdString &lhs, const IdString &rhs)
bool operator!= (const IdString &lhs, const IdString &rhs)
bool operator< (const IdString &lhs, const IdString &rhs)
bool operator<= (const IdString &lhs, const IdString &rhs)
bool operator> (const IdString &lhs, const IdString &rhs)
bool operator>= (const IdString &lhs, const IdString &rhs)


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 38 of file IdString.h.


Member Typedef Documentation

Definition at line 42 of file IdString.h.


Constructor & Destructor Documentation

zypp::IdString::IdString (  )  [inline]

Default ctor, empty string.

Definition at line 46 of file IdString.h.

zypp::IdString::IdString ( IdType  id_r  )  [inline, explicit]

Ctor from id.

Definition at line 49 of file IdString.h.

zypp::IdString::IdString ( const char *  str_r  )  [explicit]

Ctor from string.

Definition at line 31 of file IdString.cc.

zypp::IdString::IdString ( const std::string &  str_r  )  [explicit]

Ctor from string.

Definition at line 35 of file IdString.cc.


Member Function Documentation

bool zypp::IdString::empty (  )  const [inline]

unsigned zypp::IdString::size (  )  const

The strings size.

Definition at line 39 of file IdString.cc.

References c_str().

Referenced by zypp::IdStringType< ResKind >::size().

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

std::string zypp::IdString::asString (  )  const [inline]

bool zypp::IdString::compareEQ ( const IdString rhs  )  const [inline]

Fast compare equal.

Definition at line 88 of file IdString.h.

References _id, and id().

Referenced by zypp::Edition::match(), operator!=(), and operator==().

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

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 57 of file IdString.cc.

References _id, and c_str().

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 98 of file IdString.h.

References compare().

Referenced by compare().

IdType zypp::IdString::id (  )  const [inline]

zypp::IdString::base::SafeBool (  )  const [private]

bool zypp::IdString::boolTest (  )  const [inline, private]

Definition at line 109 of file IdString.h.

References _id.


Friends And Related Function Documentation

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

Stream output

Definition at line 72 of file IdString.cc.

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

Stream output

Definition at line 77 of file IdString.cc.

bool operator== ( const IdString lhs,
const IdString rhs 
) [related]

Equal

Definition at line 122 of file IdString.h.

References compareEQ().

bool operator!= ( const IdString lhs,
const IdString rhs 
) [related]

NotEqual

Definition at line 138 of file IdString.h.

References compareEQ().

bool operator< ( const IdString lhs,
const IdString rhs 
) [related]

Less

Definition at line 154 of file IdString.h.

References compare().

bool operator<= ( const IdString lhs,
const IdString rhs 
) [related]

LessEqual

Definition at line 170 of file IdString.h.

References compare().

bool operator> ( const IdString lhs,
const IdString rhs 
) [related]

Greater

Definition at line 186 of file IdString.h.

References compare().

bool operator>= ( const IdString lhs,
const IdString rhs 
) [related]

GreaterEqual

Definition at line 202 of file IdString.h.

References compare().


Member Data Documentation

No or Null string ( Id 0 ).

Definition at line 59 of file IdString.h.

Empty string.

Definition at line 62 of file IdString.h.

Definition at line 111 of file IdString.h.

Referenced by boolTest(), c_str(), compare(), compareEQ(), empty(), and id().


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

doxygen