]> Creatis software - gdcm.git/commitdiff
First try on win32
authoryougz <yougz>
Thu, 7 Nov 2002 17:22:00 +0000 (17:22 +0000)
committeryougz <yougz>
Thu, 7 Nov 2002 17:22:00 +0000 (17:22 +0000)
src/gdcm.h
src/gdcmDictSet.cxx
src/gdcmHeader.cxx
src/gdcmUtil.cxx
src/gdcmUtil.h

index 549dca9534d3740fefae9c490acf73f0514bf1c7..82df4e543333a60a0015cdfbf0a4f48f6c35df53 100644 (file)
 // the declaration once you provided the definition of the method...
 
 #include <string>
+#include <iostream>
 #include <stddef.h>    // For size_t
 #include <glib.h>
 #include <stdio.h>
 
+
 // The requirement for the hash table (or map) that we shall use:
 // 1/ First, next, last (iterators)
 // 2/ should be sortable (i.e. sorted by TagKey). This condition
@@ -28,8 +30,8 @@
 // 3/ Make sure we can setup some default size value, which should be
 //    around 4500 entries which is the average dictionary size (said JPR)
 #include <map>
-
-
+using namespace std;
+#define GDCM_EXPORT __declspec( dllexport )
 // Tag based hash tables.
 // We shall use as keys the strings (as the C++ type) obtained by
 // concatenating the group value and the element value (both of type
@@ -40,7 +42,7 @@
 // gdcmDictEntry::TranslateToKey for this conversion function.
 typedef string TagKey;
 
