foobar2000 SDK  2015-08-03
Public Member Functions | Private Attributes
pfc::format_float

#include <string_base.h>

Public Member Functions

 format_float (double p_val, unsigned p_width=0, unsigned p_prec=7)
 
 format_float (const format_float &p_source)
 
const char * get_ptr () const
 
 operator const char * () const
 
const char * toString () const
 

Private Attributes

string8 m_buffer
 

Detailed Description

Definition at line 550 of file string_base.h.

Constructor & Destructor Documentation

pfc::format_float::format_float ( double  p_val,
unsigned  p_width = 0,
unsigned  p_prec = 7 
)

Definition at line 502 of file string_base.cpp.

503 {
504  char temp[64];
505  float_to_string(temp,64,p_val,p_prec,false);
506  temp[63] = 0;
507  t_size len = strlen(temp);
508  if (len < p_width)
509  m_buffer.add_chars(' ',p_width-len);
510  m_buffer += temp;
511 }
void add_chars(t_uint32 p_char, t_size p_count)
Definition: string_base.h:43
size_t t_size
Definition: int_types.h:48
void float_to_string(char *out, t_size out_max, double val, unsigned precision, bool b_sign)
pfc::format_float::format_float ( const format_float p_source)
inline

Definition at line 554 of file string_base.h.

554 {*this = p_source;}

Member Function Documentation

const char* pfc::format_float::get_ptr ( ) const
inline

Definition at line 556 of file string_base.h.

556 {return m_buffer.get_ptr();}
const char * get_ptr() const
Definition: string_base.h:382
pfc::format_float::operator const char * ( ) const
inline

Definition at line 558 of file string_base.h.

558 {return m_buffer.get_ptr();}
const char * get_ptr() const
Definition: string_base.h:382
const char* pfc::format_float::toString ( ) const
inline

Definition at line 557 of file string_base.h.

557 {return m_buffer.get_ptr();}
const char * get_ptr() const
Definition: string_base.h:382

Field Documentation

string8 pfc::format_float::m_buffer
private

Definition at line 560 of file string_base.h.


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