Rosetta
Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
format_int Class Reference

#include <format.h>

Public Member Functions

 format_int (int value)
 
 format_int (long value)
 
 format_int (long long value)
 
 format_int (unsigned value)
 
 format_int (unsigned long value)
 
 format_int (unsigned long long value)
 
size_t size () const
 
const char * data () const
 
const char * c_str () const
 
std::string str () const
 

Private Types

enum  { buffer_size = std::numeric_limits<unsigned long long>::digits10 + 3 }
 

Private Member Functions

template<typename UInt >
char * format_unsigned (UInt value)
 
template<typename Int >
char * format_signed (Int value)
 

Private Attributes

char buffer_ [buffer_size]
 
char * str_
 

Detailed Description

Fast integer formatter.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
private
Enumerator
buffer_size 

Constructor & Destructor Documentation

◆ format_int() [1/6]

format_int::format_int ( int  value)
inlineexplicit

◆ format_int() [2/6]

format_int::format_int ( long  value)
inlineexplicit

◆ format_int() [3/6]

format_int::format_int ( long long  value)
inlineexplicit

◆ format_int() [4/6]

format_int::format_int ( unsigned  value)
inlineexplicit

◆ format_int() [5/6]

format_int::format_int ( unsigned long  value)
inlineexplicit

◆ format_int() [6/6]

format_int::format_int ( unsigned long long  value)
inlineexplicit

Member Function Documentation

◆ c_str()

const char* format_int::c_str ( ) const
inline

Returns a pointer to the output buffer content with terminating null character appended.

◆ data()

const char* format_int::data ( ) const
inline

Returns a pointer to the output buffer content. No terminating null character is appended.

◆ format_signed()

template<typename Int >
char* format_int::format_signed ( Int  value)
inlineprivate

References begin, and value.

◆ format_unsigned()

template<typename UInt >
char* format_int::format_unsigned ( UInt  value)
inlineprivate

◆ size()

size_t format_int::size ( ) const
inline

Returns the number of characters written to the output buffer.

References detail::to_unsigned().

◆ str()

std::string format_int::str ( ) const
inline

\rst Returns the content of the output buffer as an std::string. \endrst

References subloop_histogram::size.

Member Data Documentation

◆ buffer_

char format_int::buffer_[buffer_size]
mutableprivate

◆ str_

char* format_int::str_
private

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