-class gdcmDictEntry {
+class GDCM_EXPORT gdcmDictEntry {
 private:
        guint16 group;    // e.g. 0x0010
        guint16 element;  // e.g. 0x0010
@@ -70,7 +72,7 @@ private:
 public:
        //CLEANME gdcmDictEntry();
        gdcmDictEntry(guint16 group, guint16 element,
-                     string vr, string fourth, string vr);
+                     string vr, string fourth, string name);
        static TagKey TranslateToKey(guint16 group, guint16 element);
        guint16 GetGroup(void)  { return group;};
        guint16 GetElement(void){return element;};
@@ -87,7 +89,7 @@ typedef map<TagKey, gdcmDictEntry*> TagHT;
 // entries. There should be a single public dictionary (THE dictionary of
 // the actual DICOM v3) but as many shadow dictionaries as imagers 
 // combined with all software versions...
-class gdcmDict {
+class GDCM_EXPORT gdcmDict {
        string name;
        string filename;
        TagHT entries;
@@ -104,7 +106,7 @@ public:
 // * having many in memory representations of the same dictionary.
 typedef string DictKey;
 typedef map<DictKey, gdcmDict*> DictSetHT;
-class gdcmDictSet {
+class GDCM_EXPORT gdcmDictSet {
 private:
        string DictPath;      // Directory path to dictionaries
        DictSetHT dicts;
@@ -128,7 +130,7 @@ public:
 
 // The dicom header of a Dicom file contains a set of such ELement VALUES
 // (when successfuly parsed against a given Dicom dictionary)
-class ElValue {
+class GDCM_EXPORT ElValue {
 private:
        gdcmDictEntry *entry;
        guint32 LgrElem;
@@ -155,7 +157,7 @@ public:
 typedef map<TagKey, ElValue*> TagElValueHT;
 typedef map<string, ElValue*> TagElValueNameHT;
 // Container for a set of succefully parsed ElValues.
-class ElValSet {
+class GDCM_EXPORT ElValSet {
        // We need both accesses with a TagKey and the Dicentry.Name
        TagElValueHT tagHt;
        TagElValueNameHT NameHt;
@@ -183,7 +185,7 @@ typedef map<TagKey, VRAtr> VRHT;    // Value Representation Hash Table
 // Notes:
 // * the gdcmHeader::Set*Tag* family members cannot be defined as protected
 //   (Swig limitations for as Has_a dependency between gdcmFile and gdcmHeader)
-class gdcmHeader {     
+class GDCM_EXPORT gdcmHeader { 
 //FIXME sw should be qn EndianType !!!
        //enum EndianType {
                //LittleEndian, 
@@ -263,7 +265,7 @@ public:
        // TODO Swig string GetPubElValRepByName(string TagName);
        // TODO Swig string GetPubElValRepByNumber(guint16 group, guint16 element);
        TagElValueHT & GetPubElVal(void) { return PubElVals.GetTagHt(); };
-       void   PrintPubElVal(ostream & os = std::cout);
+       void   PrintPubElVal(ostream & os = cout);
        void   PrintPubDict(ostream &);
          
        // Same thing with the shadow :
@@ -294,7 +296,7 @@ public:
 ////// QUESTION: this looks still like an open question wether the
 //////           relationship between a gdcmFile and gdcmHeader is of
 //////           type IS_A or HAS_A !
-class gdcmFile: gdcmHeader
+class GDCM_EXPORT gdcmFile: gdcmHeader
 {
 private:
        void* Data;
index c8f594b33cc60904162cf393baee1cbe9ff194a3..814ca802e223811cb31c608db41defeedf6d7bda 100644 (file)
@@ -30,7 +30,8 @@ int gdcmDictSet::LoadDicomV3Dict(void) {
 
 int gdcmDictSet::LoadDictFromFile(string FileName, DictKey Name) {
        gdcmDict *NewDict = new gdcmDict(FileName.c_str());
-       dicts[Name] = NewDict; 
+       dicts[Name] = NewDict;
+       return 0;
 }
 
 void gdcmDictSet::Print(ostream& os) {
index 4cdeeebdf0bee588474e2bf359b2ab581e25f86d..856e6f4504812369a343cc3e094e4969057ca2a1 100644 (file)
@@ -623,7 +623,7 @@ void gdcmHeader::LoadElements(void) {
                LoadElementValue(tag->second);
 }
 
-void gdcmHeader::PrintPubElVal(ostream & os = std::cout) {
+void gdcmHeader::PrintPubElVal(ostream & os) {
        PubElVals.Print(os);
 }
 
index 1665398913abcb9b34cb8013c08769512fc64bd3..c6a7576e6485b7d8e92841610b75daba9df99877 100644 (file)
@@ -1,35 +1,35 @@
 #include <ctype.h>
 #include "gdcmUtil.h"
 
-gdcmDebug::gdcmDebug(int level = 0) {
+gdcmDebug::gdcmDebug(int level) {
        DebugLevel = level;
 }
 
-void gdcmDebug::Verbose(int Level, const char * Msg1, const char * Msg2 = "") {
+void gdcmDebug::Verbose(int Level, const char * Msg1, const char * Msg2) {
        if (Level > DebugLevel)
                return ;
        cerr << Msg1 << ' ' << Msg2 << '\n';
 }
 
 void gdcmDebug::Assert(int Level, bool Test,
-                 const char * Msg1, const char * Msg2 = "") {
+                 const char * Msg1, const char * Msg2) {
        if (Level > DebugLevel)
                return ;
        if (!Test)
                cerr << Msg1 << ' ' << Msg2 << '\n';
 }
 
-void gdcmDebug::Error( bool Test, const char * Msg1, const char * Msg2 = "") {
+void gdcmDebug::Error( bool Test, const char * Msg1, const char * Msg2) {
        if (!Test)
                return;
        std::cerr << Msg1 << ' ' << Msg2 << '\n';
-       std::exit(1);
+       exit(1);
 }
 
-void gdcmDebug::Error(const char* Msg1, const char* Msg2 ="",
-                      const char* Msg3 ="") {
+void gdcmDebug::Error(const char* Msg1, const char* Msg2,
+                      const char* Msg3) {
        std::cerr << Msg1 << ' ' << Msg2 << ' ' << Msg3 << '\n';
-       std::exit(1);
+       exit(1);
 }
 
 gdcmDebug dbg;
index d06e8cdeac839da0f96be9e4f3a1f677cbb016c1..63025122aaedc860df3181073a49fb2a6bedd409 100644 (file)
@@ -1,15 +1,17 @@
 #include <iostream>
+using namespace std;
+
 class gdcmDebug {
 private:
        int DebugLevel;
 public:
-       gdcmDebug(int);
+       gdcmDebug(int  = 0);
        void Verbose(int, const char*, const char* ="");
        void Error(bool, const char*,  const char* ="");
        void Error(const char*, const char* ="", const char* ="");
        void Assert(int, bool, const char*, const char*);
 };
 
-istream& eatwhite(istream& is);
+istream & eatwhite(istream & is);
 
 extern gdcmDebug dbg;