BVB Source Codes

CRYENGINE Show ChunkData.h Source code

Return Download CRYENGINE: download ChunkData.h Source code - Download CRYENGINE Source code - Type:.h
  1. // Copyright 2001-2016 Crytek GmbH / Crytek Group. All rights reserved.
  2.  
  3. #pragma once
  4.  
  5. #include <limits>
  6.  
  7. #include <CryCore/Containers/CryArray.h>
  8.  
  9. class CChunkData
  10. {
  11. public:
  12.  
  13.         const char* GetData() const
  14.         {
  15.                 return m_data.data();
  16.         }
  17.  
  18.         int GetSize() const
  19.         {
  20.                 return m_data.size();
  21.         }
  22.  
  23.         template<class T>
  24.         void Add(const T& object)
  25.         {
  26.                 AddData(&object, sizeof(object));
  27.         }
  28.  
  29.         void AddData(const void* pSrcData, int srcDataSize)
  30.         {
  31.                 if (srcDataSize > 0)
  32.                 {
  33.                         const auto p = static_cast<const char*>(pSrcData);
  34.                         m_data.insert(m_data.end(), p, p + srcDataSize);
  35.                         assert(m_data.size() > 0 && m_data.size() <= (std::numeric_limits<int>::max)());
  36.                 }
  37.         }
  38.  
  39. private:
  40.  
  41.         DynArray<char, int> m_data;
  42. };
  43.  
downloadChunkData.h Source code - Download CRYENGINE Source code
Related Source Codes/Software:
postal - 2017-06-11
reactide - Reactide is the first dedicated IDE for React web ... 2017-06-11
rkt - rkt is a pod-native container engine for Linux. It... 2017-06-11
uWebSockets - Tiny WebSockets https://for... 2017-06-11
realworld - TodoMVC for the RealWorld - Exemplary fullstack Me... 2017-06-11
CRYENGINE - CRYENGINE is a powerful real-time game development... 2017-06-11
goreplay - GoReplay is an open-source tool for capturing and ... 2017-06-10
pyenv - Simple Python version management 2017-06-10
redux-saga - An alternative side effect model for Redux apps ... 2017-06-10
angular-starter - 2017-06-10

 Back to top