NCBI C++ ToolKit
|
Search Toolkit Book for ICitationBase
GetLabel interface for actual citation objects, as opposed to mere containers such as CPub. More...
#include <objects/biblio/citation_base.hpp>
Public Member Functions | |
bool | GetLabel (string *label, TLabelFlags flags=0, ELabelVersion version=eLabel_DefaultVersion) const override |
Append a label to the specified string per the specified flags. More... | |
bool | GetLabel (string *label, bool unique) const |
Public Member Functions inherited from IAbstractCitation | |
virtual | ~IAbstractCitation () |
Static Public Member Functions | |
static string | FixPages (const string &orig_pages) |
Canonicalize a range of page numbers, expanding Medline-style 125-35 -> 125-135, F124-34 -> F124-F134, and 12a-c -> 12a-12c, and returning a single number (without a dash) for a single page. More... | |
static string | GetParenthesizedYear (const CDate &date) |
static bool | HasText (const string &s) |
static bool | HasText (const string *s) |
static void | MaybeAddSpace (string *label) |
static void | NoteSup (string *label, const CImprint &imp) |
static bool | SWNC (const string &str, const string &pfx) |
Protected Member Functions | |
virtual bool | GetLabelV1 (string *label, TLabelFlags flags) const =0 |
virtual bool | GetLabelV2 (string *label, TLabelFlags flags) const =0 |
Static Protected Member Functions | |
static bool | x_GetLabelV1 (string *label, bool unique, const CAuth_list *authors, const CImprint *imprint, const CTitle *title, const CCit_book *book, const CCit_jour *journal, const string *title1=0, const string *title2=0, const string *titleunique=0, const string *date=0, const string *volume=0, const string *issue=0, const string *pages=0, bool unpublished=false) |
Additional Inherited Members | |
Public Types inherited from IAbstractCitation | |
enum | ELabelFlags { fLabel_Unique = 1 << 0 , fLabel_FlatNCBI = 1 << 1 , fLabel_FlatEMBL = 1 << 2 , fLabel_ISO_JTA = 1 << 3 , fLabel_NoBadCitGen = 1 << 4 , fLabel_NoUnpubAffil = 1 << 5 , fLabel_Consortia = 1 << 30 } |
Flags for use by GetLabel methods. More... | |
enum | ELabelVersion { eLabel_V1 = 1 , eLabel_V2 = 2 , eLabel_MinVersion = eLabel_V1 , eLabel_DefaultVersion = eLabel_V1 , eLabel_MaxVersion = eLabel_V2 } |
typedef int | TLabelFlags |
binary OR of ELabelFlags More... | |
GetLabel interface for actual citation objects, as opposed to mere containers such as CPub.
Definition at line 97 of file citation_base.hpp.
Canonicalize a range of page numbers, expanding Medline-style 125-35 -> 125-135, F124-34 -> F124-F134, and 12a-c -> 12a-12c, and returning a single number (without a dash) for a single page.
Return orig_pages as is, modulo whitespace trimming, if unable to parse as an ascending range in one of the above formats. (In particular, do not attempt to parse Roman numerals.)
Definition at line 67 of file citation_base.cpp.
References _ASSERT, NStr::EndsWith(), kEmptyStr, NPOS, result, CTempString::size(), CTempString::substr(), and NStr::TruncateSpaces_Unsafe().
Referenced by CCit_gen::GetLabelV2(), CCit_jour::GetLabelV2(), and CCit_art::x_GetLabelV2().
Definition at line 103 of file citation_base.hpp.
References IAbstractCitation::fLabel_Unique, GetLabel(), and label.
|
overridevirtual |
Append a label to the specified string per the specified flags.
Implements IAbstractCitation.
Definition at line 49 of file citation_base.cpp.
References _ASSERT, _TROUBLE, IAbstractCitation::eLabel_DefaultVersion, IAbstractCitation::eLabel_MaxVersion, IAbstractCitation::eLabel_V1, IAbstractCitation::eLabel_V2, ERR_POST, flags, GetLabelV1(), GetLabelV2(), label, NULL, version, and Warning().
Referenced by GetLabel(), CPub::GetLabel(), CCit_let::GetLabelV1(), CCit_proc::GetLabelV1(), CMedline_entry::GetLabelV1(), CCit_art::GetLabelV2(), CCit_book::GetLabelV2(), CCit_gen::GetLabelV2(), CCit_let::GetLabelV2(), CCit_pat::GetLabelV2(), CCit_proc::GetLabelV2(), CCit_sub::GetLabelV2(), CMedline_entry::GetLabelV2(), x_GetLabelV1(), and CCit_art::x_GetLabelV2().
|
protectedpure virtual |
Implemented in CMedline_entry, CId_pat, CCit_sub, CCit_proc, CCit_pat, CCit_let, CCit_jour, CCit_gen, CCit_book, CCit_art, CAuthor, CAuth_list, and CAffil.
Referenced by GetLabel().
|
protectedpure virtual |
Implemented in CMedline_entry, CId_pat, CCit_sub, CCit_proc, CCit_pat, CCit_let, CCit_jour, CCit_gen, CCit_book, CCit_art, CAuthor, CAuth_list, and CAffil.
Referenced by GetLabel().
Definition at line 155 of file citation_base.cpp.
References CDate::GetDate(), CDate_Base::GetStr(), HasText(), CDate_Base::IsStd(), CDate_Base::IsStr(), and kEmptyStr.
Referenced by CCit_book::GetLabelV2(), CCit_gen::GetLabelV2(), CCit_jour::GetLabelV2(), CCit_let::GetLabelV2(), and CCit_art::x_GetLabelV2().
Definition at line 118 of file citation_base.hpp.
References NPOS.
Referenced by CAffil::GetLabelV1(), CAffil::GetLabelV2(), CAuthor::GetLabelV2(), CCit_gen::GetLabelV2(), CCit_jour::GetLabelV2(), CCit_pat::GetLabelV2(), CCit_sub::GetLabelV2(), GetParenthesizedYear(), NoteSup(), CCit_pat::x_GetLabelV2(), CCit_art::x_GetLabelV2(), and CAuthor::x_GetLabelV2().
Definition at line 120 of file citation_base.hpp.
References HasText(), and NULL.
Referenced by HasText().
|
inlinestatic |
Definition at line 152 of file citation_base.hpp.
References _ASSERT, NStr::EndsWith(), label, and NULL.
Referenced by CCit_book::GetLabelV2(), CCit_gen::GetLabelV2(), CCit_jour::GetLabelV2(), CCit_let::GetLabelV2(), CCit_pat::GetLabelV2(), CCit_sub::GetLabelV2(), NoteSup(), x_GetLabelV1(), and CCit_art::x_GetLabelV2().
Definition at line 170 of file citation_base.cpp.
References _ASSERT, HasText(), ip, label, MaybeAddSpace(), and NULL.
Referenced by CCit_jour::GetLabelV2(), and CCit_art::x_GetLabelV2().
Definition at line 126 of file citation_base.hpp.
References NStr::eNocase, NStr::StartsWith(), and str().
Referenced by CCit_gen::GetLabelV2(), and CAuthor::x_GetLabelV2().
|
staticprotected |
Definition at line 196 of file citation_base.cpp.
References CTempString::assign(), cnt, IAbstractCitation::eLabel_V1, CTempString::find_first_not_of(), CTempString::find_first_of(), CDate::GetDate(), CImprint_Base::GetDate(), CImprint_Base::GetIssue(), GetLabel(), CImprint_Base::GetPages(), CImprint_Base::GetPart_sup(), CImprint_Base::GetPart_supi(), CTitle::GetTitle(), CImprint_Base::GetVolume(), CImprint_Base::IsSetIssue(), CImprint_Base::IsSetPages(), CImprint_Base::IsSetPart_sup(), CImprint_Base::IsSetPart_supi(), CImprint_Base::IsSetVolume(), label, MaybeAddSpace(), CTempString::npos, and CTempString::size().
Referenced by CCit_art::GetLabelV1(), CCit_book::GetLabelV1(), CCit_gen::GetLabelV1(), CCit_jour::GetLabelV1(), CCit_pat::GetLabelV1(), CCit_sub::GetLabelV1(), and CId_pat::GetLabelV1().