source: tags/ms_r16q3/GENOM_IMPORT/MetaInfo.h

Last change on this file was 8251, checked in by westram, 12 years ago
  • removed using decls from headers
File size: 2.3 KB
Line 
1// ================================================================ //
2//                                                                  //
3//   File      : MetaInfo.h                                         //
4//   Purpose   :                                                    //
5//                                                                  //
6//   Coded by Ralf Westram (coder@reallysoft.de) in November 2006   //
7//   Institute of Microbiology (Technical University Munich)        //
8//   http://www.arb-home.de/                                        //
9//                                                                  //
10// ================================================================ //
11#ifndef METAINFO_H
12#define METAINFO_H
13
14#ifndef METATAG_H
15#include "MetaTag.h"
16#endif
17
18class Reference { // holds information of one reference section
19    stringMap entries; // reference entries mapped to ARBDB field names
20
21public:
22    Reference() {}
23
24    void add(const std::string& field, const std::string& content);
25    const std::string *get(const std::string& field) const;
26
27    void getKeys(stringSet& keys) const; // get reference keys
28};
29
30
31class References : virtual Noncopyable { // holds information of all reference sections
32    std::vector<Reference>  refs;
33    Reference              *latest;
34    int                     ref_count;
35
36public:
37    References() : latest(0), ref_count(0) {}
38
39    void start();               // start a new reference
40    void add(const std::string& field, const std::string& content) {
41        gi_assert(latest);
42        latest->add(field, content);
43    }
44
45    void add_dbid(const std::string& content); // special handling for 'RX' field
46
47    void   getKeys(stringSet& keys) const; // get reference keys
48    std::string tagged_content(const std::string& refkey) const;
49
50#if defined(DEBUG)
51    void dump() const;
52#endif // DEBUG
53};
54
55class MetaInfo : virtual Noncopyable {
56    stringMap  entries;         // key = arb_field, value = content
57
58public:
59    MetaInfo() {}
60
61    void add(const MetaTag *meta, const std::string& content, bool allow_multiple_entries);
62
63#if defined(DEBUG)
64    void dump() const;
65#endif // DEBUG
66
67    const stringMap& getEntries() const { return entries; }
68
69    const std::string& getAccessionNumber() const;
70};
71
72#else
73#error MetaInfo.h included twice
74#endif // METAINFO_H
75
76
77
Note: See TracBrowser for help on using the repository browser.