This repository was archived by the owner on Jul 15, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathOriginAnyParser.h
More file actions
85 lines (73 loc) · 3.23 KB
/
OriginAnyParser.h
File metadata and controls
85 lines (73 loc) · 3.23 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
/*
OriginAnyParser.h
SPDX-FileCopyrightText: 2017 Miquel Garriga <gbmiquel@gmail.com>
SPDX-License-Identifier: GPL-3.0-or-later
Parser for all versions. Based mainly on Origin750Parser.h
*/
#ifndef ORIGIN_ANY_PARSER_H
#define ORIGIN_ANY_PARSER_H
#include "OriginParser.h"
#include "endianfstream.hh"
#include <string>
#include <cmath> // for floor()
using namespace Origin;
using namespace endianfstream;
class ORIGIN_EXPORT OriginAnyParser : public OriginParser
{
public:
explicit OriginAnyParser(const std::string &fileName);
bool parse() override;
protected:
unsigned int readObjectSize();
std::string readObjectAsString(unsigned int);
void readFileVersion();
void readGlobalHeader();
bool readDataSetElement();
bool readWindowElement();
bool readLayerElement();
unsigned int readAnnotationList();
bool readAnnotationElement();
bool readCurveElement();
bool readAxisBreakElement();
bool readAxisParameterElement(unsigned int);
bool readParameterElement();
bool readNoteElement();
void readProjectTree();
unsigned int readFolderTree(tree<ProjectNode>::iterator, unsigned int);
void readProjectLeaf(tree<ProjectNode>::iterator);
void readAttachmentList();
bool getColumnInfoAndData(const std::string &, unsigned int, const std::string &, unsigned int);
void getMatrixValues(const std::string &, unsigned int, short, char, char,
std::vector<Origin::Matrix>::difference_type);
void getWindowProperties(Origin::Window &, const std::string &, unsigned int);
void getLayerProperties(const std::string &, unsigned int);
Origin::Color getColor(const std::string &);
void getAnnotationProperties(const std::string &, unsigned int, const std::string &,
unsigned int, const std::string &, unsigned int,
const std::string &, unsigned int);
void getCurveProperties(const std::string &, unsigned int, const std::string &, unsigned int);
void getAxisBreakProperties(const std::string &, unsigned int);
void getAxisParameterProperties(const std::string &, unsigned int, int);
void getNoteProperties(const std::string &, unsigned int, const std::string &, unsigned int,
const std::string &, unsigned int);
void getColorMap(ColorMap &, const std::string &, unsigned int);
void getZcolorsMap(ColorMap &, const std::string &, unsigned int);
void getProjectLeafProperties(tree<ProjectNode>::iterator, const std::string &, unsigned int);
void getProjectFolderProperties(tree<ProjectNode>::iterator, const std::string &, unsigned int);
void outputProjectTree(std::ostream &);
inline time_t doubleToPosixTime(double jdt)
{
/* 2440587.5 is julian date for the unixtime epoch */
return (time_t)floor((jdt - 2440587) * 86400. + 0.5);
}
iendianfstream file;
FILE *logfile;
std::streamsize d_file_size;
std::streamoff curpos;
unsigned int objectIndex, parseError;
std::vector<Origin::SpreadSheet>::difference_type ispread;
std::vector<Origin::Matrix>::difference_type imatrix;
std::vector<Origin::Excel>::difference_type iexcel;
int igraph, ilayer;
};
#endif // ORIGIN_ANY_PARSER_H