libzypp: zypp::str::Format Class Reference

libzypp 17.36.6

Public Member Functions | Protected Attributes | Related Symbols | List of all members
zypp::str::Format Class Reference

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

`#include <zypp-core/base/String.h>`

## Public Member Functions
| Format ()
| Format (const std::string &format_r)
template<class Tp>
Format & | operator% (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 Symbols
(Note that these are not member symbols.)
std::ostream & | operator<< (std::ostream &str, const Format &obj)
| Stream output.

## Detailed Description

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

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

Note
  It won't complain about malformed or incomplete format strings. Usefull when dealing with translations or classes providing a default formater.
  void fnc( const std::string & txt_r );
  fnc( str::Format("Hello %1%") % 13 );
  std::string txt( str::Format("Hello %1%") % 13 );
  zypp::str::Format
  Convenient building of std::string with boost::format.
  Definition String.h:253

Definition at line 252 of file String.h.

## Constructor & Destructor Documentation

## ◆ Format() [1/2]

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

Definition at line 254 of file String.h.

## ◆ Format() [2/2]

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

Definition at line 255 of file String.h.

## Member Function Documentation

## ◆ operator%()

template<class Tp>

Format & zypp::str::Format::operator% | ( | Tp && | arg | ) |
| inline

Definition at line 258 of file String.h.

## ◆ operator std::string()

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

Definition at line 261 of file String.h.

## ◆ asString()

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

Definition at line 262 of file String.h.

## ◆ str()

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

Definition at line 263 of file String.h.

## ◆ fmter() [1/2]

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

Definition at line 265 of file String.h.

## ◆ fmter() [2/2]

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

Definition at line 266 of file String.h.

## Friends And Related Symbol Documentation

## ◆ operator<<()

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

Stream output.

Definition at line 273 of file String.h.

## Member Data Documentation

## ◆ _fmter

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

Definition at line 269 of file String.h.

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

- zypp-core/base/String.h