liborigin 2.0.0

OriginFile.h

Go to the documentation of this file.
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 #include "config.h"
00034 #include "OriginObj.h"
00035 #include "OriginParser.h"
00036 #include <memory>
00037 
00038 using namespace std;
00039 
00040 class OriginFile
00041 {
00042 public:
00043     OriginFile(const string& fileName);
00044 
00045     bool parse();                                                                       
00046     double version() const;                                                             
00047 
00048     vector<Origin::SpreadSheet>::size_type spreadCount() const;                         
00049     Origin::SpreadSheet& spread(vector<Origin::SpreadSheet>::size_type s) const;        
00050 
00051     vector<Origin::Matrix>::size_type matrixCount() const;                              
00052     Origin::Matrix& matrix(vector<Origin::Matrix>::size_type m) const;                  
00053 
00054     vector<Origin::Function>::size_type functionCount() const;                          
00055     vector<Origin::Function>::size_type functionIndex(const string& name) const;        
00056     Origin::Function& function(vector<Origin::Function>::size_type f) const;            
00057 
00058     vector<Origin::Graph>::size_type graphCount() const;                                
00059     Origin::Graph& graph(vector<Origin::Graph>::size_type g) const;                     
00060     
00061     vector<Origin::Note>::size_type noteCount() const;                                  
00062     Origin::Note& note(vector<Origin::Note>::size_type n) const;                        
00063 
00064     const tree<Origin::ProjectNode>* project() const;                                   
00065     string resultsLogString() const;                                                    
00066 
00067 private:
00068     unsigned int fileVersion, buildVersion;
00069     auto_ptr<OriginParser> parser;
00070 };
00071 
00072 #endif // ORIGIN_FILE_H