diff options
| author | Jørgen P. Tjernø <[email protected]> | 2013-12-02 19:31:46 -0800 |
|---|---|---|
| committer | Jørgen P. Tjernø <[email protected]> | 2013-12-02 19:46:31 -0800 |
| commit | f56bb35301836e56582a575a75864392a0177875 (patch) | |
| tree | de61ddd39de3e7df52759711950b4c288592f0dc /sp/src/public/html/htmlprotobuf.h | |
| parent | Mark some more files as text. (diff) | |
| download | source-sdk-2013-f56bb35301836e56582a575a75864392a0177875.tar.xz source-sdk-2013-f56bb35301836e56582a575a75864392a0177875.zip | |
Fix line endings. WHAMMY.
Diffstat (limited to 'sp/src/public/html/htmlprotobuf.h')
| -rw-r--r-- | sp/src/public/html/htmlprotobuf.h | 142 |
1 files changed, 71 insertions, 71 deletions
diff --git a/sp/src/public/html/htmlprotobuf.h b/sp/src/public/html/htmlprotobuf.h index 38ee6400..35d1d1d9 100644 --- a/sp/src/public/html/htmlprotobuf.h +++ b/sp/src/public/html/htmlprotobuf.h @@ -1,71 +1,71 @@ -//========= Copyright Valve Corporation, All rights reserved. ============//
-//
-// Purpose:
-//=============================================================================//
-
-#ifndef HTML_PROTOBUF
-#define HTML_PROTOBUF
-
-#ifdef _WIN32
-#pragma once
-#endif
-
-#include "tier1/utlbuffer.h"
-#include "html/htmlmessages.h"
-
-namespace google
-{
- namespace protobuf
- {
- class MessageLite;
- }
-}
-
-class CHTMLBaseProtoBufMsg
-{
-public:
- void SerializeCrossProc( CUtlBuffer *pBuffer ) const;
- bool BDeserializeCrossProc( CUtlBuffer *pBuffer );
-
-protected:
- void *m_pMsg;
- bool m_bIsValid;
-};
-
-
-//-----------------------------------------------------------------------------
-// Purpose: Base class for protobuf objects
-//-----------------------------------------------------------------------------
-template< typename PB_OBJECT_TYPE >
-class CHTMLProtoBufMsg : public CHTMLBaseProtoBufMsg
-{
-public:
- CHTMLProtoBufMsg( EHTMLCommands eMsg )
- {
- m_pMsg = new PB_OBJECT_TYPE;
- m_bIsValid = true;
- }
-
- // Construct and deserialize in one
- CHTMLProtoBufMsg( CUtlBuffer *pBuffer )
- {
- m_pMsg = NULL;
- m_bIsValid = BDeserializeCrossProc( pBuffer );
- }
-
- // Destructor
- virtual ~CHTMLProtoBufMsg()
- {
- delete (PB_OBJECT_TYPE *)m_pMsg;
- }
-
- bool BIsValid() { return m_bIsValid; }
-
- // Accessors
- PB_OBJECT_TYPE &Body() { return *((PB_OBJECT_TYPE*)( (google::protobuf::MessageLite *)m_pMsg )); }
- const PB_OBJECT_TYPE &BodyConst() const { return *((const PB_OBJECT_TYPE*)( (google::protobuf::MessageLite *)m_pMsg )); }
-
-};
-
-
-#endif // HTML_PROTOBUF
+//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +//=============================================================================// + +#ifndef HTML_PROTOBUF +#define HTML_PROTOBUF + +#ifdef _WIN32 +#pragma once +#endif + +#include "tier1/utlbuffer.h" +#include "html/htmlmessages.h" + +namespace google +{ + namespace protobuf + { + class MessageLite; + } +} + +class CHTMLBaseProtoBufMsg +{ +public: + void SerializeCrossProc( CUtlBuffer *pBuffer ) const; + bool BDeserializeCrossProc( CUtlBuffer *pBuffer ); + +protected: + void *m_pMsg; + bool m_bIsValid; +}; + + +//----------------------------------------------------------------------------- +// Purpose: Base class for protobuf objects +//----------------------------------------------------------------------------- +template< typename PB_OBJECT_TYPE > +class CHTMLProtoBufMsg : public CHTMLBaseProtoBufMsg +{ +public: + CHTMLProtoBufMsg( EHTMLCommands eMsg ) + { + m_pMsg = new PB_OBJECT_TYPE; + m_bIsValid = true; + } + + // Construct and deserialize in one + CHTMLProtoBufMsg( CUtlBuffer *pBuffer ) + { + m_pMsg = NULL; + m_bIsValid = BDeserializeCrossProc( pBuffer ); + } + + // Destructor + virtual ~CHTMLProtoBufMsg() + { + delete (PB_OBJECT_TYPE *)m_pMsg; + } + + bool BIsValid() { return m_bIsValid; } + + // Accessors + PB_OBJECT_TYPE &Body() { return *((PB_OBJECT_TYPE*)( (google::protobuf::MessageLite *)m_pMsg )); } + const PB_OBJECT_TYPE &BodyConst() const { return *((const PB_OBJECT_TYPE*)( (google::protobuf::MessageLite *)m_pMsg )); } + +}; + + +#endif // HTML_PROTOBUF |