GDCM 3.2.1

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
20 namespace gdcm
21{
22
26 class GDCM_EXPORT SwapCode
27{
28 public:
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);
42 protected:
43 static int GetIndex(SwapCode const & sc);
44
45 private:
46 SwapCodeType SwapCodeValue;
47};
48//-----------------------------------------------------------------------------
49 inline std::ostream& operator<<(std::ostream& os, const SwapCode& sc)
50{
51 os << SwapCode::GetSwapCodeString(sc);
52 return os;
53}
54
55} // end namespace gdcm
56
57#endif //GDCMSWAPCODE_H
gdcm::SwapCode::GetIndex
static int GetIndex(SwapCode const &sc)
gdcm::SwapCode::operator<<
friend std::ostream & operator<<(std::ostream &os, const SwapCode &sc)
Definition gdcmSwapCode.h:49
gdcm::SwapCode::GetSwapCodeString
static const char * GetSwapCodeString(SwapCode const &sc)
gdcm::SwapCode::SwapCodeType
SwapCodeType
Definition gdcmSwapCode.h:29
gdcm::SwapCode::LittleEndian
@ LittleEndian
Definition gdcmSwapCode.h:31
gdcm::SwapCode::BigEndian
@ BigEndian
Definition gdcmSwapCode.h:32
gdcm::SwapCode::BadLittleEndian
@ BadLittleEndian
Definition gdcmSwapCode.h:33
gdcm::SwapCode::Unknown
@ Unknown
Definition gdcmSwapCode.h:30
gdcm::SwapCode::BadBigEndian
@ BadBigEndian
Definition gdcmSwapCode.h:34
gdcm::SwapCode::SwapCode
SwapCode(SwapCodeType sc=Unknown)
Definition gdcmSwapCode.h:38
gdcmTypes.h
GDCM_EXPORT
#define GDCM_EXPORT
Definition gdcmWin32.h:34
gdcm
Definition gdcmASN1.h:21
gdcm::operator<<
std::ostream & operator<<(std::ostream &os, const Directory &d)
Definition gdcmDirectory.h:88