Matrix Science header

ms_obofile.hpp

00001 /*
00002 ##############################################################################
00003 # File: ms_obofile.hpp                                                       #
00004 # Mascot Parser toolkit                                                      #
00005 # Utility functions for accessing ontology files in the .obo format          #
00006 ##############################################################################
00007 # COPYRIGHT NOTICE                                                           #
00008 # Copyright 1998-2008 Matrix Science Limited  All Rights Reserved.           #
00009 #                                                                            #
00010 ##############################################################################
00011 #    $Source: /vol/cvsroot/parser/inc/ms_obofile.hpp,v $
00012 #    $Author: villek $ 
00013 #      $Date: 2010/09/06 16:18:57 $ 
00014 #  $Revision: 1.3 $
00015 # $NoKeywords::                                                            $ #
00016 ##############################################################################
00017 */
00018 
00019 #ifndef MS_OBOFILE_HPP
00020 #define MS_OBOFILE_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 #pragma warning(disable:4503)   // decorated name length exceeded...
00026 #   ifndef _MATRIX_USE_STATIC_LIB
00027 #       ifdef MS_MASCOTRESFILE_EXPORTS
00028 #           define MS_MASCOTRESFILE_API __declspec(dllexport)
00029 #       else
00030 #           define MS_MASCOTRESFILE_API __declspec(dllimport)
00031 #       endif
00032 #   else
00033 #       define MS_MASCOTRESFILE_API
00034 #   endif
00035 #else
00036 #   define MS_MASCOTRESFILE_API
00037 #endif
00038 
00039 #include <string>
00040 #include <vector>
00041 #include <map>
00042 
00043 namespace matrix_science {
00049 
00050 
00058     class MS_MASCOTRESFILE_API ms_obofile: public ms_errors
00059     {
00060     public:
00062         ms_obofile();
00063 
00065         ms_obofile(const char * oboFileName);
00066 
00068         ms_obofile(const ms_obofile& right);
00069 
00071         ~ms_obofile();
00072 
00073 #ifndef SWIG
00074 
00075         ms_obofile& operator=(const ms_obofile& right);
00076 #endif
00077 
00078         void copyFrom(const ms_obofile* right);
00079 
00081         void defaultValues();
00082 
00084         std::vector<std::string> getItemFromId(const char * id) const;
00085 
00087         std::string findIDFromTagValue(const char * tag, const char * value) const;
00088 
00090         void parseLine(const std::string str, std::string & tag, std::string & value, std::string & comment) const;
00091 
00093         int getNumberOfEntries() const;
00094 
00095 
00096     private:
00097         void clearOntology();
00098         typedef std::vector<std::string> ontologyItem_t;
00099         typedef std::map<std::string, ontologyItem_t> ontology_t;
00100         ontology_t ontology_;
00101 
00102     }; // class ms_obofile // end of config_group
00104 } // namespace matrix_science
00105 
00106 #endif // MS_OBOFILE_HPP
00107 
00108 /*------------------------------- End of File -------------------------------*/
Copyright © 2016 Matrix Science Ltd.  All Rights Reserved. Generated on Fri Jun 2 2017 01:44:51