]> Creatis software - gdcm.git/blobdiff - src/gdcmDataEntry.cxx
Try to track the "FIXME" problem for VM
[gdcm.git] / src / gdcmDataEntry.cxx
index 37a9ca52d9f3f907dd69f088c6f301911900d879..67e3e276c2d0dbe0387a6f50260590c438fc49da 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDataEntry.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/11/03 08:41:59 $
-  Version:   $Revision: 1.17 $
+  Date:      $Date: 2005/11/08 09:54:42 $
+  Version:   $Revision: 1.20 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -365,21 +365,9 @@ void DataEntry::SetString(std::string const &value)
    {
       if( value.size() > 0 )
       {
-         // FIXME : should be quicker if we don't create one more std::string
-         //         just to make even the length of a char array ...
-
-         /*
-         std::string finalVal = Util::DicomString( value.c_str() );
-         SetLength(finalVal.size());
-         NewBinArea();
-
-         memcpy(BinArea, &(finalVal[0]), finalVal.size());
-         */
-
          size_t l =  value.size();    
          SetLength(l + l%2);
          NewBinArea();
-         //memcpy(BinArea, &(value[0]), l);
          memcpy(BinArea, value.c_str(), l);
          if (l%2)
             BinArea[l] = '\0';
@@ -531,6 +519,7 @@ void DataEntry::WriteContent(std::ofstream *fp, FileType filetype)
          }     
          case 2:
          {
+gdcmDebugMacro ("AtomicLength = 2 found; lgt =" << l); 
             uint16_t *data16 = (uint16_t *)data;
             for(i=0;i<l/vrLgth;i++)
                binary_write( *fp, data16[i]);
@@ -572,6 +561,15 @@ void DataEntry::WriteContent(std::ofstream *fp, FileType filetype)
       fp->seekp(1, std::ios::cur);  
 }
 
+/**
+ * \brief   Compute the full length of the elementary DataEntry (not only value
+ *          length) depending on the VR.
+ */
+uint32_t DataEntry::ComputeFullLength()
+{
+   return GetFullLength();
+}
+
 //-----------------------------------------------------------------------------
 // Protected
 void DataEntry::NewBinArea(void)