byteOrder.h File Reference

Header file declaring some useful routines related to endian-ness. More...

#include <algorithm>
#include <sstream>
#include <dlrCommon/exception.h>
#include <dlrCommon/types.h>

Include dependency graph for byteOrder.h:

Go to the source code of this file.


Namespaces

namespace  dlr
 This namespace comprises all of the symbols defined in the dlr_libs suite of libraries.
namespace  dlr::common
 This namespace contains classes, functions and typedefs for working with exceptions, reference counting, portable numeric types, checking and switching byte order, extending the standard library, and more.

Enumerations

enum  dlr::common::ByteOrder { DLR_BIG_ENDIAN, DLR_LITTLE_ENDIAN }
 This enum provides a convenient way to represent the various machine-dependent byte orderings. More...

Functions

ByteOrder dlr::common::getByteOrder ()
 This function returns the appropriate byte order for the platform on which it is run.
template<class Type >
void dlr::common::switchByteOrder (Type *dataPtr, size_t numberOfElements, ByteOrder fromByteOrder, ByteOrder toByteOrder)
 This function takes a pointer to a C-style array of values and modifies the array in place so that it has a particular byte order.
template<class Type >
void dlr::common::switchByteOrder (const Type *fromDataPtr, size_t numberOfElements, Type *toDataPtr, ByteOrder fromByteOrder, ByteOrder toByteOrder)
 This function takes a pointer to a C-style array of values and copies it into another C-style array, swapping bytes if necessary so that the output array has the specified byte order.


Detailed Description

Header file declaring some useful routines related to endian-ness.

(C) Copyright 2006-2007 David LaRose, dlr@alumni.carnegiemellon.edu See accompanying LICENSE file for details.

Revision
975
Date
2007-12-30 01:57:17 -0500 (Sun, 30 Dec 2007)

Definition in file byteOrder.h.


Generated on Tue Nov 24 23:57:55 2009 for dlrCommon Utility Library by  doxygen 1.5.8