+//-----------------------------------------------------------------------------
+// Print
+/**
+ * \brief Prints a BinEntry (Dicom entry)
+ * @param os ostream we want to print in
+ * @param indent Indentation string to be prepended during printing
+ */
+void BinEntry::Print(std::ostream &os, std::string const & )
+{
+ os << "B ";
+ DocEntry::Print(os);
+ std::ostringstream s;
+ void* binArea = GetBinArea();
+ if (binArea)
+ {
+ if ( GetVR() == "FL" )
+ {
+ int l = GetReadLength()/4 - 1;
+ float *beg = (float *)GetBinArea();
+ s << " [" << *beg;
+ if ( l!= 0)
+ for (int i=0;i<l;i++)
+ {
+ beg++;
+ s << "\\" << *beg;
+ }
+ s << "]";
+ }
+ else if ( GetVR() == "FD" )
+ {
+ int l = GetReadLength()/8 - 1;
+ double *beg = (double *)GetBinArea();
+ s << " [" << *beg;
+ if ( l!= 0)
+ for (int i=0;i<l;i++)
+ {
+ beg++;
+ s << "\\" << *beg;
+ }
+ s << "]";
+ }
+ else
+ {
+ if ( Util::IsCleanArea( GetBinArea(),GetLength() ) )
+ {
+ std::string cleanString =
+ Util::CreateCleanString( GetBinArea(),GetLength() );
+ s << " [" << cleanString << "]";
+ }
+ else
+ {
+ //s << " [" << GetValue()
+ s << " [" << GDCM_BINLOADED << ";"
+ << "length = " << GetLength() << "]";
+ }
+ }
+ }
+ else
+ {
+ if ( GetLength() == 0 )
+ {
+ s << " []";
+ }
+ else
+ {
+ s << " [" <<GetValue() << "]";
+ }
+ }
+ os << s.str();
+}
+