libzypp 17.31.23
zypp::str::Str Class Reference

Convenient building of std::string via std::ostringstream Basically a std::ostringstream autoconvertible to std::string for building string arguments. More...

#include <base/String.h>

Public Member Functions

template<class Tp >
Stroperator<< (Tp &&val)
 
Stroperator<< (std::ostream &(*iomanip)(std::ostream &))
 
 operator std::string () const
 
std::string asString () const
 
std::string str () const
 
const std::ostream & stream () const
 
std::ostream & stream ()
 
void clear ()
 

Private Attributes

std::ostringstream _str
 

Related Functions

(Note that these are not member functions.)

std::ostream & operator<< (std::ostream &str, const Str &obj)
 Stream output.
 

Detailed Description

Convenient building of std::string via std::ostringstream Basically a std::ostringstream autoconvertible to std::string for building string arguments.

void fnc( const std::string & txt_r );
fnc( str::Str() << "Hello " << 13 );
std::string txt( str::Str() << 45 );
Convenient building of std::string via std::ostringstream Basically a std::ostringstream autoconverti...
Definition: String.h:212

Definition at line 211 of file String.h.

Member Function Documentation

◆ operator<<() [1/2]

template<class Tp >
Str & zypp::str::Str::operator<< ( Tp &&  val)
inline

Definition at line 214 of file String.h.

◆ operator<<() [2/2]

Str & zypp::str::Str::operator<< ( std::ostream &(*)(std::ostream &)  iomanip)
inline

Definition at line 217 of file String.h.

◆ operator std::string()

zypp::str::Str::operator std::string ( ) const
inline

Definition at line 220 of file String.h.

◆ asString()

std::string zypp::str::Str::asString ( ) const
inline

Definition at line 221 of file String.h.

◆ str()

std::string zypp::str::Str::str ( ) const
inline

Definition at line 222 of file String.h.

◆ stream() [1/2]

const std::ostream & zypp::str::Str::stream ( ) const
inline

Definition at line 224 of file String.h.

◆ stream() [2/2]

std::ostream & zypp::str::Str::stream ( )
inline

Definition at line 225 of file String.h.

◆ clear()

void zypp::str::Str::clear ( )
inline

Definition at line 227 of file String.h.

Friends And Related Function Documentation

◆ operator<<()

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

Stream output.

Definition at line 234 of file String.h.

Member Data Documentation

◆ _str

std::ostringstream zypp::str::Str::_str
private

Definition at line 230 of file String.h.


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