]> Creatis software - gdcm.git/commitdiff
STYLE: ivars should start with a capital letter. Accessors should be const to avoid...
authormalaterre <malaterre>
Mon, 25 Oct 2004 03:03:44 +0000 (03:03 +0000)
committermalaterre <malaterre>
Mon, 25 Oct 2004 03:03:44 +0000 (03:03 +0000)
src/gdcmDocument.cxx
src/gdcmSeqEntry.cxx
src/gdcmSeqEntry.h
src/gdcmValEntry.h

index 25fac9debfc836e27845097f265d1d54794410b3..0147cc476348340859aeb46dd81ed974046ba833 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDocument.cxx,v $
   Language:  C++
-  Date:      $Date: 2004/10/24 03:33:40 $
-  Version:   $Revision: 1.111 $
+  Date:      $Date: 2004/10/25 03:03:44 $
+  Version:   $Revision: 1.112 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -2940,7 +2940,7 @@ void Document::BuildFlatHashTableRecurse( TagDocEntryHT& builtHT,
          DocEntry* entry = i->second;
          if ( SeqEntry* seqEntry = dynamic_cast<SeqEntry*>(entry) )
          {
-            ListSQItem& items = seqEntry->GetSQItems();
+            const ListSQItem& items = seqEntry->GetSQItems();
             for( ListSQItem::const_iterator item  = items.begin();
                                             item != items.end();
                                           ++item)
@@ -2964,7 +2964,7 @@ void Document::BuildFlatHashTableRecurse( TagDocEntryHT& builtHT,
          DocEntry* entry = *i;
          if ( SeqEntry* seqEntry = dynamic_cast<SeqEntry*>(entry) )
          {
-            ListSQItem& items = seqEntry->GetSQItems();
+            const ListSQItem& items = seqEntry->GetSQItems();
             for( ListSQItem::const_iterator item  = items.begin();
                                             item != items.end();
                                           ++item)
index bb5135594c4b8713fe6ba08cc7d086bfaadb274f..88e79a62d7d0b24fe71914870daee30b8b33bdc4 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmSeqEntry.cxx,v $
   Language:  C++
-  Date:      $Date: 2004/10/22 03:05:42 $
-  Version:   $Revision: 1.32 $
+  Date:      $Date: 2004/10/25 03:03:45 $
+  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
@@ -42,8 +42,8 @@ SeqEntry::SeqEntry( DictEntry* e )
    ReadLength = 0xffffffff;
    SQDepthLevel = -1;
 
-   delimitor_mode = false;
-   seq_term  = NULL;
+   DelimitorMode = false;
+   SeqTerm  = NULL;
 }
 
 /**
@@ -65,13 +65,16 @@ SeqEntry::SeqEntry( DocEntry* e, int depth )
 /**
  * \brief   Canonical destructor.
  */
-SeqEntry::~SeqEntry() {
-   for(ListSQItem::iterator cc = items.begin();cc != items.end();++cc)
+SeqEntry::~SeqEntry()
+{
+   for(ListSQItem::iterator cc = Items.begin(); cc != Items.end(); ++cc)
    {
       delete *cc;
    }
-   if (!seq_term)
-      delete seq_term;
+   if (!SeqTerm)
+   {
+      delete SeqTerm;
+   }
 }
 
 /**
@@ -88,20 +91,21 @@ void SeqEntry::Print( std::ostream &os )
       return;
 
    // Then, Print each SQ Item   
-   for(ListSQItem::iterator cc = items.begin();cc != items.end();++cc)
+   for(ListSQItem::iterator cc = Items.begin(); cc != Items.end(); ++cc)
    {
       (*cc)->Print(os);   
    }
 
    // at end, print the sequence terminator item, if any
-   if (delimitor_mode) {
+   if (DelimitorMode)
+   {
       for ( int i = 0; i < SQDepthLevel; i++ )
       {
          os << "   | " ;
       }
-      if (seq_term != NULL)
+      if (SeqTerm != NULL)
       {
-         seq_term->Print(os);
+         SeqTerm->Print(os);
          os << std::endl;
       } 
       else 
@@ -125,8 +129,8 @@ void SeqEntry::Write(std::ofstream* fp, FileType filetype)
    //uint16_t item_term_el = 0xe00d;
    
    DocEntry::Write(fp, filetype);
-   for(ListSQItem::iterator cc  = GetSQItems().begin();
-                            cc != GetSQItems().end();
+   for(ListSQItem::iterator cc  = Items.begin();
+                            cc != Items.end();
                           ++cc)
    {        
       (*cc)->Write(fp, filetype);
@@ -146,7 +150,7 @@ void SeqEntry::Write(std::ofstream* fp, FileType filetype)
 void SeqEntry::AddEntry(SQItem *sqItem, int itemNumber)
 {
    sqItem->SetSQItemNumber(itemNumber);
-   items.push_back(sqItem);
+   Items.push_back(sqItem);
 }
 
 /**
@@ -158,15 +162,20 @@ void SeqEntry::AddEntry(SQItem *sqItem, int itemNumber)
 SQItem* SeqEntry::GetSQItemByOrdinalNumber(int nb)
 {
    if (nb<0)
-      return (*(items.begin()));
+   {
+      return *(Items.begin());
+   }
    int count = 0 ;
-   for(ListSQItem::iterator cc = items.begin();
-       cc != items.end();
-       count ++, ++cc){
-      if (count==nb)
+   for(ListSQItem::iterator cc = Items.begin();
+                           cc != Items.end();
+                           count ++, ++cc)
+   {
+      if (count == nb)
+      {
          return *cc;
+      }
    }
-   return (*(items.end())); // Euhhhhh ?!? Is this the last one . FIXME
+   return *(Items.end()); // Euhhhhh ?!? Is this the last one . FIXME
 }
 //-----------------------------------------------------------------------------
 // Protected
index fd016fe0509b284cc039c695545613deb5ef653f..e23657f9dc15afeccfff2a9f6c1a3d1f2b6caa38 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmSeqEntry.h,v $
   Language:  C++
-  Date:      $Date: 2004/10/22 03:05:42 $
-  Version:   $Revision: 1.21 $
+  Date:      $Date: 2004/10/25 03:03:45 $
+  Version:   $Revision: 1.22 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -34,41 +34,42 @@ class GDCM_EXPORT SeqEntry : public DocEntry
 public:
    SeqEntry( DictEntry* );
    SeqEntry(DocEntry* d,  int depth);
-   virtual ~SeqEntry();
+   ~SeqEntry();
    
    virtual void Print(std::ostream &os = std::cout); 
    virtual void Write(std::ofstream *fp, FileType);
 
    /// returns the SQITEM chained List for this SeQuence.
-   ListSQItem &GetSQItems() { return items; }
+   ListSQItem const & GetSQItems() const { return Items; }
       
    /// Sets the delimitor mode
-   void SetDelimitorMode(bool dm) { delimitor_mode = dm;}
+   void SetDelimitorMode(bool dm) { DelimitorMode = dm;}
 
    /// Sets the Sequence Delimitation Item
-   void SetSequenceDelimitationItem(DocEntry * e) { seq_term = e;}
+   void SetSequenceDelimitationItem(DocEntry * e) { SeqTerm = e;}
 
    void AddEntry(SQItem *it, int itemNumber);
    SQItem *GetSQItemByOrdinalNumber(int itemNumber);
 
    /// Gets the depth level
-   int GetDepthLevel() { return SQDepthLevel; }
-                                                                                
+   int GetDepthLevel() const { return SQDepthLevel; }
+
    /// Sets the depth level of a Sequence Entry embedded in a SeQuence
    void SetDepthLevel(int depth) { SQDepthLevel = depth; }
+
 protected:
 
 private:
 // Variables
 
    /// If this Sequence is in delimitor mode (length =0xffffffff) or not
-   bool delimitor_mode;
+   bool DelimitorMode;
    
    /// Chained list of SQ Items
-   ListSQItem items;
+   ListSQItem Items;
    
    /// sequence terminator item 
-   DocEntry *seq_term;
+   DocEntry *SeqTerm;
 
    /// \brief Defines the depth level of this \ref SeqEntry inside
    ///        the (optionaly) nested sequences. \ref SQDepthLevel
index 653abadf6e43661df830d6d8f2d7a73120cc273f..a249dbd2c4ebc20a1480ce4206ce8653f61e554b 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmValEntry.h,v $
   Language:  C++
-  Date:      $Date: 2004/10/22 03:05:42 $
-  Version:   $Revision: 1.27 $
+  Date:      $Date: 2004/10/25 03:03:45 $
+  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
@@ -21,9 +21,9 @@
 
 #include "gdcmDocEntry.h"
 #include <iostream>
+
 namespace gdcm 
 {
-
 //-----------------------------------------------------------------------------
 /**
  * \ingroup ValEntry
@@ -40,7 +40,7 @@ public:
    /// \brief Returns the 'Value' (e.g. "Dupond Marcel") converted into a
    /// 'string', if it's stored as an integer in the header of the
    /// current Dicom Document Entry
-   std::string & GetValue() { return Value; };
+   std::string const & GetValue() const { return Value; };
     
    /// Sets the value (string) of the current Dicom Document Entry
    void SetValue(std::string const & val) { Value = val; };
@@ -56,7 +56,7 @@ private:
    /// \brief Document Entry value, internaly represented as a std::string
    ///        The Value Representation (\ref VR) is independently used
    ///        in order to interpret (decode) this field.
-   std::string  Value;
+   std::string Value;
 };
 } // end namespace gdcm