-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSerializationUtility.h
More file actions
53 lines (46 loc) · 2.78 KB
/
Copy pathSerializationUtility.h
File metadata and controls
53 lines (46 loc) · 2.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/**************************************************
Zlib Copyright 2015 Daniel "MonzUn" Bengtsson
***************************************************/
#pragma once
#include "UtilityLibraryDefine.h"
#include "PlatformDefinitions.h"
#include <stdint.h>
#include <glm/glm.hpp>
#include "Byte.h"
#if PLATFORM == PLATFORM_LINUX
#include <stdlib.h> // For size_t
#endif
#include "UtilityLibraryDefine.h"
namespace SerializationUtility {
UTILITY_API void CopyAndIncrementDestination( Byte*& destination, const void* const source, const size_t length );
UTILITY_API void CopyAndIncrementSource( void* const destination, const Byte*& source, const size_t length );
UTILITY_API size_t GetPointerDiff( const void* first, const void* second );
UTILITY_API void WriteInt16( int16_t value, Byte*& destination );
UTILITY_API void WriteInt32( int32_t value, Byte*& destination );
UTILITY_API void WriteInt64( int64_t value, Byte*& destination );
UTILITY_API void WriteUint16( uint16_t value, Byte*& destination );
UTILITY_API void WriteUint32( uint32_t value, Byte*& destination );
UTILITY_API void WriteUint64( uint64_t value, Byte*& destination );
UTILITY_API void WriteFloat( float value, Byte*& destination );
UTILITY_API void WriteDouble( double value, Byte*& destination );
UTILITY_API void WriteBool( bool value, Byte*& destination );
UTILITY_API void WritePointer( void* value, Byte*& destination );
UTILITY_API void WriteString( const rString& value, Byte*& destination );
UTILITY_API void WriteVec2( const glm::vec2& value, Byte*& destination );
UTILITY_API void WriteVec3( const glm::vec3& value, Byte*& destination );
UTILITY_API void WriteQuaternion( const glm::quat& value, Byte*& destination );
UTILITY_API void ReadInt16( int16_t& value, const Byte*& source );
UTILITY_API void ReadInt32( int32_t& value, const Byte*& source );
UTILITY_API void ReadInt64( int64_t& value, const Byte*& source );
UTILITY_API void ReadUint16( uint16_t& value, const Byte*& source );
UTILITY_API void ReadUint32( uint32_t& value, const Byte*& source );
UTILITY_API void ReadUint64( uint64_t& value, const Byte*& source );
UTILITY_API void ReadFloat( float& value, const Byte*& source );
UTILITY_API void ReadDouble( double& value, const Byte*& source );
UTILITY_API void ReadBool( bool& value, const Byte*& source );
UTILITY_API void ReadPointer( void*& value, const Byte*& source );
UTILITY_API void ReadString( rString& value, const Byte*& source );
UTILITY_API void ReadVec2( glm::vec2& value, const Byte*& source );
UTILITY_API void ReadVec3( glm::vec3& value, const Byte*& source );
UTILITY_API void ReadQuaternion( glm::quat& value, const Byte*& source );
}