foobar2000 SDK  2015-08-03
Public Member Functions | Private Attributes
foobar2000_io::format_filetimestamp

#include <filetimetools.h>

Public Member Functions

 format_filetimestamp (t_filetimestamp p_timestamp)
 
const char * get_ptr () const
 
 operator const char * () const
 

Private Attributes

pfc::string_fixed_t< 32 > m_buffer
 

Detailed Description

Warning: this formats according to system timezone settings, created strings should be used for display only, never for storage.

Definition at line 5 of file filetimetools.h.

Constructor & Destructor Documentation

format_filetimestamp::format_filetimestamp ( t_filetimestamp  p_timestamp)

Definition at line 75 of file filetimetools.cpp.

75  {
76  try {
77  SYSTEMTIME st; FILETIME ft;
78  if (FileTimeToLocalFileTime((FILETIME*)&p_timestamp,&ft)) {
79  if (FileTimeToSystemTime(&ft,&st)) {
80  m_buffer
81  << pfc::format_uint(st.wYear,4) << "-" << pfc::format_uint(st.wMonth,2) << "-" << pfc::format_uint(st.wDay,2) << " "
82  << pfc::format_uint(st.wHour,2) << ":" << pfc::format_uint(st.wMinute,2) << ":" << pfc::format_uint(st.wSecond,2);
83  return;
84  }
85  }
86  } catch(...) {}
88 }
static const char g_invalidMsg[]
pfc::string_fixed_t< 32 > m_buffer
Definition: filetimetools.h:11

Member Function Documentation

const char* foobar2000_io::format_filetimestamp::get_ptr ( ) const
inline

Definition at line 9 of file filetimetools.h.

9 {return m_buffer;}
pfc::string_fixed_t< 32 > m_buffer
Definition: filetimetools.h:11
foobar2000_io::format_filetimestamp::operator const char * ( ) const
inline

Definition at line 8 of file filetimetools.h.

8 {return m_buffer;}
pfc::string_fixed_t< 32 > m_buffer
Definition: filetimetools.h:11

Field Documentation

pfc::string_fixed_t<32> foobar2000_io::format_filetimestamp::m_buffer
private

Definition at line 11 of file filetimetools.h.


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