NifTK  16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
niftkFixedLengthFileReader.h
Go to the documentation of this file.
1 /*=============================================================================
2 
3  NifTK: A software platform for medical image computing.
4 
5  Copyright (c) University College London (UCL). All rights reserved.
6 
7  This software is distributed WITHOUT ANY WARRANTY; without even
8  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
9  PURPOSE.
10 
11  See LICENSE.txt in the top level directory for details.
12 
13 =============================================================================*/
14 
15 #ifndef niftkFixedLengthFileReader_h
16 #define niftkFixedLengthFileReader_h
17 
18 #include <vector>
19 #include <fstream>
20 
21 namespace niftk
22 {
23 
32 template<typename T, size_t S>
34 {
35 public:
36 
43  FixedLengthFileReader(const std::string& fileName, const bool& strict=true);
44  virtual ~FixedLengthFileReader();
45 
49  std::vector<T> GetData() const;
50 
51 private:
52 
53  FixedLengthFileReader(const FixedLengthFileReader&); // purposely not implemented
54  void operator=(const FixedLengthFileReader&); // purposely not implemented
55 
59  void CloseFile();
60 
61  std::ifstream m_InputStream;
62  std::vector<T> m_Data;
63  std::string m_FileName;
64 
65 }; // end class
66 
67 } // end namespace
68 
69 #include "niftkFixedLengthFileReader.txx"
70 
71 #endif
Reads a fixed number S of type T from a file.
Definition: niftkFixedLengthFileReader.h:33
FixedLengthFileReader(const std::string &fileName, const bool &strict=true)
Constructor reads the data.
std::vector< T > GetData() const
retrieves a copy of the data.
Definition: niftkExceptionObject.h:21
GLsizei const GLcharARB ** string
Definition: glew.h:5194