]> Creatis software - gdcm.git/blobdiff - src/gdcmElementSet.cxx
Coding Style + Doxygenation
[gdcm.git] / src / gdcmElementSet.cxx
index dd2c6d1976c5d0383d5846379ad972c0c3d473a8..ef76254bd4c62f1d6f7d06518aab23f8f1acf821 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmElementSet.cxx,v $
   Language:  C++
-  Date:      $Date: 2004/12/03 17:13:18 $
-  Version:   $Revision: 1.33 $
+  Date:      $Date: 2005/01/06 20:03:27 $
+  Version:   $Revision: 1.36 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -54,11 +54,6 @@ ElementSet::~ElementSet()
    TagHT.clear();
 }
 
-
-//-----------------------------------------------------------------------------
-// Public
-
-
 //-----------------------------------------------------------------------------
 // Print
 /**
@@ -66,13 +61,16 @@ ElementSet::~ElementSet()
   *          from the H Table
   * @return
   */ 
-void ElementSet::Print(std::ostreamos)
+void ElementSet::Print(std::ostream &os)
 {
    for( TagDocEntryHT::const_iterator i = TagHT.begin(); i != TagHT.end(); ++i)
    {
       DocEntry* entry = i->second;
+
+      entry->SetPrintLevel(PrintLevel);
       entry->Print(os);   
-      if ( SeqEntry* seqEntry = dynamic_cast<SeqEntry*>(entry) )
+
+      if ( SeqEntry *seqEntry = dynamic_cast<SeqEntry*>(entry) )
       {
          (void)seqEntry;
          // Avoid the newline for a sequence:
@@ -82,12 +80,14 @@ void ElementSet::Print(std::ostream& os)
    }
 }
 
+//-----------------------------------------------------------------------------
+// Public
 /**
   * \brief   Writes the Header Entries (Dicom Elements)
   *          from the H Table
   * @return
   */ 
-void ElementSet::WriteContent(std::ofstreamfp, FileType filetype)
+void ElementSet::WriteContent(std::ofstream *fp, FileType filetype)
 {
    for (TagDocEntryHT::const_iterator i = TagHT.begin(); 
                                      i != TagHT.end(); 
@@ -96,10 +96,9 @@ void ElementSet::WriteContent(std::ofstream* fp, FileType filetype)
       i->second->WriteContent(fp, filetype);
    } 
 }
-//-----------------------------------------------------------------------------
-// Protected
 
 //-----------------------------------------------------------------------------
+// Protected
 
 //-----------------------------------------------------------------------------
 // Private
@@ -108,9 +107,9 @@ void ElementSet::WriteContent(std::ofstream* fp, FileType filetype)
  * \brief   add a new Dicom Element pointer to the H Table
  * @param   newEntry entry to add
  */
-bool ElementSet::AddEntry(DocEntrynewEntry)
+bool ElementSet::AddEntry(DocEntry *newEntry)
 {
-   const TagKeykey = newEntry->GetKey();
+   const TagKey &key = newEntry->GetKey();
 
    if( TagHT.count(key) == 1 )
    {
@@ -131,9 +130,9 @@ bool ElementSet::AddEntry(DocEntry* newEntry)
  * \warning Some problems when using under Windows... prefer the use of
  *          Initialize / GetNext methods
  */
-bool ElementSet::RemoveEntry( DocEntryentryToRemove)
+bool ElementSet::RemoveEntry( DocEntry *entryToRemove)
 {
-   const TagKeykey = entryToRemove->GetKey();
+   const TagKey &key = entryToRemove->GetKey();
    if( TagHT.count(key) == 1 )
    {
       TagHT.erase(key);
@@ -150,9 +149,9 @@ bool ElementSet::RemoveEntry( DocEntry* entryToRemove)
  * \brief   Clear the hash table from given entry BUT keep the entry.
  * @param   entryToRemove Entry to remove.
  */
-bool ElementSet::RemoveEntryNoDestroy(DocEntryentryToRemove)
+bool ElementSet::RemoveEntryNoDestroy(DocEntry *entryToRemove)
 {
-   const TagKeykey = entryToRemove->GetKey();
+   const TagKey &key = entryToRemove->GetKey();
    if( TagHT.count(key) == 1 )
    {
       TagHT.erase(key);