libzypp  15.28.6
zypp::str::Format Class Reference

Convenient building of std::string with boost::format. More...

#include <String.h>

Inheritance diagram for zypp::str::Format:

Public Member Functions

 Format ()
 
 Format (const std::string &format_r)
 
template<class Tp >
Formatoperator% (Tp &&arg)
 
 operator std::string () const
 
std::string asString () const
 
std::string str () const
 
const boost::format & fmter () const
 
boost::format & fmter ()
 

Protected Attributes

boost::format _fmter
 

Related Functions

(Note that these are not member functions.)

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

Detailed Description

Convenient building of std::string with boost::format.

Basically a boost::format autoconvertible to std::string for building string arguments.

void fnc( const std::string & txt_r );
fnc( str::Format("Hello %1%") % 13 );
std::string txt( str::Format("Hello %1%") % 13 );

Definition at line 247 of file String.h.

Constructor & Destructor Documentation

zypp::str::Format::Format ( )
inline

Definition at line 249 of file String.h.

zypp::str::Format::Format ( const std::string &  format_r)
inline

Definition at line 250 of file String.h.

Member Function Documentation

template<class Tp >
Format& zypp::str::Format::operator% ( Tp &&  arg)
inline

Definition at line 253 of file String.h.

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

Definition at line 256 of file String.h.

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

Definition at line 257 of file String.h.

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

Definition at line 258 of file String.h.

const boost::format& zypp::str::Format::fmter ( ) const
inline

Definition at line 260 of file String.h.

boost::format& zypp::str::Format::fmter ( )
inline

Definition at line 261 of file String.h.

Friends And Related Function Documentation

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

Stream output

Definition at line 268 of file String.h.

Member Data Documentation

boost::format zypp::str::Format::_fmter
protected

Definition at line 264 of file String.h.


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