- Main Page
- Namespaces
- Classes
- Files
- Related Pages

# ByteOrderValues.h

    00001 /**********************************************************************
    00002  * $Id: ByteOrderValues.h 1820 2006-09-06 16:54:23Z mloskot $
    00003  *
    00004  * GEOS - Geometry Engine Open Source
    00005  * http://geos.refractions.net
    00006  *
    00007  * Copyright (C) 2005-2006 Refractions Research Inc.
    00008  * Copyright (C) 2001-2002 Vivid Solutions Inc.
    00009  *
    00010  * This is free software; you can redistribute and/or modify it under
    00011  * the terms of the GNU Lesser General Public Licence as published
    00012  * by the Free Software Foundation.
    00013  * See the COPYING file for more information.
    00014  *
    00015  **********************************************************************/
    00016
    00017 #ifndef GEOS_IO_BYTEORDERVALUES_H
    00018 #define GEOS_IO_BYTEORDERVALUES_H
    00019
    00020 #include <geos/platform.h>
    00021
    00022 namespace geos {
    00023 namespace io {
    00024
    00025 /*
    00026  * \class ByteOrderValues io.h geos.h
    00027  *
    00028  * Methods to read and write primitive datatypes from/to byte
    00029  * sequences, allowing the byte order to be specified
    00030  *
    00031  * Similar to the standard Java <code>ByteBuffer</code> class.
    00032  */
    00033 class ByteOrderValues {
    00034
    00035 public:
    00036
    00037         static int ENDIAN_BIG;
    00038         static int ENDIAN_LITTLE;
    00039
    00040         static int getInt(const unsigned char *buf, int byteOrder);
    00041         static void putInt(int intValue, unsigned char *buf, int byteOrder);
    00042
    00043         static int64 getLong(const unsigned char *buf, int byteOrder);
    00044         static void putLong(int64 longValue, unsigned char *buf, int byteOrder);
    00045
    00046         static double getDouble(const unsigned char *buf, int byteOrder);
    00047         static void putDouble(double doubleValue, unsigned char *buf, int byteOrder);
    00048
    00049 };
    00050
    00051 } // namespace io
    00052 } // namespace geos
    00053
    00054 #endif // #ifndef GEOS_IO_BYTEORDERVALUES_H
    00055
    00056 /**********************************************************************
    00057  * $Log$
    00058  * Revision 1.1  2006/03/20 18:18:14  strk
    00059  * io.h header split
    00060  *
    00061  **********************************************************************/