Scippy

SoPlex

Sequential object-oriented simPlex

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.

Definition at line 3334 of file format.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
private
Enumerator
buffer_size 

Definition at line 3338 of file format.h.

Constructor & Destructor Documentation

◆ format_int() [1/6]

format_int ( int  value)
explicit

Definition at line 3357 of file format.h.

◆ format_int() [2/6]

format_int ( long  value)
explicit

Definition at line 3358 of file format.h.

◆ format_int() [3/6]

format_int ( long long  value)
explicit

Definition at line 3359 of file format.h.

◆ format_int() [4/6]

format_int ( unsigned  value)
explicit

Definition at line 3360 of file format.h.

◆ format_int() [5/6]

format_int ( unsigned long  value)
explicit

Definition at line 3361 of file format.h.

◆ format_int() [6/6]

format_int ( unsigned long long  value)
explicit

Definition at line 3362 of file format.h.

Member Function Documentation

◆ c_str()

const char* c_str ( ) const

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

Definition at line 3380 of file format.h.

◆ data()

const char* data ( ) const

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

Definition at line 3374 of file format.h.

◆ format_signed()

char* format_signed ( Int  value)
private

Definition at line 3347 of file format.h.

◆ format_unsigned()

char* format_unsigned ( UInt  value)
private

Definition at line 3342 of file format.h.

References detail::format_decimal().

◆ size()

size_t size ( ) const

Returns the number of characters written to the output buffer.

Definition at line 3366 of file format.h.

References detail::to_unsigned().

◆ str()

std::string str ( ) const

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

Definition at line 3390 of file format.h.

Member Data Documentation

◆ buffer_

char buffer_[buffer_size]
mutableprivate

Definition at line 3339 of file format.h.

◆ str_

char* str_
private

Definition at line 3340 of file format.h.