Matrix Science header

ms_taxonomyfile.hpp

00001 /*
00002 ##############################################################################
00003 # file: ms_taxonomyfile.hpp                                                  #
00004 # 'msparser' toolkit                                                         #
00005 # Encapsulates "taxonomy"-file that available taxonomy choices               #
00006 ##############################################################################
00007 # COPYRIGHT NOTICE                                                           #
00008 # Copyright 1998-2004 Matrix Science Limited  All Rights Reserved.           #
00009 #                                                                            #
00010 ##############################################################################
00011 #    $Archive:: /Mowse/ms_mascotresfile/include/ms_taxonomyfile.hpp        $ #
00012 #     $Author: villek $ #
00013 #       $Date: 2010/09/06 16:18:57 $ #
00014 #   $Revision: 1.11 $ #
00015 # $NoKeywords::                                                            $ #
00016 ##############################################################################
00017 */
00018 
00019 #ifndef MS_TAXONOMYFILE_HPP
00020 #define MS_TAXONOMYFILE_HPP
00021 
00022 #ifdef _WIN32
00023 #pragma warning(disable:4251)   // Don't want all classes to be exported
00024 #pragma warning(disable:4786)   // Debug symbols too long
00025 #   ifndef _MATRIX_USE_STATIC_LIB
00026 #       ifdef MS_MASCOTRESFILE_EXPORTS
00027 #           define MS_MASCOTRESFILE_API __declspec(dllexport)
00028 #       else
00029 #           define MS_MASCOTRESFILE_API __declspec(dllimport)
00030 #       endif
00031 #   else
00032 #       define MS_MASCOTRESFILE_API
00033 #   endif
00034 #else
00035 #   define MS_MASCOTRESFILE_API
00036 #endif
00037 
00038 // for the sake of #include <string>
00039 #ifdef __ALPHA_UNIX__
00040 #include <ctype.h>
00041 #endif
00042 #include <string>
00043 #include <vector>
00044 
00045 namespace matrix_science {
00051 
00052 
00067     class MS_MASCOTRESFILE_API ms_taxonomychoice: public ms_customproperty
00068     {
00069         friend class ms_taxonomyfile;
00070     public:
00071 
00073         ms_taxonomychoice();
00074 
00076         ms_taxonomychoice(const ms_taxonomychoice& src);
00077 
00079         ~ms_taxonomychoice();
00080 
00082         void defaultValues();
00083 
00085         void copyFrom(const ms_taxonomychoice* src);
00086 
00087 #ifndef SWIG
00088 
00089         ms_taxonomychoice& operator=(const ms_taxonomychoice& right);
00090 #endif
00091 
00092         std::string getTitle() const;
00093 
00095         void setTitle(const char* value);
00096 
00098         int getNumberOfIncludeTaxonomies() const;
00099 
00101         int getIncludeTaxonomy(const int n) const;
00102 
00104         void clearIncludeTaxonomies();
00105 
00107         void appendIncludeTaxonomy(const int id);
00108 
00110         int getNumberOfExcludeTaxonomies() const;
00111 
00113         int getExcludeTaxonomy(const int n) const;
00114 
00116         void clearExcludeTaxonomies();
00117 
00119         void appendExcludeTaxonomy(const int id);
00120 
00121 #ifdef SUPPRESS_MS_CUSTOMPROPERTY_INHERITANCE
00122 #include "suppress_ms_customproperty.hpp"
00123 #endif
00124 
00125     private:
00126         void setCustomProperty();
00127 
00128     private:
00129         std::string title;
00130 
00131         std::vector< int > includeList;
00132         std::vector< int > excludeList;
00133     }; // ms_taxonomychoice
00134 
00135     class ms_filesource;
00136 
00138 
00163     class MS_MASCOTRESFILE_API ms_taxonomyfile: public ms_errors
00164     {
00165     public:
00167         ms_taxonomyfile();
00168 
00170         ms_taxonomyfile(const ms_taxonomyfile& src);
00171 
00173         ms_taxonomyfile(const char* filename, const matrix_science::ms_connection_settings * cs = 0); 
00174 
00176         ~ms_taxonomyfile();
00177 
00179         void defaultValues();
00180 
00182         void copyFrom(const ms_taxonomyfile* right);
00183 
00184 #ifndef SWIG
00185 
00186         ms_taxonomyfile& operator=(const ms_taxonomyfile& right);
00187 #endif
00188 
00189         void setFileName(const char* name);
00190 
00192         std::string getFileName() const;
00193 
00195 
00199         void setConnectionSettings(const matrix_science::ms_connection_settings & cs);
00200 
00202 
00205         matrix_science::ms_connection_settings getConnectionSettings() const;
00206 
00208         void read_file();
00209 
00211         void read_buffer(const char* buffer);
00212 
00214         void save_file();
00215 
00217         int getNumberOfEntries() const;
00218 
00220         void clearEntries();
00221 
00223         void appendEntry(const ms_taxonomychoice* item);
00224 
00226         const ms_taxonomychoice * getEntryByNumber(const int index) const;
00227 
00229         ms_taxonomychoice * getEntryByName(const char* name);
00230 
00231     private:
00232         void read_internal(ms_filesource *pFSource);
00233 
00234         typedef std::vector<ms_taxonomychoice* > entries_vector;
00235         entries_vector  entries;
00236 
00237         std::string     filename_;
00238         std::vector< std::string > comments_;
00239         ms_connection_settings cs_;
00240     }; // ms_taxonomyfile // end of config_group
00242 } // namespace matrix_science
00243 
00244 #endif // MS_TAXONOMYFILE_HPP
00245 
00246 /*------------------------------- End of File -------------------------------*/
Copyright © 2016 Matrix Science Ltd.  All Rights Reserved. Generated on Fri Jun 2 2017 01:44:51