Matrix Science header

ms_parserule.hpp

00001 /*
00002 ##############################################################################
00003 # file: ms_parserule.hpp                                                     #
00004 # 'msparser' toolkit                                                         #
00005 # Represents PARSE section of mascot.dat file                                #
00006 ##############################################################################
00007 # COPYRIGHT NOTICE                                                           #
00008 # Copyright 1998-2003 Matrix Science Limited  All Rights Reserved.           #
00009 #                                                                            #
00010 ##############################################################################
00011 #    $Archive:: /Mowse/ms_mascotresfile/include/ms_parserule.hpp           $ #
00012 #     $Author: villek@matrixscience.com $ #
00013 #       $Date: 2018-07-30 16:23:53 +0100 $ #
00014 #   $Revision: 1b450440f9c97e1e41d0fc6016a27d68951d4532 | MSPARSER_REL_2_8_1-0-gea32989045 $ #
00015 # $NoKeywords::                                                            $ #
00016 ##############################################################################
00017 */
00018 
00019 #ifndef MS_PARSERULE_HPP
00020 #define MS_PARSERULE_HPP
00021 
00022 
00023 #include <string>
00024 
00025 
00026 namespace matrix_science {
00032 
00033 
00037     class MS_MASCOTRESFILE_API ms_parserule
00038     {
00039         friend class ms_datfile;
00040         friend class ms_parseoptions;
00041         friend class ms_spectral_lib_file;
00042 
00043     public:
00045         ms_parserule();
00046 
00048         ms_parserule(const ms_parserule& src);
00049 
00051         ~ms_parserule();
00052 
00054         void defaultValues();
00055 
00057         void copyFrom(const ms_parserule* right);
00058 
00059 #ifndef SWIG
00060 
00061         ms_parserule& operator=(const ms_parserule& right);
00062 #endif
00063 
00064         bool isAvailable() const;
00065 
00067         void setAvailable(const bool value);
00068 
00070         std::string getRuleStr() const;
00071 
00073         void setRuleStr(const char* str);
00074 
00075     private:
00076         bool    available_;
00077         std::string szRule_;
00078 
00079         void *compiledExp_;
00080         void compileAccessionRegex(ms_errs* pErr);
00081         std::string regexStr(const char * input, ms_errs * pErr, bool reportErrorIfNoMatch) const;
00082 
00083     };// class ms_parserule
00084 
00086 
00101     class MS_MASCOTRESFILE_API ms_parseoptions : public ms_customproperty
00102     {
00103         friend class ms_datfile;
00104     public:
00106         ms_parseoptions();
00107 
00109         ms_parseoptions(const ms_parseoptions& src);
00110 
00112         ~ms_parseoptions();
00113         
00115         void defaultValues();
00116 
00118         void copyFrom(const ms_parseoptions* right);
00119 
00120 #ifndef SWIG
00121 
00122         ms_parseoptions& operator=(const ms_parseoptions& right);
00123 #endif
00124 
00125         bool isSectionAvailable() const;
00126 
00128         void setSectionAvailable(const bool value);
00129 
00131         int getNumberOfParseRules() const;
00132 
00134         void clearParseRules();
00135 
00137         const ms_parserule* getParseRule(const int index) const;
00138 
00140         void setParseRule(const int index, const ms_parserule* rule);
00141 
00143         void dropParseRule(const int index);
00144 
00145         int findOrAddParseRule(const char * rule, bool & added);
00146 
00147 #ifdef SUPPRESS_MS_CUSTOMPROPERTY_INHERITANCE
00148 #include "suppress_ms_customproperty.hpp"
00149 #endif
00150 
00151     private:
00152         bool                sectionAvailable_;
00153         ms_parserule        *parseRules_;
00154     }; // end of config_group
00156 } // namespace matrix_science
00157 
00158 #endif // MS_PARSERULE_HPP
00159 
00160 /*------------------------------- End of File -------------------------------*/

Copyright © 2022 Matrix Science Ltd.  All Rights Reserved. Generated on Thu Mar 31 2022 01:12:29