# gdcmByteSwap.h

Go to the documentation of this file.

    00001 /*=========================================================================
    00002
    00003   Program: GDCM (Grassroots DICOM). A DICOM library
    00004   Module:  $URL$
    00005
    00006   Copyright (c) 2006-2010 Mathieu Malaterre
    00007   All rights reserved.
    00008   See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
    00009
    00010      This software is distributed WITHOUT ANY WARRANTY; without even
    00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
    00012      PURPOSE.  See the above copyright notice for more information.
    00013
    00014 =========================================================================*/
    00015 #ifndef GDCMBYTESWAP_H
    00016 #define GDCMBYTESWAP_H
    00017
    00018 #include "gdcmTypes.h"
    00019 #include "gdcmSwapCode.h"
    00020
    00021 namespace gdcm
    00022 {
    00023
    00030 template<class T>
    00031 class ByteSwap
    00032 {
    00033 public:
    00035   static bool SystemIsBigEndian ();
    00036   static bool SystemIsLittleEndian ();
    00037
    00038   static void Swap(T &p);
    00039   static void SwapFromSwapCodeIntoSystem(T &p, SwapCode const &sc);
    00040   static void SwapRange(T *p, unsigned int num);
    00041   static void SwapRangeFromSwapCodeIntoSystem(T *p, SwapCode const &sc,
    00042     std::streamoff num);
    00043
    00044 protected:
    00045 //  ByteSwap() {}
    00046 //  ~ByteSwap() {}
    00047
    00048 private:
    00049
    00050 };
    00051
    00057 } // end namespace gdcm
    00058
    00059 #include "gdcmByteSwap.txx"
    00060
    00061 #endif //GDCMBYTESWAP_H