# gdcmFile.h

Go to the documentation of this file.

    00001 /*=========================================================================
    00002
    00003   Program: GDCM (Grassroots DICOM). A DICOM library
    00004   Module:  $URL$
    00005
    00006   Copyright (c) 2006-2009 Mathieu Malaterre
    00007   All rights reserved.
    00008   See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
    00009
    00010      This software is distributed WITHOUT ANY WARRANTY; without even
    00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
    00012      PURPOSE.  See the above copyright notice for more information.
    00013
    00014 =========================================================================*/
    00015 #ifndef __gdcmFile_h
    00016 #define __gdcmFile_h
    00017
    00018 #include "gdcmObject.h"
    00019 #include "gdcmDataSet.h"
    00020 #include "gdcmFileMetaInformation.h"
    00021
    00022 namespace gdcm
    00023 {
    00024
    00032 class GDCM_EXPORT File : public Object
    00033 {
    00034 public:
    00035   File() {};
    00036   ~File() {};
    00037
    00038   friend std::ostream &operator<<(std::ostream &os, const File &val);
    00039
    00040   // Read
    00041   std::istream &Read(std::istream &is);
    00042
    00043   // Write
    00044   std::ostream const &Write(std::ostream &os) const;
    00045
    00046   const FileMetaInformation &GetHeader() const { return Header; }
    00047   FileMetaInformation &GetHeader() { return Header; }
    00048   void SetHeader( const FileMetaInformation &fmi ) { Header = fmi; }
    00049   const DataSet &GetDataSet() const { return DS; }
    00050   DataSet &GetDataSet() { return DS; }
    00051   void SetDataSet( const DataSet &ds) { DS = ds; }
    00052
    00053 private:
    00054   FileMetaInformation Header;
    00055   DataSet DS;
    00056 };
    00057 //-----------------------------------------------------------------------------
    00058 inline std::ostream& operator<<(std::ostream &os, const File &val)
    00059 {
    00060   os << val.GetHeader() << std::endl;
    00061   //os << val.GetDataSet() << std::endl; // FIXME
    00062   assert(0);
    00063   return os;
    00064 }
    00065
    00066 } // end namespace gdcm
    00067
    00068 #endif //__gdcmFile_h
    00069