Ocular Engine
EndianOps.hpp
1 
17 #pragma once
18 #ifndef __H__OCULAR_UTILITIES_ENDIAN_OPERATIONS__H__
19 #define __H__OCULAR_UTILITIES_ENDIAN_OPERATIONS__H__
20 
21 #include "Common.hpp"
22 #include <cstdint>
23 
24 //------------------------------------------------------------------------------------------
25 
30 namespace Ocular
31 {
36  namespace Utils
37  {
41  namespace EndianOps
42  {
50  void convert(Endianness from, Endianness to, int8_t& value);
51 
59  void convert(Endianness from, Endianness to, int16_t& value);
60 
68  void convert(Endianness from, Endianness to, int32_t& value);
69 
77  void convert(Endianness from, Endianness to, int64_t& value);
78 
86  void convert(Endianness from, Endianness to, uint8_t& value);
87 
95  void convert(Endianness from, Endianness to, uint16_t& value);
96 
104  void convert(Endianness from, Endianness to, uint32_t& value);
105 
113  void convert(Endianness from, Endianness to, uint64_t& value);
114 
122  void convert(Endianness from, Endianness to, float& value);
123 
131  void convert(Endianness from, Endianness to, double& value);
132 
133  //------------------------------------------------------------------------------
134 
139  void convertToReverse(int8_t& value);
140 
145  void convertToReverse(int16_t& value);
146 
151  void convertToReverse(int32_t& value);
152 
157  void convertToReverse(int64_t& value);
158 
163  void convertToReverse(uint8_t& value);
164 
169  void convertToReverse(uint16_t& value);
170 
175  void convertToReverse(uint32_t& value);
176 
181  void convertToReverse(uint64_t& value);
182 
194  void convertToReverse(float& value);
195 
207  void convertToReverse(double& value);
208  }
212  }
216 }
221 //------------------------------------------------------------------------------------------
222 
223 #endif
Endianness
Definition: Common.hpp:89
Note: Once this library is made dynamic, this will no longer be needed.
Definition: Common.hpp:70