liborigin  3.0.0
OriginFile.h
Go to the documentation of this file.
1 /***************************************************************************
2  File : OriginFile.h
3  --------------------------------------------------------------------
4  Copyright : (C) 2005-2007 Stefan Gerlach
5  (C) 2007-2008 Alex Kargovsky, Ion Vasilief
6  Email (use @ for *) : kargovsky*yumr.phys.msu.su, ion_vasilief*yahoo.fr
7  Description : Origin file import class
8 
9  ***************************************************************************/
10 
11 /***************************************************************************
12  * *
13  * This program is free software; you can redistribute it and/or modify *
14  * it under the terms of the GNU General Public License as published by *
15  * the Free Software Foundation; either version 2 of the License, or *
16  * (at your option) any later version. *
17  * *
18  * This program is distributed in the hope that it will be useful, *
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
21  * GNU General Public License for more details. *
22  * *
23  * You should have received a copy of the GNU General Public License *
24  * along with this program; if not, write to the Free Software *
25  * Foundation, Inc., 51 Franklin Street, Fifth Floor, *
26  * Boston, MA 02110-1301 USA *
27  * *
28  ***************************************************************************/
29 
30 #ifndef ORIGIN_FILE_H
31 #define ORIGIN_FILE_H
32 
33 #include "OriginObj.h"
34 #include "OriginParser.h"
35 #include <memory>
36 
37 using namespace std;
38 
40 {
41 public:
42  explicit OriginFile(const string& fileName);
43 
44  bool parse();
45  double version() const;
46 
47  vector<Origin::SpreadColumn>::size_type datasetCount() const;
48  Origin::SpreadColumn& dataset(vector<Origin::SpreadColumn>::size_type ds) const;
49 
50  vector<Origin::SpreadSheet>::size_type spreadCount() const;
51  Origin::SpreadSheet& spread(vector<Origin::SpreadSheet>::size_type s) const;
52 
53  vector<Origin::Matrix>::size_type matrixCount() const;
54  Origin::Matrix& matrix(vector<Origin::Matrix>::size_type m) const;
55 
56  vector<Origin::Function>::size_type functionCount() const;
57  vector<Origin::Function>::difference_type functionIndex(const string& name) const;
58  Origin::Function& function(vector<Origin::Function>::size_type f) const;
59 
60  vector<Origin::Graph>::size_type graphCount() const;
61  Origin::Graph& graph(vector<Origin::Graph>::size_type g) const;
62 
63  vector<Origin::Note>::size_type noteCount() const;
64  Origin::Note& note(vector<Origin::Note>::size_type n) const;
65 
66  vector<Origin::Excel>::size_type excelCount() const;
67  Origin::Excel& excel(vector<Origin::Excel>::size_type e) const;
68 
69  const tree<Origin::ProjectNode>* project() const;
70  string resultsLogString() const;
71 
72 private:
73  unsigned int fileVersion, buildVersion, ioError;
74  unique_ptr<OriginParser> parser;
75 };
76 
77 string liboriginVersionString();
78 unsigned int liboriginVersion();
79 unsigned int liboriginVersionMajor();
80 unsigned int liboriginVersionMinor();
81 unsigned int liboriginVersionBugfix();
82 
83 #endif // ORIGIN_FILE_H
unsigned int liboriginVersionBugfix()
Definition: OriginFile.cpp:267
Definition: OriginObj.h:303
string liboriginVersionString()
Definition: OriginFile.cpp:259
unsigned int liboriginVersionMinor()
Definition: OriginFile.cpp:265
Definition: OriginObj.h:351
unsigned int ioError
Definition: OriginFile.h:73
unsigned int liboriginVersionMajor()
Definition: OriginFile.cpp:263
Definition: OriginObj.h:978
Definition: OriginObj.h:288
Definition: OriginObj.h:245
unique_ptr< OriginParser > parser
Definition: OriginFile.h:74
Definition: OriginObj.h:366
Definition: OriginFile.h:39
unsigned int liboriginVersion()
Definition: OriginFile.cpp:261
Definition: OriginObj.h:957