]> Creatis software - gdcm.git/blobdiff - src/gdcmDict.cxx
BUG: The ijg has no notion of big endian, therefore always swap the jpeg stream
[gdcm.git] / src / gdcmDict.cxx
index 37180fd96f4bafb79ffcda85cf88ec82ae863fff..9c3235c78aecf84bf549034b05653de9058ba1d6 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDict.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/07 19:20:38 $
-  Version:   $Revision: 1.59 $
+  Date:      $Date: 2005/01/12 15:23:44 $
+  Version:   $Revision: 1.62 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -44,7 +44,7 @@ Dict::Dict(std::string const &filename)
    std::ifstream from( filename.c_str() );
    if( !from )
    {
-      gdcmVerboseMacro("Dict::Dict: can't open dictionary" << filename.c_str());
+      gdcmVerboseMacro( "Can't open dictionary" << filename.c_str());
       // Using default embeded one:
       FillDefaultDataDict( this );
    }
@@ -65,8 +65,8 @@ Dict::Dict(std::string const &filename)
       }
 
       Filename = filename;
+      from.close();
    }
-   from.close();
 }
 
 /**
@@ -89,16 +89,6 @@ Dict::~Dict()
 void Dict::Print(std::ostream &os)
 {
    os << "Dict file name : " << Filename << std::endl;
-   PrintByKey(os);
-}
-
-/**
- * \brief   Print all the dictionary entries contained in this dictionary.
- *          Entries will be sorted by tag i.e. the couple (group, element).
- * @param   os The output stream to be written to.
- */
-void Dict::PrintByKey(std::ostream &os)
-{
    std::ostringstream s;
 
    for (TagKeyHT::iterator tag = KeyHt.begin(); tag != KeyHt.end(); ++tag)
@@ -114,6 +104,7 @@ void Dict::PrintByKey(std::ostream &os)
    os << s.str();
 }
 
+
 //-----------------------------------------------------------------------------
 // Public
 /**
@@ -128,7 +119,7 @@ bool Dict::AddNewEntry(DictEntry const &newEntry)
 
    if(KeyHt.count(key) == 1)
    {
-      gdcmVerboseMacro("Dict::AddNewEntry already present" << key.c_str());
+      gdcmVerboseMacro( "Already present" << key.c_str());
       return false;
    } 
    else 
@@ -172,7 +163,7 @@ bool Dict::RemoveEntry (TagKey const &key)
    } 
    else 
    {
-      gdcmVerboseMacro("Dict::RemoveEntry unfound entry" << key.c_str());
+      gdcmVerboseMacro( "Unfound entry" << key.c_str());
       return false;
   }
 }
@@ -195,7 +186,7 @@ bool Dict::RemoveEntry (uint16_t group, uint16_t elem)
  * @param   elem element of the entry to be found
  * @return  the corresponding dictionnary entry when existing, NULL otherwise
  */
-DictEntry *Dict::GetDictEntryByNumber(uint16_t group, uint16_t elem)
+DictEntry *Dict::GetDictEntry(uint16_t group, uint16_t elem)
 {
    TagKey key = DictEntry::TranslateToKey(group, elem);
    TagKeyHT::iterator it = KeyHt.find(key);