00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #ifndef ORIGIN_FILE_H
00031 #define ORIGIN_FILE_H
00032
00033
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