1 /* $Id: Pub.hpp 547997 2017-10-06 19:29:35Z kachalos $
2 * ===========================================================================
3 *
4 * PUBLIC DOMAIN NOTICE
5 * National Center for Biotechnology Information
6 *
7 * This software/database is a "United States Government Work" under the
8 * terms of the United States Copyright Act. It was written as part of
9 * the author's official duties as a United States Government employee and
10 * thus cannot be copyrighted. This software/database is freely available
11 * to the public for use. The National Library of Medicine and the U.S.
12 * Government have not placed any restriction on its use or reproduction.
13 *
14 * Although all reasonable efforts have been taken to ensure the accuracy
15 * and reliability of the software and data, the NLM and the U.S.
16 * Government do not and cannot warrant the performance or results that
17 * may be obtained by using this software or data. The NLM and the U.S.
18 * Government disclaim all warranties, express or implied, including
19 * warranties of performance, merchantability or fitness for any particular
20 * purpose.
21 *
22 * Please cite the author in any work or product based on this material.
23 *
24 * ===========================================================================
25 *
26 * Author: .......
27 *
28 * File Description:
29 * .......
30 *
31 * Remark:
32 * This code was originally generated by application DATATOOL
33 * using specifications from the ASN data definition file
34 * 'pub.asn'.
35 */
36
37 #ifndef OBJECTS_PUB_PUB_HPP
38 #define OBJECTS_PUB_PUB_HPP
39
40
41 // generated includes
42 #include <objects/pub/Pub_.hpp>
43
44 #include <objects/biblio/citation_base.hpp>
45 #include <objects/biblio/Title.hpp>
46
47 // generated classes
48
49 BEGIN_NCBI_SCOPE
50
51 BEGIN_objects_SCOPE // namespace ncbi::objects::
52
53 class CAuth_list;
54
55 class NCBI_PUB_EXPORT CPub : public CPub_Base, public IAbstractCitation
56 {
57 typedef CPub_Base Tparent;
58 public:
59 // constructor
60 CPub(void);
61 // destructor
62 ~CPub(void);
63
64 enum ELabelType {
65 eType,
66 eContent,
67 eBoth};
68
69 /// Concatenate a label for this pub to label. If flags contains
70 /// fCitLabel_Unique, add a unique tag to the end of the
71 /// concatenated label.
72 bool GetLabel(string* label,
73 ELabelType type = eContent,
74 TLabelFlags flags = 0,
75 ELabelVersion version = eLabel_DefaultVersion) const;
76
77 bool GetLabel(string* label,
78 ELabelType type,
79 bool unique = false) const;
80
81 bool GetLabel(string* label, TLabelFlags flags = 0,
82 ELabelVersion version = eLabel_DefaultVersion) const;
83
84 // convenience functions to get author list from underlying pub
85 bool IsSetAuthors(void) const;
86 const CAuth_list& GetAuthors(void) const;
87 CAuth_list& SetAuthors(void);
88
89 typedef CConstRef<CTitle::C_E> TOneTitleRef;
90 typedef vector<TOneTitleRef> TOneTitleRefVec;
91
92 /// This gets the titles on the CPub.
93 /// @param out_titles
94 /// Each title found will be appended to this.
95 /// Titles of plain strings will be given as
96 /// type CTitle::C_E::e_Name, and complex titles will be
97 /// a const reference to the title inside the CPub, so they
98 /// might change if the CPub is changed.
99 /// @param iMaxToGet
100 /// The maximum number of titles to append to out_title
101 void GetTitles(
102 TOneTitleRefVec & out_title,
103 size_t iMaxToGet = std::numeric_limits<std::size_t>::max() ) const;
104
105 bool SameCitation(const CPub& other) const;
106
107 protected:
108
109 private:
110 // Prohibit copy constructor and assignment operator
111 CPub(const CPub& value);
112 CPub& operator=(const CPub& value);
113
114 static TOneTitleRef xs_GetTitleFromPlainString(const string & sTitle);
115
116 // append CTitle::C_E objects from in_title to out_title,
117 // (Don't append more than iMaxToGet objects)
118 static void xs_AppendTitles( TOneTitleRefVec & out_title,
119 size_t iMaxToGet,
120 const CTitle & in_title );
121
122 };
123
124
125
126 /////////////////// CPub inline methods
127
128 // constructor
129 inline
CPub(void)130 CPub::CPub(void)
131 {
132 }
133
134 inline
GetLabel(string * label,ELabelType type,bool unique) const135 bool CPub::GetLabel(string* label, ELabelType type, bool unique) const
136 {
137 return GetLabel(label, type, unique ? fLabel_Unique : 0);
138 }
139
140 inline
GetLabel(string * label,TLabelFlags flags,ELabelVersion version) const141 bool CPub::GetLabel(string* label, TLabelFlags flags, ELabelVersion version)
142 const
143 {
144 return GetLabel(label, eContent, flags, version);
145 }
146
147
148 /////////////////// end of CPub inline methods
149
150
151 END_objects_SCOPE // namespace ncbi::objects::
152
153 END_NCBI_SCOPE
154
155
156 #endif // OBJECTS_PUB_PUB_HPP
157 /* Original file checksum: lines: 90, chars: 2283, CRC32: 573f38c8 */
158