Inexor
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
inexor::util::StringFormatter Class Reference

Format strings with a one-liner. More...

#include <StringFormatter.hpp>

Classes

class  FmtMark
 

Public Member Functions

template<typename T >
StringFormatteroperator<< (T s)
 
 operator std::string ()
 

Protected Member Functions

 StringFormatter ()
 
 StringFormatter (const StringFormatter &other)
 

Protected Attributes

std::ostringstream sbuf
 

Detailed Description

Format strings with a one-liner.

This class can be used to quickly construct strings:

std::string foo = fmt << "Hello, we are he " << "five" << "illuminati!! " << 5 << std::endl; // => "Hello, we are the five illuminati!! 5\n"

TODO: Move semantics?

Constructor & Destructor Documentation

inexor::util::StringFormatter::StringFormatter ( )
inlineprotected
inexor::util::StringFormatter::StringFormatter ( const StringFormatter other)
inlineprotected

References sbuf.

Member Function Documentation

inexor::util::StringFormatter::operator std::string ( )
inline

References sbuf.

template<typename T >
StringFormatter& inexor::util::StringFormatter::operator<< ( s)
inline

References sbuf.

Member Data Documentation

std::ostringstream inexor::util::StringFormatter::sbuf
protected

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