source: tags/arb_5.3/GENOM_IMPORT/MetaInfo.h

Last change on this file was 5777, checked in by westram, 15 years ago
  • again removed timestamps
File size: 2.2 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 string& field, const string& content);
25    const string *get(const string& field) const;
26   
27    void getKeys(stringSet& keys) const; // get reference keys
28};
29
30
31class References : public Noncopyable { // holds information of all reference sections
32    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 string& field, const string& content) {
41        gi_assert(latest); 
42        latest->add(field, content);
43    }
44
45    void add_dbid(const string& content); // special handling for 'RX' field
46
47    void   getKeys(stringSet& keys) const; // get reference keys
48    string tagged_content(const string& refkey) const;
49   
50#if defined(DEBUG)
51    void dump() const;
52#endif // DEBUG
53};
54
55class MetaInfo : public Noncopyable {
56    stringMap  entries;         // key = arb_field, value = content
57
58public:
59    MetaInfo() {}
60
61    void add(const MetaTag *meta, const 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 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.