libzypp  17.14.0
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 <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)
 

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 );

Definition at line 210 of file String.h.

Member Function Documentation

◆ operator<<() [1/2]

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

Definition at line 213 of file String.h.

◆ operator<<() [2/2]

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

Definition at line 216 of file String.h.

◆ operator std::string()

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

Definition at line 219 of file String.h.

◆ asString()

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

Definition at line 220 of file String.h.

◆ str()

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

Definition at line 221 of file String.h.

◆ stream() [1/2]

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

Definition at line 223 of file String.h.

◆ stream() [2/2]

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

Definition at line 224 of file String.h.

◆ clear()

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

Definition at line 226 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 233 of file String.h.

Member Data Documentation

◆ _str

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

Definition at line 229 of file String.h.


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