# 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-2010 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
    00034 class GDCM_EXPORT File : public Object
    00035 {
    00036 public:
    00037   File() {};
    00038   ~File() {};
    00039
    00040   friend std::ostream &operator<<(std::ostream &os, const File &val);
    00041
    00043   std::istream &Read(std::istream &is);
    00044
    00046   std::ostream const &Write(std::ostream &os) const;
    00047
    00049   const FileMetaInformation &GetHeader() const { return Header; }
    00050
    00052   FileMetaInformation &GetHeader() { return Header; }
    00053
    00055   void SetHeader( const FileMetaInformation &fmi ) { Header = fmi; }
    00056
    00058   const DataSet &GetDataSet() const { return DS; }
    00059
    00061   DataSet &GetDataSet() { return DS; }
    00062
    00064   void SetDataSet( const DataSet &ds) { DS = ds; }
    00065
    00066 private:
    00067   FileMetaInformation Header;
    00068   DataSet DS;
    00069 };
    00070 //-----------------------------------------------------------------------------
    00071 inline std::ostream& operator<<(std::ostream &os, const File &val)
    00072 {
    00073   os << val.GetHeader() << std::endl;
    00074   //os << val.GetDataSet() << std::endl; // FIXME
    00075   assert(0);
    00076   return os;
    00077 }
    00078
    00079 } // end namespace gdcm
    00080
    00081 #endif //GDCMFILE_H