GDCM 3.0.24
gdcmSwapCode.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: GDCM (Grassroots DICOM). A DICOM library
4
5 Copyright (c) 2006-2011 Mathieu Malaterre
6 All rights reserved.
7 See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
8
9 This software is distributed WITHOUT ANY WARRANTY; without even
10 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11 PURPOSE. See the above copyright notice for more information.
12
13=========================================================================*/
14#ifndef GDCMSWAPCODE_H
15#define GDCMSWAPCODE_H
16
17#include "gdcmTypes.h"
18#include <iostream>
19
20namespace gdcm
21{
22
27{
28public:
29 typedef enum {
30 Unknown = 0,
31 LittleEndian = 1234,
32 BigEndian = 4321,
33 BadLittleEndian = 3412,
34 BadBigEndian = 2143
35 } SwapCodeType;
36
37 operator SwapCode::SwapCodeType() const { return SwapCodeValue; }
38 SwapCode(SwapCodeType sc = Unknown):SwapCodeValue(sc) { }
39 static const char* GetSwapCodeString(SwapCode const & sc);
40
41 friend std::ostream& operator<<(std::ostream& os, const SwapCode& sc);
42protected:
43 static int GetIndex(SwapCode const & sc);
44
45private:
46 SwapCodeType SwapCodeValue;
47};
48//-----------------------------------------------------------------------------
49inline std::ostream& operator<<(std::ostream& os, const SwapCode& sc)
50{
52 return os;
53}
54
55} // end namespace gdcm
56
57#endif //GDCMSWAPCODE_H
SwapCode representation.
Definition gdcmSwapCode.h:27
static int GetIndex(SwapCode const &sc)
static const char * GetSwapCodeString(SwapCode const &sc)
SwapCodeType
Definition gdcmSwapCode.h:29
SwapCode(SwapCodeType sc=Unknown)
Definition gdcmSwapCode.h:38
#define GDCM_EXPORT
Definition gdcmWin32.h:34
Definition gdcmASN1.h:21
std::ostream & operator<<(std::ostream &os, const Directory &d)
Definition gdcmDirectory.h:88