liborigin  2.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 "config.h"
34 #include "OriginObj.h"
35 #include "OriginParser.h"
36 #include <memory>
37 
38 using namespace std;
39 
41 {
42 public:
43  OriginFile(const string& fileName);
44 
45  bool parse();
46  double version() const;
47 
48  vector<Origin::SpreadSheet>::size_type spreadCount() const;
49  Origin::SpreadSheet& spread(vector<Origin::SpreadSheet>::size_type s) const;
50 
51  vector<Origin::Matrix>::size_type matrixCount() const;
52  Origin::Matrix& matrix(vector<Origin::Matrix>::size_type m) const;
53 
54  vector<Origin::Function>::size_type functionCount() const;
55  vector<Origin::Function>::size_type functionIndex(const string& name) const;
56  Origin::Function& function(vector<Origin::Function>::size_type f) const;
57 
58  vector<Origin::Graph>::size_type graphCount() const;
59  Origin::Graph& graph(vector<Origin::Graph>::size_type g) const;
60 
61  vector<Origin::Note>::size_type noteCount() const;
62  Origin::Note& note(vector<Origin::Note>::size_type n) const;
63 
64  const tree<Origin::ProjectNode>* project() const;
65  string resultsLogString() const;
66 
67 private:
68  unsigned int fileVersion, buildVersion;
69  auto_ptr<OriginParser> parser;
70 };
71 
72 #endif // ORIGIN_FILE_H
Definition: endianfstream.hh:35
Definition: OriginObj.h:214
auto_ptr< OriginParser > parser
Definition: OriginFile.h:69
unsigned int fileVersion
Definition: OriginFile.h:68
Definition: OriginObj.h:738
Definition: OriginObj.h:184
Definition: OriginObj.h:250
Definition: OriginFile.h:40
Definition: OriginObj.h:723