]> Creatis software - gdcm.git/blobdiff - src/gdcmDocEntrySet.cxx
* src/gdcmCommon.h : add the GDCM_UNKNOWN constant. This constant is to
[gdcm.git] / src / gdcmDocEntrySet.cxx
index 9e722cf0dce4c640cf7e1b73c6003cee577221c0..0d69d0253fd8a7932748e05ffb005a3e3cc56ad4 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDocEntrySet.cxx,v $
   Language:  C++
-  Date:      $Date: 2004/10/12 04:35:45 $
-  Version:   $Revision: 1.24 $
+  Date:      $Date: 2005/01/05 15:38:28 $
+  Version:   $Revision: 1.28 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -19,6 +19,7 @@
 
 #include "gdcmDebug.h"
 #include "gdcmCommon.h"
+#include "gdcmDictSet.h"
 #include "gdcmGlobal.h"
 #include "gdcmException.h"
 #include "gdcmDocEntry.h"
@@ -118,11 +119,12 @@ SeqEntry* DocEntrySet::NewSeqEntryByNumber(uint16_t Group,
 // Protected
 
 /**
- * \brief   Gets a Dicom Element inside a SQ Item Entry, by name
+ * \brief  Gets a Dicom Element inside a SQ Item Entry, by name
+ * @param  name of the element to be found.
  * @return
  */
- DocEntry *DocEntrySet::GetDocEntryByName(std::string const & name)
- {
+DocEntry* DocEntrySet::GetDocEntryByName( TagName const & name )
+{
    Dict *pubDict = Global::GetDicts()->GetDefaultPubDict();
    DictEntry *dictEntry = pubDict->GetDictEntryByName(name);
    if( !dictEntry )
@@ -162,11 +164,11 @@ std::string DocEntrySet::GetEntryByName(TagName const & name)
  * @param   fourth owner group
  * @param   name   english name
  */
-DictEntry* DocEntrySet::NewVirtualDictEntry(uint16_t group,
-                                                    uint16_t element,
-                                                    std::string const & vr,
-                                                    std::string const & fourth,
-                                                    std::string const & name)
+DictEntry* DocEntrySet::NewVirtualDictEntry( uint16_t group,
+                                             uint16_t element,
+                                             TagName const & vr,
+                                             TagName const & fourth,
+                                             TagName const & name )
 {
    return Global::GetDicts()->NewVirtualDictEntry(group,element,vr,fourth,name);
 }
@@ -177,7 +179,7 @@ DictEntry* DocEntrySet::NewVirtualDictEntry(uint16_t group,
  * @param   elem  elem number of the underlying DictEntry 
  */
 DocEntry* DocEntrySet::NewDocEntryByNumber(uint16_t group,
-                                                   uint16_t elem)
+                                           uint16_t elem)
 {
    // Find out if the tag we encountered is in the dictionaries:
    Dict *pubDict = Global::GetDicts()->GetDefaultPubDict();
@@ -202,19 +204,17 @@ DocEntry* DocEntrySet::NewDocEntryByNumber(uint16_t group,
  * Creates a new DocEntry (without any 'value' ...)
  * @param   group     group  number of the underlying DictEntry
  * @param   elem  elem number of the underlying DictEntry 
- * @param   VR   V(alue) R(epresentation) of the Entry -if private Entry- 
-
+ * @param   vr    V(alue) R(epresentation) of the Entry -if private Entry- 
  */
-DocEntry* DocEntrySet::NewDocEntryByNumber(uint16_t group,
-                                                   uint16_t elem,
-                                                   std::string const &VR)
+DocEntry* DocEntrySet::NewDocEntryByNumber(uint16_t group, uint16_t elem,
+                                           TagName const & vr)
 {
    // Find out if the tag we encountered is in the dictionaries:
    Dict *pubDict = Global::GetDicts()->GetDefaultPubDict();
    DictEntry *dictEntry = pubDict->GetDictEntryByNumber(group, elem);
    if (!dictEntry)
    {
-      dictEntry = NewVirtualDictEntry(group, elem, VR);
+      dictEntry = NewVirtualDictEntry(group, elem, vr);
    }
 
    DocEntry *newEntry = new DocEntry(dictEntry);
@@ -228,15 +228,15 @@ DocEntry* DocEntrySet::NewDocEntryByNumber(uint16_t group,
 }
 /* \brief
  * Probabely move, as is, to DocEntrySet, as a non virtual method
- * an remove Document::NewDocEntryByName
+ * and remove Document::NewDocEntryByName
  */
-DocEntry *DocEntrySet::NewDocEntryByName  (std::string const & name)
+DocEntry *DocEntrySet::NewDocEntryByName(TagName const & name)
 {
   Dict *pubDict = Global::GetDicts()->GetDefaultPubDict();
   DictEntry *newTag = pubDict->GetDictEntryByName(name);
    if (!newTag)
    {
-      newTag = NewVirtualDictEntry(0xffff, 0xffff, "LO", "unkn", name);
+      newTag = NewVirtualDictEntry(0xffff, 0xffff, "LO", GDCM_UNKNOWN, name);
    }
 
    DocEntry* newEntry = new DocEntry(newTag);
@@ -258,7 +258,7 @@ DocEntry *DocEntrySet::NewDocEntryByName  (std::string const & name)
  * @param   name Name of the searched DictEntry
  * @return  Corresponding DictEntry when it exists, NULL otherwise.
  */
-DictEntry *DocEntrySet::GetDictEntryByName(std::string const & name) 
+DictEntry *DocEntrySet::GetDictEntryByName(TagName const & name) 
 {
    DictEntry *found = 0;
    Dict *pubDict = Global::GetDicts()->GetDefaultPubDict();
@@ -283,8 +283,8 @@ DictEntry *DocEntrySet::GetDictEntryByName(std::string const & name)
  * @param   element element number of the searched DictEntry
  * @return  Corresponding DictEntry when it exists, NULL otherwise.
  */
-DictEntry *DocEntrySet::GetDictEntryByNumber(uint16_t group,
-                                                     uint16_t element) 
+DictEntry *DocEntrySet::GetDictEntryByNumber(uint16_t group, 
+                                             uint16_t element) 
 {
    DictEntry *found = 0;
    Dict *pubDict = Global::GetDicts()->GetDefaultPubDict();