GEOS  3.13.0dev
ByteOrderValues.h
1 /**********************************************************************
2  *
3  * GEOS - Geometry Engine Open Source
4  * http://geos.osgeo.org
5  *
6  * Copyright (C) 2005-2006 Refractions Research Inc.
7  * Copyright (C) 2001-2002 Vivid Solutions Inc.
8  *
9  * This is free software; you can redistribute and/or modify it under
10  * the terms of the GNU Lesser General Public Licence as published
11  * by the Free Software Foundation.
12  * See the COPYING file for more information.
13  *
14  **********************************************************************
15  *
16  * Last port: io/ByteOrderValues.java rev. 1.3 (JTS-1.10)
17  *
18  **********************************************************************/
19 
20 #pragma once
21 
22 #include <geos/export.h>
23 #include <cstdint>
24 
25 namespace geos {
26 namespace io {
27 
36 class GEOS_DLL ByteOrderValues {
37 
38 public:
39 
40  enum EndianType {
41  ENDIAN_BIG = 0,
42  ENDIAN_LITTLE = 1
43  };
44 
45  static int32_t getInt(const unsigned char* buf, int byteOrder);
46  static void putInt(int32_t intValue, unsigned char* buf, int byteOrder);
47 
48  static uint32_t getUnsigned(const unsigned char* buf, int byteOrder);
49  static void putUnsigned(uint32_t intValue, unsigned char* buf, int byteOrder);
50 
51  static int64_t getLong(const unsigned char* buf, int byteOrder);
52  static void putLong(int64_t longValue, unsigned char* buf, int byteOrder);
53 
54  static double getDouble(const unsigned char* buf, int byteOrder);
55  static void putDouble(double doubleValue, unsigned char* buf, int byteOrder);
56 
57 };
58 
59 } // namespace io
60 } // namespace geos
61 
Methods to read and write primitive datatypes from/to byte sequences, allowing the byte order to be s...
Definition: ByteOrderValues.h:36
Basic namespace for all GEOS functionalities.
Definition: Angle.h:25