liborigin2 13/09/2010
|
00001 /*************************************************************************** 00002 File : OriginFile.h 00003 -------------------------------------------------------------------- 00004 Copyright : (C) 2005-2007 Stefan Gerlach 00005 (C) 2007-2008 Alex Kargovsky, Ion Vasilief 00006 Email (use @ for *) : kargovsky*yumr.phys.msu.su, ion_vasilief*yahoo.fr 00007 Description : Origin file import class 00008 00009 ***************************************************************************/ 00010 00011 /*************************************************************************** 00012 * * 00013 * This program is free software; you can redistribute it and/or modify * 00014 * it under the terms of the GNU General Public License as published by * 00015 * the Free Software Foundation; either version 2 of the License, or * 00016 * (at your option) any later version. * 00017 * * 00018 * This program is distributed in the hope that it will be useful, * 00019 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00020 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00021 * GNU General Public License for more details. * 00022 * * 00023 * You should have received a copy of the GNU General Public License * 00024 * along with this program; if not, write to the Free Software * 00025 * Foundation, Inc., 51 Franklin Street, Fifth Floor, * 00026 * Boston, MA 02110-1301 USA * 00027 * * 00028 ***************************************************************************/ 00029 00030 #ifndef ORIGIN_FILE_H 00031 #define ORIGIN_FILE_H 00032 00033 /* version 0.0 2007-09-26 */ 00034 #define LIBORIGIN_VERSION 0x00070926 00035 #define LIBORIGIN_VERSION_STRING "2007-09-26" 00036 00037 #include "OriginObj.h" 00038 #include "OriginParser.h" 00039 #include <memory> 00040 00041 using namespace std; 00042 00043 class OriginFile 00044 { 00045 public: 00046 OriginFile(const string& fileName); 00047 00048 bool parse(); 00049 double version() const; 00050 00051 vector<Origin::SpreadSheet>::size_type spreadCount() const; 00052 Origin::SpreadSheet& spread(vector<Origin::SpreadSheet>::size_type s) const; 00053 00054 vector<Origin::Matrix>::size_type matrixCount() const; 00055 Origin::Matrix& matrix(vector<Origin::Matrix>::size_type m) const; 00056 00057 vector<Origin::Function>::size_type functionCount() const; 00058 vector<Origin::Function>::size_type functionIndex(const string& name) const; 00059 Origin::Function& function(vector<Origin::Function>::size_type f) const; 00060 00061 vector<Origin::Graph>::size_type graphCount() const; 00062 Origin::Graph& graph(vector<Origin::Graph>::size_type g) const; 00063 00064 vector<Origin::Note>::size_type noteCount() const; 00065 Origin::Note& note(vector<Origin::Note>::size_type n) const; 00066 00067 const tree<Origin::ProjectNode>* project() const; 00068 string resultsLogString() const; 00069 00070 private: 00071 unsigned int fileVersion, buildVersion; 00072 auto_ptr<OriginParser> parser; 00073 }; 00074 00075 #endif // ORIGIN_FILE_H