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
{
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';
}
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]);
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)