yat
0.8.3pre
|
00001 #ifndef theplu_yat_omic_gff 00002 #define theplu_yat_omic_gff 00003 00004 /* 00005 $Id: GFF.h 2576 2011-10-03 13:52:21Z peter $ 00006 00007 Copyright (C) 2011 Peter Johansson 00008 00009 This file is part of the yat library, http://dev.thep.lu.se/yat 00010 00011 The yat library is free software; you can redistribute it and/or 00012 modify it under the terms of the GNU General Public License as 00013 published by the Free Software Foundation; either version 3 of the 00014 License, or (at your option) any later version. 00015 00016 The yat library is distributed in the hope that it will be useful, 00017 but WITHOUT ANY WARRANTY; without even the implied warranty of 00018 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00019 General Public License for more details. 00020 00021 You should have received a copy of the GNU General Public License 00022 along with yat. If not, see <http://www.gnu.org/licenses/>. 00023 */ 00024 00025 #include <iosfwd> 00026 #include <map> 00027 #include <string> 00028 #include <vector> 00029 00030 namespace theplu { 00031 namespace yat { 00032 namespace omic { 00033 00039 class GFF 00040 { 00041 public: 00050 GFF(void); 00051 00055 virtual ~GFF(void); 00056 00063 const std::string& attribute(const std::string& key) const; 00064 00070 const std::map<std::string, std::string>& attributes(void) const; 00071 00075 const std::string& end(void) const; 00076 00080 const std::string& phase(void) const; 00081 00085 const std::string& score(void) const; 00086 00090 const std::string& seqid(void) const; 00091 00095 const std::string& source(void) const; 00096 00100 const std::string& start(void) const; 00101 00105 const std::string& strand(void) const; 00106 00110 const std::string& type(void) const; 00111 protected: 00115 const std::vector<std::string>& vec(void) const; 00116 00120 friend std::ostream& operator<<(std::ostream&, const GFF&); 00121 // user compiler generated copy 00122 //GFF(const GFF& other) {}; 00123 //GFFBase& operator=(const GFF&); 00124 private: 00125 friend bool getline(std::istream&, GFF&); 00126 virtual void add_attribute(std::map<std::string, std::string>& m, 00127 const std::string&) const=0; 00128 00129 void create_attributes(std::map<std::string, std::string>& m) const; 00130 std::vector<std::string> vec_; 00131 std::map<std::string, std::string> attributes_; 00132 }; 00133 00142 bool getline(std::istream& is, GFF& gff); 00143 00150 std::ostream& operator<<(std::ostream& os, const GFF& gff); 00151 00152 }}} 00153 #endif