00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef MS_TAXONOMYFILE_HPP
00020 #define MS_TAXONOMYFILE_HPP
00021
00022
00023 #include <string>
00024 #include <vector>
00025
00026 namespace matrix_science {
00032
00033
00048 class MS_MASCOTRESFILE_API ms_taxonomychoice: public ms_customproperty
00049 {
00050 friend class ms_taxonomyfile;
00051 public:
00052
00054 ms_taxonomychoice();
00055
00057 ms_taxonomychoice(const ms_taxonomychoice& src);
00058
00060 ~ms_taxonomychoice();
00061
00063 void defaultValues();
00064
00066 void copyFrom(const ms_taxonomychoice* src);
00067
00068 #ifndef SWIG
00069
00070 ms_taxonomychoice& operator=(const ms_taxonomychoice& right);
00071 #endif
00072
00073 std::string getTitle() const;
00074
00076 void setTitle(const char* value);
00077
00079 int getNumberOfIncludeTaxonomies() const;
00080
00082 int getIncludeTaxonomy(const int n) const;
00083
00085 void clearIncludeTaxonomies();
00086
00088 void appendIncludeTaxonomy(const int id);
00089
00091 int getNumberOfExcludeTaxonomies() const;
00092
00094 int getExcludeTaxonomy(const int n) const;
00095
00097 void clearExcludeTaxonomies();
00098
00100 void appendExcludeTaxonomy(const int id);
00101
00102 #ifdef SUPPRESS_MS_CUSTOMPROPERTY_INHERITANCE
00103 #include "suppress_ms_customproperty.hpp"
00104 #endif
00105
00106 private:
00107 void setCustomProperty();
00108
00109 private:
00110 std::string title;
00111
00112 std::vector< int > includeList;
00113 std::vector< int > excludeList;
00114 };
00115
00116 class ms_filesource;
00117
00119
00144 class MS_MASCOTRESFILE_API ms_taxonomyfile: public ms_errors
00145 {
00146 public:
00148 ms_taxonomyfile();
00149
00151 ms_taxonomyfile(const ms_taxonomyfile& src);
00152
00154 ms_taxonomyfile(const char* filename, const matrix_science::ms_connection_settings * cs = 0);
00155
00157 ~ms_taxonomyfile();
00158
00160 void defaultValues();
00161
00163 void copyFrom(const ms_taxonomyfile* right);
00164
00165 #ifndef SWIG
00166
00167 ms_taxonomyfile& operator=(const ms_taxonomyfile& right);
00168 #endif
00169
00170 void setFileName(const char* name);
00171
00173 std::string getFileName() const;
00174
00176
00180 void setConnectionSettings(const matrix_science::ms_connection_settings & cs);
00181
00183
00186 matrix_science::ms_connection_settings getConnectionSettings() const;
00187
00189 void read_file();
00190
00192 void read_buffer(const char* buffer);
00193
00195 void save_file();
00196
00198 int getNumberOfEntries() const;
00199
00201 void clearEntries();
00202
00204 void appendEntry(const ms_taxonomychoice* item);
00205
00207 const ms_taxonomychoice * getEntryByNumber(const int index) const;
00208
00210 ms_taxonomychoice * getEntryByName(const char* name);
00211
00212 private:
00213 void read_internal(ms_filesource *pFSource);
00214
00215 typedef std::vector<ms_taxonomychoice* > entries_vector;
00216 entries_vector entries;
00217
00218 std::string filename_;
00219 std::vector< std::string > comments_;
00220 ms_connection_settings cs_;
00221 };
00223 }
00224
00225 #endif // MS_TAXONOMYFILE_HPP
00226
00227