-
Notifications
You must be signed in to change notification settings - Fork 131
Expand file tree
/
Copy pathlazyFileReader.h
More file actions
67 lines (55 loc) · 1.47 KB
/
lazyFileReader.h
File metadata and controls
67 lines (55 loc) · 1.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#ifndef LAZYFILEREADER_H
#define LAZYFILEREADER_H
#include <vector>
#include <string>
#include <cstdlib>
#include "sc_export.h"
// PART 21
#include "lazyP21DataSectionReader.h"
#include "p21HeaderSectionReader.h"
#include "headerSectionReader.h"
/* // PART 28
* #include "lazyP28DataSectionReader.h"
* #include "p28HeaderSectionReader.h"
*/
class lazyInstMgr;
class Registry;
class headerSectionReader;
///read an exchange file of any supported type (currently only p21)
///for use only from within lazyInstMgr
class SC_LAZYFILE_EXPORT lazyFileReader {
protected:
#ifdef _MSC_VER
#pragma warning( push )
#pragma warning( disable: 4251 )
#endif
std::string _fileName;
lazyInstMgr * _parent;
headerSectionReader * _header;
std::ifstream _file;
#ifdef _MSC_VER
#pragma warning( pop )
#endif
fileTypeEnum _fileType;
fileID _fileID;
void initP21();
///TODO detect file type; for now, assume all are Part 21
void detectType() {
_fileType = Part21;
}
public:
fileID ID() const {
return _fileID;
}
instancesLoaded_t * getHeaderInstances();
lazyFileReader( std::string fname, lazyInstMgr * i, fileID fid );
~lazyFileReader();
fileTypeEnum type() const {
return _fileType;
}
lazyInstMgr * getInstMgr() const {
return _parent;
}
bool needKW( const char * kw );
};
#endif //LAZYFILEREADER_H