]> Creatis software - gdcm.git/blob - src/gdcmCommon.h
* Erroneous leading white fix:
[gdcm.git] / src / gdcmCommon.h
1 /*=========================================================================
2                                                                                 
3   Program:   gdcm
4   Module:    $RCSfile: gdcmCommon.h,v $
5   Language:  C++
6   Date:      $Date: 2004/06/20 18:08:47 $
7   Version:   $Revision: 1.27 $
8                                                                                 
9   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
10   l'Image). All rights reserved. See Doc/License.txt or
11   http://www.creatis.insa-lyon.fr/Public/Gdcm/License.htm for details.
12                                                                                 
13      This software is distributed WITHOUT ANY WARRANTY; without even
14      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15      PURPOSE.  See the above copyright notices for more information.
16                                                                                 
17 =========================================================================*/
18
19 #ifndef GDCMCOMMON_H
20 #define GDCMCOMMON_H
21
22 #include "gdcmConfigure.h"
23
24 //-----------------------------------------------------------------------------
25 //This is needed when compiling in debug mode
26 #ifdef _MSC_VER
27 // 'identifier' : class 'type' needs to have dll-interface to be used by
28 // clients of class 'type2'
29 #pragma warning ( disable : 4251 )
30 // 'identifier' : identifier was truncated to 'number' characters in the
31 // debug information
32 #pragma warning ( disable : 4786 )
33 //'identifier' : decorated name length exceeded, name was truncated
34 #pragma warning ( disable : 4503 )
35 // C++ exception specification ignored except to indicate a 
36 // function is not __declspec(nothrow)
37 #pragma warning ( disable : 4290 )
38 // signed/unsigned mismatch
39 #pragma warning ( disable : 4018 )
40 // return type for 'identifier' is '' (ie; not a UDT or reference to UDT. Will
41 // produce errors if applied using infix notation
42 #pragma warning ( disable : 4284 )
43 // 'type' : forcing value to bool 'true' or 'false' (performance warning)
44 // //#pragma warning ( disable : 4800 )
45 #endif //_MSC_VER
46
47 //-----------------------------------------------------------------------------
48 #ifdef __GNUC__
49 #ifndef HAVE_NO_STDINT_H
50 #include <stdint.h>
51 #define guint16 uint16_t
52 #define guint32 uint32_t
53 #define gint16  int16_t
54 #define gint32  int32_t
55 #else
56 typedef  unsigned short guint16;
57 typedef  unsigned int   guint32;
58 typedef  short          gint16;
59 typedef  int            gint32;
60 #define UINT32_MAX    (4294967295U)
61 #endif //HAVE_NO_STDINT_H
62 #endif
63
64 #ifdef _MSC_VER 
65 typedef  unsigned short guint16;
66 typedef  unsigned int   guint32;
67 typedef  short          gint16;
68 typedef  int            gint32;
69 #define UINT32_MAX    (4294967295U)
70 #endif
71
72 #ifdef _MSC_VER
73 #define GDCM_EXPORT __declspec( dllexport )
74 #define getcwd _getcwd
75 #else
76 #define GDCM_EXPORT
77 #endif
78
79 // ifdef for old gcc / broken compiler
80 #ifdef GDCM_NO_ANSI_STRING_STREAM
81 #  include <strstream>
82 #  define  ostringstream ostrstream
83 # else
84 #  include <sstream>
85 #endif
86
87
88 // Centralize information about the gdcm dictionary in only one file:
89 #ifndef PUB_DICT_PATH
90 #  define PUB_DICT_PATH   "../Dicts/"
91 #endif
92 #define PUB_DICT_NAME     "DicomV3Dict"
93 #define PUB_DICT_FILENAME "dicomV3.dic"
94 #define DICT_ELEM         "DicomDir.dic"
95 #define DICT_TS           "dicomTS.dic"
96 #define DICT_VR           "dicomVR.dic"
97
98 #include <string>
99
100 const std::string GDCM_UNFOUND = "gdcm::Unfound";   /// MEMORY LEAK
101
102 typedef std::string TagKey;
103 typedef std::string TagName;
104
105 enum FileType {
106       gdcmUnknown = 0,
107       gdcmExplicitVR, // gdcmDicomDir is in this case
108       gdcmImplicitVR,
109       gdcmACR,
110       gdcmACR_LIBIDO
111 };
112
113 //-----------------------------------------------------------------------------
114 #endif