]> Creatis software - gdcm.git/commitdiff
Add IsParsable() method, to avoid confusion with IsReadable()
authorjpr <jpr>
Tue, 15 Nov 2005 10:30:46 +0000 (10:30 +0000)
committerjpr <jpr>
Tue, 15 Nov 2005 10:30:46 +0000 (10:30 +0000)
src/gdcmDocument.cxx
src/gdcmDocument.h

index 08c874a7a0a4fd4f7c51832d03ad787aedf71e1d..eecf1488eec98e24886dd1318128bcdd573f462b 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDocument.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/11/14 14:23:44 $
-  Version:   $Revision: 1.327 $
+  Date:      $Date: 2005/11/15 10:30:46 $
+  Version:   $Revision: 1.328 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -337,22 +337,33 @@ bool Document::SetShaDict(DictKey const &dictName)
  * @return false when we're 150 % sure it's NOT a Dicom/Acr file,
  *         true otherwise. 
  */
-bool Document::IsReadable()
+bool Document::IsParsable()
 {
    if ( Filetype == Unknown )
    {
-      gdcmErrorMacro( "Wrong filetype for " << GetFileName());
+      gdcmWarningMacro( "Wrong filetype for " << GetFileName());
       return false;
    }
 
    if ( IsEmpty() )
    { 
-      gdcmErrorMacro( "No tag in internal hash table.");
+      gdcmWarningMacro( "No tag in internal hash table.");
       return false;
    }
 
    return true;
 }
+/**
+ * \brief  This predicate tells us whether or not the current Document 
+ *         was properly parsed and contains at least *one* Dicom Element
+ *         (and nothing more, sorry).
+ * @return false when we're 150 % sure it's NOT a Dicom/Acr file,
+ *         true otherwise. 
+ */
+bool Document::IsReadable()
+{
+   return IsParsable();
+}
 
 /**
  * \brief   Predicate for dicom version 3 file.
index e72c8bb5aad1b642f655c34376253d47989b6405..a30134513beab8b6c41c533e524cd78fb971fa9b 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDocument.h,v $
   Language:  C++
-  Date:      $Date: 2005/11/14 14:23:44 $
-  Version:   $Revision: 1.130 $
+  Date:      $Date: 2005/11/15 10:30:46 $
+  Version:   $Revision: 1.131 $
  
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -56,6 +56,7 @@ public:
    bool SetShaDict(DictKey const &dictName);
 
 // Informations contained in the gdcm::Document
+   bool IsParsable();
    virtual bool IsReadable();
    bool IsDicomV3();
    bool IsPapyrus();