foobar2000 SDK  2015-01-14
Public Member Functions | Private Attributes
pfc::format_hex_lowercase

#include <string_base.h>

Public Member Functions

 format_hex_lowercase (t_uint64 p_val, unsigned p_width=0)
 
 format_hex_lowercase (const format_hex_lowercase &p_source)
 
const char * get_ptr () const
 
 operator const char * () const
 
const char * toString () const
 

Private Attributes

char m_buffer [17]
 

Detailed Description

Definition at line 598 of file string_base.h.

Constructor & Destructor Documentation

pfc::format_hex_lowercase::format_hex_lowercase ( t_uint64  p_val,
unsigned  p_width = 0 
)

Definition at line 547 of file string_base.cpp.

548 {
549  if (p_width > 16) p_width = 16;
550  else if (p_width == 0) p_width = 1;
551  char temp[16];
552  unsigned n;
553  for(n=0;n<16;n++)
554  {
555  temp[15-n] = format_hex_char_lowercase((unsigned)(p_val & 0xF));
556  p_val >>= 4;
557  }
558 
559  for(n=0;n<16 && temp[n] == '0';n++) {}
560 
561  if (n > 16 - p_width) n = 16 - p_width;
562 
563  char * out = m_buffer;
564  for(;n<16;n++)
565  *(out++) = temp[n];
566  *out = 0;
567 }
char format_hex_char_lowercase(unsigned p_val)
pfc::format_hex_lowercase::format_hex_lowercase ( const format_hex_lowercase p_source)
inline

Definition at line 602 of file string_base.h.

602 {*this = p_source;}

Member Function Documentation

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

Definition at line 603 of file string_base.h.

603 {return m_buffer;}
pfc::format_hex_lowercase::operator const char * ( ) const
inline

Definition at line 604 of file string_base.h.

604 {return m_buffer;}
const char* pfc::format_hex_lowercase::toString ( ) const
inline

Definition at line 605 of file string_base.h.

605 {return m_buffer;}

Field Documentation

char pfc::format_hex_lowercase::m_buffer[17]
private

Definition at line 607 of file string_base.h.


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