Matrix Science Mascot Parser toolkit
 
Loading...
Searching...
No Matches
ms_parserule.hpp
1/*
2##############################################################################
3# file: ms_parserule.hpp #
4# 'msparser' toolkit #
5# Represents PARSE section of mascot.dat file #
6##############################################################################
7# COPYRIGHT NOTICE #
8# Copyright 1998-2003 Matrix Science Limited All Rights Reserved. #
9# #
10##############################################################################
11# $Archive:: /Mowse/ms_mascotresfile/include/ms_parserule.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_PARSERULE_HPP
20#define MS_PARSERULE_HPP
21
22
23#include <string>
24
25
26namespace matrix_science {
33
37 class MS_MASCOTRESFILE_API ms_parserule
38 {
39 friend class ms_datfile;
40 friend class ms_parseoptions;
41 friend class ms_spectral_lib_file;
42
43 public:
46
48 ms_parserule(const ms_parserule& src);
49
52
54 void defaultValues();
55
57 void copyFrom(const ms_parserule* right);
58
59#ifndef SWIG
61 ms_parserule& operator=(const ms_parserule& right);
62#endif
64 bool isAvailable() const;
65
67 void setAvailable(const bool value);
68
70 std::string getRuleStr() const;
71
73 void setRuleStr(const char* str);
74
75 private:
76 bool available_;
77 std::string szRule_;
78
79 void *compiledExp_;
80 void compileAccessionRegex(ms_errs* pErr);
81 std::string regexStr(const char * input, ms_errs * pErr, bool reportErrorIfNoMatch) const;
82
83 };// class ms_parserule
84
86
101 class MS_MASCOTRESFILE_API ms_parseoptions : public ms_customproperty
102 {
103 friend class ms_datfile;
104 public:
107
110
113
115 void defaultValues();
116
118 void copyFrom(const ms_parseoptions* right);
119
120#ifndef SWIG
122 ms_parseoptions& operator=(const ms_parseoptions& right);
123#endif
125 bool isSectionAvailable() const;
126
128 void setSectionAvailable(const bool value);
129
131 int getNumberOfParseRules() const;
132
134 void clearParseRules();
135
137 const ms_parserule* getParseRule(const int index) const;
138
140 void setParseRule(const int index, const ms_parserule* rule);
141
143 void dropParseRule(const int index);
144
145 int findOrAddParseRule(const char * rule, bool & added);
146
147#ifdef SUPPRESS_MS_CUSTOMPROPERTY_INHERITANCE
148#include "suppress_ms_customproperty.hpp"
149#endif
150
151 private:
152 bool sectionAvailable_;
153 ms_parserule *parseRules_;
154 }; // end of config_group
156} // namespace matrix_science
157
158#endif // MS_PARSERULE_HPP
159
160/*------------------------------- End of File -------------------------------*/
The class is used as a base for property-containing classes, such as ms_mascotoptions.
Definition: ms_customproperty.hpp:91
Encapsulates the mascot.dat file that contains the most important parameters.
Definition: ms_datfile.hpp:47
All errors are collected in an instance of this class.
Definition: ms_errors.hpp:37
Represents the PARSE section of mascot.dat.
Definition: ms_parserule.hpp:102
Represents a single regular expression parsing rule.
Definition: ms_parserule.hpp:38
This class is used to encapsulate a complete NIST .msp, SpectraST .sptxt or X!Hunter ASL MGF file.
Definition: ms_spectral_lib_file.hpp:66