yat  0.14.5pre
GFF.h
1 #ifndef theplu_yat_omic_gff
2 #define theplu_yat_omic_gff
3 
4 // $Id: GFF.h 3114 2013-11-10 23:51:47Z peter $
5 
6 /*
7  Copyright (C) 2011, 2013 Peter Johansson
8 
9  This file is part of the yat library, http://dev.thep.lu.se/yat
10 
11  The yat library is free software; you can redistribute it and/or
12  modify it under the terms of the GNU General Public License as
13  published by the Free Software Foundation; either version 3 of the
14  License, or (at your option) any later version.
15 
16  The yat library is distributed in the hope that it will be useful,
17  but WITHOUT ANY WARRANTY; without even the implied warranty of
18  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19  General Public License for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with yat. If not, see <http://www.gnu.org/licenses/>.
23 */
24 
25 #include <iosfwd>
26 #include <map>
27 #include <string>
28 #include <vector>
29 
30 namespace theplu {
31 namespace yat {
32 namespace omic {
33 
39  class GFF
40  {
41  public:
50  GFF(void);
51 
55  virtual ~GFF(void);
56 
63  const std::string& attribute(const std::string& key) const;
64 
70  const std::map<std::string, std::string>& attributes(void) const;
71 
75  const std::string& end(void) const;
76 
80  const std::string& phase(void) const;
81 
85  const std::string& score(void) const;
86 
90  const std::string& seqid(void) const;
91 
95  const std::string& source(void) const;
96 
100  const std::string& start(void) const;
101 
105  const std::string& strand(void) const;
106 
110  const std::string& type(void) const;
111  protected:
115  const std::vector<std::string>& vec(void) const;
116 
120  friend std::ostream& operator<<(std::ostream&, const GFF&);
121  // user compiler generated copy
122  //GFF(const GFF& other) {};
123  //GFFBase& operator=(const GFF&);
124  private:
125  friend bool getline(std::istream&, GFF&);
126  virtual void add_attribute(std::map<std::string, std::string>& m,
127  const std::string&) const=0;
128 
129  void create_attributes(std::map<std::string, std::string>& m) const;
130  std::vector<std::string> vec_;
131  std::map<std::string, std::string> attributes_;
132  };
133 
142  bool getline(std::istream& is, GFF& gff);
143 
150  std::ostream& operator<<(std::ostream& os, const GFF& gff);
151 
152 }}}
153 #endif
Definition: GFF.h:39
bool is(const std::string &s)
check if string is convertible to (numerical) type T
Definition: utility.h:483
GFF(void)
Default Constructor.
const std::string & start(void) const
const std::string & strand(void) const
const std::string & source(void) const
const std::string & seqid(void) const
const std::vector< std::string > & vec(void) const
const std::string & score(void) const
virtual ~GFF(void)
Destructor.
const std::string & attribute(const std::string &key) const
const std::string & type(void) const
friend std::ostream & operator<<(std::ostream &, const GFF &)
protected friend
const std::string & phase(void) const
const std::map< std::string, std::string > & attributes(void) const
const std::string & end(void) const

Generated on Tue Sep 26 2017 02:33:29 for yat by  doxygen 1.8.5