diff options
| author | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
|---|---|---|
| committer | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
| commit | 3bf9df6b2785fa6d951086978a3e66f49427166a (patch) | |
| tree | 2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /common/replay/replaytime.h | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'common/replay/replaytime.h')
| -rw-r--r-- | common/replay/replaytime.h | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/common/replay/replaytime.h b/common/replay/replaytime.h new file mode 100644 index 0000000..eb1c329 --- /dev/null +++ b/common/replay/replaytime.h @@ -0,0 +1,57 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +//=======================================================================================// + +#ifndef REPLAYTIME_H +#define REPLAYTIME_H +#ifdef _WIN32 +#pragma once +#endif + +//---------------------------------------------------------------------------------------- + +class KeyValues; + +//---------------------------------------------------------------------------------------- + +#include "vgui/ILocalize.h" + +//---------------------------------------------------------------------------------------- + +class CReplayTime +{ +public: + CReplayTime(); + + void InitDateAndTimeToNow(); + + void Read( KeyValues *pIn ); + void Write( KeyValues *pOut ); + + // Modifiers: + void SetDate( int nDay, int nMonth, int nYear ); + void SetTime( int nHour, int nMin, int nSec ); + inline void SetRawDate( int nRawDate ) { m_fDate = nRawDate; } + inline void SetRawTime( int nRawTime ) { m_fTime = nRawTime; } + + // Accessors: + void GetTime( int &nHour, int &nMin, int &nSec ) const; + void GetDate( int &nDay, int &nMonth, int &nYear ) const; + + static const char *FormatTimeString( int nSecs ); + static const char *FormatPreciseTimeString( float flSecs ); + static const wchar_t *GetLocalizedMonth( vgui::ILocalize *pLocalize, int nMonth ); + static const wchar_t *GetLocalizedDay( vgui::ILocalize *pLocalize, int nDay ); + static const wchar_t *GetLocalizedYear( vgui::ILocalize *pLocalize, int nYear ); + static const wchar_t *GetLocalizedTime( vgui::ILocalize *pLocalize, int nHour, int nMin, int nSec ); + static const wchar_t *GetLocalizedDate( vgui::ILocalize *pLocalize, int nDay, int nMonth, int nYear, + int *pHour = NULL, int *pMin = NULL, int *pSec = NULL, bool bForceFullFormat = false ); // bForceFullFormat true will keep from returning "today" or "yesterday" + static const wchar_t *GetLocalizedDate( vgui::ILocalize *pLocalize, const CReplayTime &t, bool bForceFullFormat = false ); + + int m_fDate; // Representation of a date (bitfield) + int m_fTime; // Representation of time (bitfield) +}; + +//---------------------------------------------------------------------------------------- + +#endif // REPLAYTIME_H
\ No newline at end of file |