ARB
Main Page
Namespaces
Classes
Files
File List
File Members
CONVERTALN
rdp_info.h
Go to the documentation of this file.
1
#ifndef RDP_INFO_H
2
#define RDP_INFO_H
3
4
#ifndef GLOBAL_H
5
#include "
global.h
"
6
#endif
7
#ifndef FUN_H
8
#include "
fun.h
"
9
#endif
10
11
// -------------------------------
12
// RDP-defined comments (Embl+GenBank)
13
14
struct
OrgInfo
:
virtual
Noncopyable
{
15
char
*
source
;
16
char
*
cultcoll
;
17
char
*
formname
;
18
char
*
nickname
;
19
char
*
commname
;
20
char
*
hostorg
;
21
22
OrgInfo
() {
23
source =
no_content
();
24
cultcoll =
no_content
();
25
formname =
no_content
();
26
nickname =
no_content
();
27
commname =
no_content
();
28
hostorg =
no_content
();
29
}
30
~OrgInfo
() {
31
freenull(source);
32
freenull(cultcoll);
33
freenull(formname);
34
freenull(nickname);
35
freenull(commname);
36
freenull(hostorg);
37
}
38
39
void
set_content_from
(
const
OrgInfo
& other) {
40
copy_content
(source, other.
source
);
41
copy_content
(cultcoll, other.
cultcoll
);
42
copy_content
(formname, other.
formname
);
43
copy_content
(nickname, other.
nickname
);
44
copy_content
(commname, other.
commname
);
45
copy_content
(hostorg, other.
hostorg
);
46
}
47
48
bool
exists
()
const
{
49
return
50
has_content
(source) ||
51
has_content
(cultcoll) ||
52
has_content
(formname) ||
53
has_content
(nickname) ||
54
has_content
(commname) ||
55
has_content
(hostorg);
56
}
57
};
58
59
struct
SeqInfo
:
virtual
Noncopyable
{
60
char
comp3
;
// yes or no, y/n
61
char
comp5
;
// yes or no, y/n
62
63
char
*
RDPid
;
64
char
*
gbkentry
;
65
char
*
methods
;
66
67
SeqInfo
() {
68
comp3 =
' '
;
69
comp5 =
' '
;
70
RDPid =
no_content
();
71
gbkentry =
no_content
();
72
methods =
no_content
();
73
}
74
~SeqInfo
() {
75
freenull(RDPid);
76
freenull(gbkentry);
77
freenull(methods);
78
}
79
void
set_content_from
(
const
SeqInfo
& other) {
80
comp3 = other.
comp3
;
81
comp5 = other.
comp5
;
82
copy_content
(RDPid, other.
RDPid
);
83
copy_content
(gbkentry, other.
gbkentry
);
84
copy_content
(methods, other.
methods
);
85
}
86
bool
exists
()
const
{
87
return
88
comp3 !=
' '
||
89
comp5 !=
' '
||
90
has_content
(RDPid) ||
91
has_content
(gbkentry) ||
92
has_content
(methods);
93
}
94
};
95
96
struct
RDP_comments
:
virtual
Noncopyable
{
97
OrgInfo
orginf
;
98
SeqInfo
seqinf
;
99
char
*
others
;
100
101
RDP_comments
() : others(
NULp
) {}
102
~RDP_comments
() { freenull(others); }
103
104
void
set_content_from
(
const
RDP_comments
& other) {
105
orginf.
set_content_from
(other.
orginf
);
106
seqinf.
set_content_from
(other.
seqinf
);
107
copy_content
(others, other.
others
);
108
}
109
bool
exists
()
const
{
return
orginf.
exists
() || seqinf.
exists
() ||
has_content
(others); }
110
};
111
112
#else
113
#error rdp_info.h included twice
114
#endif // RDP_INFO_H
OrgInfo::nickname
char * nickname
Definition:
rdp_info.h:18
OrgInfo::formname
char * formname
Definition:
rdp_info.h:17
fun.h
RDP_comments::others
char * others
Definition:
rdp_info.h:99
SeqInfo::gbkentry
char * gbkentry
Definition:
rdp_info.h:64
OrgInfo::commname
char * commname
Definition:
rdp_info.h:19
OrgInfo::source
char * source
Definition:
rdp_info.h:15
OrgInfo
Definition:
rdp_info.h:14
global.h
has_content
CONSTEXPR_INLINE bool has_content(const char *field)
Definition:
global.h:127
SeqInfo::comp5
char comp5
Definition:
rdp_info.h:61
copy_content
bool copy_content(char *&entry, const char *content)
Definition:
global.h:136
SeqInfo::~SeqInfo
~SeqInfo()
Definition:
rdp_info.h:74
RDP_comments::seqinf
SeqInfo seqinf
Definition:
rdp_info.h:98
SeqInfo::comp3
char comp3
Definition:
rdp_info.h:60
RDP_comments::exists
bool exists() const
Definition:
rdp_info.h:109
OrgInfo::set_content_from
void set_content_from(const OrgInfo &other)
Definition:
rdp_info.h:39
OrgInfo::~OrgInfo
~OrgInfo()
Definition:
rdp_info.h:30
SeqInfo
Definition:
rdp_info.h:59
RDP_comments::set_content_from
void set_content_from(const RDP_comments &other)
Definition:
rdp_info.h:104
RDP_comments::~RDP_comments
~RDP_comments()
Definition:
rdp_info.h:102
RDP_comments::orginf
OrgInfo orginf
Definition:
rdp_info.h:97
OrgInfo::hostorg
char * hostorg
Definition:
rdp_info.h:20
SeqInfo::RDPid
char * RDPid
Definition:
rdp_info.h:63
OrgInfo::OrgInfo
OrgInfo()
Definition:
rdp_info.h:22
OrgInfo::exists
bool exists() const
Definition:
rdp_info.h:48
NULp
#define NULp
Definition:
cxxforward.h:116
OrgInfo::cultcoll
char * cultcoll
Definition:
rdp_info.h:16
RDP_comments
Definition:
rdp_info.h:96
no_content
char * no_content()
Definition:
global.h:129
SeqInfo::methods
char * methods
Definition:
rdp_info.h:65
SeqInfo::exists
bool exists() const
Definition:
rdp_info.h:86
SeqInfo::SeqInfo
SeqInfo()
Definition:
rdp_info.h:67
SeqInfo::set_content_from
void set_content_from(const SeqInfo &other)
Definition:
rdp_info.h:79
RDP_comments::RDP_comments
RDP_comments()
Definition:
rdp_info.h:101
Noncopyable
Definition:
arbtools.h:39
Generated by
1.8.8