]> Creatis software - gdcm.git/blobdiff - src/gdcmGlobal.cxx
* Test for a bug fix
[gdcm.git] / src / gdcmGlobal.cxx
index b2864d5d081b94fb66d841f608db800190e5ab63..bf364f995e537d9f9ad57cb308a9907d1e757c70 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmGlobal.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/10/18 12:58:28 $
-  Version:   $Revision: 1.27 $
+  Date:      $Date: 2006/07/06 15:08:10 $
+  Version:   $Revision: 1.33 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -43,7 +43,13 @@ const std::string GDCM_UNREAD    = "gdcm::UnRead";
 const std::string GDCM_NOTASCII  = "gdcm::NotAscii";
 const std::string GDCM_PIXELDATA = "gdcm::Pixel Data to be loaded";
 
-const std::string GDCM_VRUNKNOWN = "  ";
+const char GDCM_VRUNKNOWN[2] = {' ',' '}; // avoid useless std::string stuff
+
+#ifdef _WIN32
+const char GDCM_FILESEPARATOR = '\\';
+#else
+const char GDCM_FILESEPARATOR = '/';
+#endif
 
 //-----------------------------------------------------------------------------
 DictSet         *Global::Dicts     = (DictSet *)0;
@@ -52,6 +58,8 @@ TS              *Global::TranSyn   = (TS *)0;
 DictGroupName   *Global::GroupName = (DictGroupName *)0;
 DicomDirElement *Global::ddElem    = (DicomDirElement *)0;
 
+Dict            *Global::DefaultPubDict = (Dict *)0;
+
 //-----------------------------------------------------------------------------
 /**
  * \brief   Global container
@@ -65,16 +73,16 @@ Global Glob;
  */
 Global::Global()
 {
-   if (ValRes || TranSyn || Dicts || ddElem)
+   if (ValRes || TranSyn || Dicts || ddElem || GroupName )
    {
-      gdcmWarningMacro( "VR or TS or Dicts already allocated");
+      gdcmStaticWarningMacro( "VR or TS or Dicts or ... already allocated");
       return;
    }
-   Dicts     = new DictSet();
-   ValRes    = new VR();
-   TranSyn   = new TS();
-   GroupName = new DictGroupName();
-   ddElem    = new DicomDirElement();
+   Dicts     = DictSet::New();
+   ValRes    = VR::New();
+   TranSyn   = TS::New();
+   GroupName = DictGroupName::New();
+   ddElem    = DicomDirElement::New();
 }
 
 /**
@@ -82,54 +90,15 @@ Global::Global()
  */
 Global::~Global()
 {
-   delete Dicts;
-   delete ValRes;
-   delete TranSyn;
-   delete GroupName;
-   delete ddElem;
+   Dicts->Delete();
+   ValRes->Delete();
+   TranSyn->Delete();
+   GroupName->Delete();
+   ddElem->Delete();
 }
 
 //-----------------------------------------------------------------------------
 // Public
-/**
- * \brief   returns a pointer to Dictionaries Table 
- */
-DictSet *Global::GetDicts()
-{
-   return Dicts;
-}
-
-/**
- * \brief   returns a pointer to the 'Value Representation Table' 
- */
-VR *Global::GetVR()
-{
-   return ValRes;
-}
-
-/**
- * \brief   returns a pointer to the 'Transfer Syntax Table' 
- */
-TS *Global::GetTS()
-{
-   return TranSyn;
-}
-
-/**
- * \brief   returns a pointer to the Group name correspondance table
- */
-DictGroupName *Global::GetDictGroupName()
-{
-   return GroupName;
-}
-
-/**
- * \brief   returns a pointer to the DicomDir related elements Table 
- */
-DicomDirElement *Global::GetDicomDirElements()
-{
-   return ddElem;
-}
 
 //-----------------------------------------------------------------------------
 // Protected