liborigin 2.0.0
/usr/src/slapt-src/libraries/liborigin/liborigin/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
38using namespace std;
39
41{
42public:
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
67private:
69 auto_ptr<OriginParser> parser;
70};
71
72#endif // ORIGIN_FILE_H
Definition: OriginFile.h:41
const tree< Origin::ProjectNode > * project() const
get project tree
Definition: OriginFile.cpp:148
vector< Origin::Graph >::size_type graphCount() const
get number of graphs
Definition: OriginFile.cpp:188
vector< Origin::Function >::size_type functionIndex(const string &name) const
get name of function s
Definition: OriginFile.cpp:178
double version() const
get version of Origin file
Definition: OriginFile.cpp:143
Origin::Note & note(vector< Origin::Note >::size_type n) const
get note n
Definition: OriginFile.cpp:203
Origin::Graph & graph(vector< Origin::Graph >::size_type g) const
get graph g
Definition: OriginFile.cpp:193
string resultsLogString() const
get Results Log
Definition: OriginFile.cpp:208
bool parse()
parse Origin file
Definition: OriginFile.cpp:137
unsigned int fileVersion
Definition: OriginFile.h:68
auto_ptr< OriginParser > parser
Definition: OriginFile.h:69
vector< Origin::Matrix >::size_type matrixCount() const
get number of matrices
Definition: OriginFile.cpp:163
OriginFile(const string &fileName)
Definition: OriginFile.cpp:35
vector< Origin::Note >::size_type noteCount() const
get number of notes
Definition: OriginFile.cpp:198
Origin::SpreadSheet & spread(vector< Origin::SpreadSheet >::size_type s) const
get spreadsheet s
Definition: OriginFile.cpp:158
vector< Origin::SpreadSheet >::size_type spreadCount() const
get number of spreadsheets
Definition: OriginFile.cpp:153
Origin::Matrix & matrix(vector< Origin::Matrix >::size_type m) const
get matrix m
Definition: OriginFile.cpp:168
vector< Origin::Function >::size_type functionCount() const
get number of functions
Definition: OriginFile.cpp:173
unsigned int buildVersion
Definition: OriginFile.h:68
Origin::Function & function(vector< Origin::Function >::size_type f) const
get function f
Definition: OriginFile.cpp:183
Definition: endianfstream.hh:36
Definition: OriginObj.h:251
Definition: OriginObj.h:724
Definition: OriginObj.h:215
Definition: OriginObj.h:739
Definition: OriginObj.h:185