]> Creatis software - gdcm.git/blobdiff - src/gdcmDocument.h
* gdcmPython/testSuite.py checks on CR-MONO1-10-chest.dcm moved to
[gdcm.git] / src / gdcmDocument.h
index c5b4eac08a97b3b21b05405004ff230afe71aefa..24e1cd2ef666bd9b124abfaae6d2c6f89066ad06 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDocument.h,v $
   Language:  C++
-  Date:      $Date: 2004/07/31 23:30:04 $
-  Version:   $Revision: 1.27 $
+  Date:      $Date: 2004/08/02 16:42:14 $
+  Version:   $Revision: 1.30 $
  
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -111,11 +111,11 @@ public:
    gdcmDict *GetPubDict();
    gdcmDict *GetShaDict();
    bool SetShaDict(gdcmDict *dict);
-   bool SetShaDict(DictKey dictName);
+   bool SetShaDict(DictKey const & dictName);
 
 // Informations contained in the parser
    virtual bool IsReadable();
-   bool IsGivenTransferSyntax(std::string const & SyntaxToCheck);
+   bool IsGivenTransferSyntax(std::string const & syntaxToCheck);
    bool IsImplicitVRLittleEndianTransferSyntax();
    bool IsExplicitVRLittleEndianTransferSyntax();
    bool IsDeflatedExplicitVRLittleEndianTransferSyntax();
@@ -131,7 +131,7 @@ public:
 
    FileType GetFileType();
 
-   FILE* OpenFile(bool exception_on_error = false) throw(gdcmFileError);
+   FILE* OpenFile();
    bool CloseFile();
 
    void Write(FILE* fp, FileType type);
@@ -141,12 +141,14 @@ public:
 
    gdcmBinEntry* ReplaceOrCreateByNumber(void *voidArea, int lgth,
                                          uint16_t group, uint16_t elem);
-   bool ReplaceIfExistByNumber (std::string const & value, uint16_t group, uint16_t elem);
+   bool ReplaceIfExistByNumber ( std::string const & value,
+                                 uint16_t group,
+                                 uint16_t elem );
    
    virtual void* LoadEntryVoidArea(uint16_t group, uint16_t elem);
    virtual void* LoadEntryVoidArea(gdcmBinEntry* entry);
       
-   // System access
+   // System access (meaning endian related !?)
    uint16_t SwapShort(uint16_t);   // needed by gdcmFile
    uint32_t SwapLong(uint32_t);    // needed by gdcmFile
    uint16_t UnswapShort(uint16_t); // needed by gdcmFile
@@ -156,9 +158,8 @@ protected:
    // Constructor and destructor are protected to forbid end user 
    // to instanciate from this class gdcmDocument (only gdcmHeader and
    // gdcmDicomDir are meaningfull).
-   gdcmDocument(bool exception_on_error  = false);
-   gdcmDocument(std::string const & filename, 
-                bool  exception_on_error = false);
+   gdcmDocument();
+   gdcmDocument( std::string const & filename );
    virtual ~gdcmDocument();
    
    void Parse7FE0 ();   
@@ -171,8 +172,9 @@ public:
    virtual std::string GetEntryVRByNumber(uint16_t group, uint16_t elem);
    virtual int     GetEntryLengthByNumber(uint16_t group, uint16_t elem);
 protected:
-   virtual bool SetEntryByName  (std::string content, std::string tagName);
-   virtual bool SetEntryByNumber(std::string content,
+   virtual bool SetEntryByName  (std::string const & content, 
+                                 std::string const & tagName);
+   virtual bool SetEntryByNumber(std::string const & content,
                                  uint16_t group, uint16_t element);
    virtual bool SetEntryByNumber(void *content, int lgth,
                                  uint16_t group, uint16_t element);
@@ -198,10 +200,10 @@ protected:
 private:
    // Read
    long ParseDES(gdcmDocEntrySet *set, long offset, long l_max,bool delim_mode);
-   long ParseSQ(gdcmSeqEntry *seq, long offset, long l_max, bool delim_mode); 
+   long ParseSQ (gdcmSeqEntry *seq, long offset, long l_max, bool delim_mode); 
    
    void LoadDocEntry      (gdcmDocEntry *);
-   void FindDocEntryLength(gdcmDocEntry *);
+   void FindDocEntryLength(gdcmDocEntry *) throw ( gdcmFormatError );
    void FindDocEntryVR    (gdcmDocEntry *);
    bool CheckDocEntryVR   (gdcmDocEntry *, gdcmVRKey);
 
@@ -214,10 +216,10 @@ private:
    void FixDocEntryFoundLength(gdcmDocEntry *, uint32_t);
    bool IsDocEntryAnInteger   (gdcmDocEntry *);
 
-   uint32_t FindDocEntryLengthOB();
+   uint32_t FindDocEntryLengthOB() throw( gdcmFormatUnexpected );
 
-   uint16_t ReadInt16();
-   uint32_t ReadInt32();
+   uint16_t ReadInt16() throw ( gdcmFormatError );
+   uint32_t ReadInt32() throw ( gdcmFormatError );
    void     SkipBytes(uint32_t);
    bool     ReadTag(uint16_t, uint16_t);
    uint32_t ReadTagLength(uint16_t, uint16_t);