Matrix Science Mascot Parser toolkit
 
Loading...
Searching...
No Matches
ms_taxonomyfile.hpp
1/*
2##############################################################################
3# file: ms_taxonomyfile.hpp #
4# 'msparser' toolkit #
5# Encapsulates "taxonomy"-file that available taxonomy choices #
6##############################################################################
7# COPYRIGHT NOTICE #
8# Copyright 1998-2004 Matrix Science Limited All Rights Reserved. #
9# #
10##############################################################################
11# $Archive:: /Mowse/ms_mascotresfile/include/ms_taxonomyfile.hpp $ #
12# $Author: villek@matrixscience.com $ #
13# $Date: 2018-07-30 16:23:53 +0100 $ #
14# $Revision: 1b450440f9c97e1e41d0fc6016a27d68951d4532 | MSPARSER_REL_3_0_0-2024-09-24-0-g93ebaeb4f4 $ #
15# $NoKeywords:: $ #
16##############################################################################
17*/
18
19#ifndef MS_TAXONOMYFILE_HPP
20#define MS_TAXONOMYFILE_HPP
21
22
23#include <string>
24#include <vector>
25
26namespace matrix_science {
33
48 class MS_MASCOTRESFILE_API ms_taxonomychoice: public ms_customproperty
49 {
50 friend class ms_taxonomyfile;
51 public:
52
55
58
61
63 void defaultValues();
64
66 void copyFrom(const ms_taxonomychoice* src);
67
68#ifndef SWIG
70 ms_taxonomychoice& operator=(const ms_taxonomychoice& right);
71#endif
73 std::string getTitle() const;
74
76 void setTitle(const char* value);
77
79 int getNumberOfIncludeTaxonomies() const;
80
82 int getIncludeTaxonomy(const int n) const;
83
85 void clearIncludeTaxonomies();
86
88 void appendIncludeTaxonomy(const int id);
89
91 int getNumberOfExcludeTaxonomies() const;
92
94 int getExcludeTaxonomy(const int n) const;
95
97 void clearExcludeTaxonomies();
98
100 void appendExcludeTaxonomy(const int id);
101
102#ifdef SUPPRESS_MS_CUSTOMPROPERTY_INHERITANCE
103#include "suppress_ms_customproperty.hpp"
104#endif
105
106 private:
107 void setCustomProperty();
108
109 private:
110 std::string title;
111
112 std::vector< int > includeList;
113 std::vector< int > excludeList;
114 }; // ms_taxonomychoice
115
116 class ms_filesource;
117
119
144 class MS_MASCOTRESFILE_API ms_taxonomyfile: public ms_errors
145 {
146 public:
149
152
154 ms_taxonomyfile(const char* filename, const matrix_science::ms_connection_settings * cs = 0);
155
158
160 void defaultValues();
161
163 void copyFrom(const ms_taxonomyfile* right);
164
165#ifndef SWIG
167 ms_taxonomyfile& operator=(const ms_taxonomyfile& right);
168#endif
170 void setFileName(const char* name);
171
173 std::string getFileName() const;
174
176
180 void setConnectionSettings(const matrix_science::ms_connection_settings & cs);
181
183
186 matrix_science::ms_connection_settings getConnectionSettings() const;
187
189 void read_file();
190
192 void read_buffer(const char* buffer);
193
195 void save_file();
196
198 int getNumberOfEntries() const;
199
201 void clearEntries();
202
204 void appendEntry(const ms_taxonomychoice* item);
205
207 const ms_taxonomychoice * getEntryByNumber(const int index) const;
208
210 ms_taxonomychoice * getEntryByName(const char* name);
211
212 private:
213 void read_internal(ms_filesource *pFSource);
214
215 typedef std::vector<ms_taxonomychoice* > entries_vector;
216 entries_vector entries;
217
218 std::string filename_;
219 std::vector< std::string > comments_;
221 }; // ms_taxonomyfile // end of config_group
223} // namespace matrix_science
224
225#endif // MS_TAXONOMYFILE_HPP
226
227/*------------------------------- End of File -------------------------------*/
Settings required to make an HTTP connection to a Mascot server.
Definition: ms_connection_settings.hpp:54
The class is used as a base for property-containing classes, such as ms_mascotoptions.
Definition: ms_customproperty.hpp:91
This class is used as a base class for several Mascot Parser classes.
Definition: ms_errors.hpp:696
The class represents a single taxonomy choice entry in the taxonomy file.
Definition: ms_taxonomyfile.hpp:49
Use this class in order to read in a taxonomy file.
Definition: ms_taxonomyfile.hpp:145