GDCM 2.2.1

- Main Page
- Related Pages
- Namespaces
- Classes
- Files
- Examples

- File List
- File Members

gdcmFile.h
Go to the documentation of this file.
1 /*=========================================================================
2
3 Program: GDCM (Grassroots DICOM). A DICOM library
4
5 Copyright (c) 2006-2011 Mathieu Malaterre
6 All rights reserved.
7 See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
8
9 This software is distributed WITHOUT ANY WARRANTY; without even
10 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11 PURPOSE. See the above copyright notice for more information.
12
13 =========================================================================*/
14 #ifndef GDCMFILE_H
15 #define GDCMFILE_H
16
17 #include "gdcmObject.h"
18 #include "gdcmDataSet.h"
19 #include "gdcmFileMetaInformation.h"
20
21 namespace gdcm
22 {
23
33 class GDCM_EXPORT File : public Object
34 {
35 public:
36 File() {};
37 ~File() {};
38
39 friend std::ostream &operator<<(std::ostream &os, const File &val);
40
42 std::istream &Read(std::istream &is);
43
45 std::ostream const &Write(std::ostream &os) const;
46
48 const FileMetaInformation &GetHeader() const { return Header; }
49
51 FileMetaInformation &GetHeader() { return Header; }
52
54 void SetHeader( const FileMetaInformation &fmi ) { Header = fmi; }
55
57 const DataSet &GetDataSet() const { return DS; }
58
60 DataSet &GetDataSet() { return DS; }
61
63 void SetDataSet( const DataSet &ds) { DS = ds; }
64
65 private:
66 FileMetaInformation Header;
67 DataSet DS;
68 };
69 //-----------------------------------------------------------------------------
70 inline std::ostream& operator<<(std::ostream &os, const File &val)
71 {
72 os << val.GetHeader() << std::endl;
73 //os << val.GetDataSet() << std::endl; // FIXME
74 assert(0);
75 return os;
76 }
77
78 } // end namespace gdcm
79
80 #endif //GDCMFILE_H