diff options
| author | Joe Ludwig <[email protected]> | 2013-06-26 15:22:04 -0700 |
|---|---|---|
| committer | Joe Ludwig <[email protected]> | 2013-06-26 15:22:04 -0700 |
| commit | 39ed87570bdb2f86969d4be821c94b722dc71179 (patch) | |
| tree | abc53757f75f40c80278e87650ea92808274aa59 /sp/src/common/replay/replaytime.h | |
| download | source-sdk-2013-39ed87570bdb2f86969d4be821c94b722dc71179.tar.xz source-sdk-2013-39ed87570bdb2f86969d4be821c94b722dc71179.zip | |
First version of the SOurce SDK 2013
Diffstat (limited to 'sp/src/common/replay/replaytime.h')
| -rw-r--r-- | sp/src/common/replay/replaytime.h | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/sp/src/common/replay/replaytime.h b/sp/src/common/replay/replaytime.h new file mode 100644 index 00000000..02359db7 --- /dev/null +++ b/sp/src/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 |