foobar2000 SDK  2015-08-03
Functions
file_info.cpp File Reference

Go to the source code of this file.

Functions

template<typename float_t >
static void _readFloat (float_t &out, const uint8_t *&ptr, size_t &remaining)
 
template<typename int_t >
void _readInt (int_t &out, const uint8_t *&ptr, size_t &remaining)
 
static const char * _readString (const uint8_t *&ptr, size_t &remaining)
 
static bool is_valid_bps (t_int64 val)
 
static bool is_valid_field_name_char (char p_char)
 

Function Documentation

template<typename float_t >
static void _readFloat ( float_t &  out,
const uint8_t *&  ptr,
size_t &  remaining 
)
static

Definition at line 663 of file file_info.cpp.

663  {
664  union {
666  float_t f;
667  } u;
668  _readInt(u.i, ptr, remaining);
669  out = u.f;
670 }
void _readInt(int_t &out, const uint8_t *&ptr, size_t &remaining)
Definition: file_info.cpp:658
template<typename int_t >
void _readInt ( int_t &  out,
const uint8_t *&  ptr,
size_t &  remaining 
)

Definition at line 658 of file file_info.cpp.

658  {
659  if (remaining < sizeof(out)) throw exception_io_data();
660  pfc::decode_little_endian( out, ptr ); ptr += sizeof(out); remaining -= sizeof(out);
661 }
void decode_little_endian(TInt &p_out, const t_uint8 *p_buffer)
static const char* _readString ( const uint8_t *&  ptr,
size_t &  remaining 
)
static

Definition at line 648 of file file_info.cpp.

648  {
649  const char * rv = (const char*)ptr;
650  for(;;) {
651  if (remaining == 0) throw exception_io_data();
652  uint8_t byte = *ptr++; --remaining;
653  if (byte == 0) break;
654  }
655  return rv;
656 }
t_uint8 byte
Definition: mp3_utils.h:11
static bool is_valid_bps ( t_int64  val)
static

Definition at line 272 of file file_info.cpp.

273 {
274  return val>0 && val<=256;
275 }
static bool is_valid_field_name_char ( char  p_char)
static

Definition at line 494 of file file_info.cpp.

494  {
495  return p_char >= 32 && p_char < 127 && p_char != '=' && p_char != '%' && p_char != '<' && p_char != '>';
496 }