81 static const char* s_PubTypes[14] = {
103 int idx =
static_cast<int>(
Which());
104 idx = idx >= 0 && idx < 14 ? idx : 0;
108 *
label += s_PubTypes[idx];
199 "CPub::GetAuthors: unsupported entry type "
225 "CPub::SetAuthors: unsupported entry type "
232 size_t iMaxToGet )
const
236 if( iMaxToGet <= 0 ) {
248 if(
GetGen().IsSetTitle() ) {
255 if(
GetSub().IsSetDescr() ) {
299 size_t iMaxTitleSizeAllowed = ( out_title.size() + iMaxToGet );
300 if( iMaxTitleSizeAllowed < out_title.size() ) {
302 iMaxTitleSizeAllowed =
306 if( out_title.size() >= iMaxTitleSizeAllowed ) {
311 (*pub_it)->GetTitles(out_title,
312 (iMaxTitleSizeAllowed - out_title.size()) );
326 pRval->SetName( sTitle );
335 if( iMaxToGet <= 0 ) {
339 if( ! in_title.
IsSet() ) {
343 size_t iNumCopiedSoFar = 0;
344 CTitle::Tdata::const_iterator src_it = in_title.
Get().begin();
345 CTitle::Tdata::const_iterator src_it_end = in_title.
Get().end();
346 for( ; src_it != src_it_end && iNumCopiedSoFar < iMaxToGet;
347 ++src_it, ++iNumCopiedSoFar)
349 out_title.push_back( *src_it );
368 switch (title.
Which()) {
412 if ((*it)->Which() == title_type) {
418 if ((*it)->Which() == title_type) {
431 #define FIELD(Obj,Field) (Obj.IsSet##Field() ? Obj.Get##Field() : "")
432 #define FIELD_MATCH(Obj1,Obj2,Field) (NStr::EqualNocase(FIELD(Obj1,Field), FIELD(Obj2,Field)))
433 #define INT_FIELD_MATCH(Obj1,Obj2,Field) ((Obj1.IsSet##Field() && Obj2.IsSet##Field() && Obj1.Get##Field() == Obj2.Get##Field()) || (!Obj1.IsSet##Field() && !Obj2.IsSet##Field()))
435 #define S_MATCH(Obj1,Obj2,Field) ((!Obj1.IsSet##Field() && !Obj2.IsSet##Field()) || (Obj1.IsSet##Field() && Obj2.IsSet##Field() && s_Match##Field(Obj1.Get##Field(),Obj2.Get##Field())))
436 #define S_MATCH_A(Obj1,Obj2,Field) ((!Obj1.IsSet##Field() && !Obj2.IsSet##Field()) || (Obj1.IsSet##Field() && Obj2.IsSet##Field() && Obj1.Get##Field().SameCitation(Obj2.Get##Field())))
440 return date1.
Equals(date2);
480 bool match_title =
false;
493 if (!
S_MATCH(jour1, jour2, Title)) {
497 return S_MATCH(jour1, jour2, Imp);
507 if (!
S_MATCH(book1, book2, Imp)) {
523 return S_MATCH(book1, book2, Book);
635 if (!date1 && !date2) {
637 }
else if (!date1 || !date2) {
640 rval = date1->
Equals(*date2);
669 if (match1.
art && match2.
art) {
714 match.app_number =
"";
716 switch (pub.
Which()) {
User-defined methods of the data storage class.
User-defined methods of the data storage class.
bool s_TitleMatch(const CTitle &title1, const CTitle &title2, CTitle::C_E::E_Choice title_type)
#define S_MATCH_A(Obj1, Obj2, Field)
bool s_CitArtMatch(const CCit_art &art1, const CCit_art &art2)
bool s_ManMatch(const CCit_let &book1, const CCit_let &book2)
bool s_ProcMatch(const CCit_proc &book1, const CCit_proc &book2)
#define FIELD_MATCH(Obj1, Obj2, Field)
bool s_MatchImp(const CImprint &imp1, const CImprint &imp2)
bool s_MatchTitle(const CTitle &title1, const CTitle &title2)
bool s_JournalMatch(const CCit_jour &jour1, const CCit_jour &jour2)
bool s_MatchBook(const CCit_book &book1, const CCit_book &book2)
bool s_MatchDate(const CDate &date1, const CDate &date2)
static const CTitle::C_E::E_Choice s_MatchJournalTypes[]
string s_GetTitleString(const CTitle::C_E &title)
void s_GetPubMatchInfo(const CCit_pat &patent, SPubMatchInfo &match)
#define INT_FIELD_MATCH(Obj1, Obj2, Field)
bool s_CitGenMatch(const CCit_gen &gen1, const CCit_gen &gen2)
bool s_MatchInfoMatches(const SPubMatchInfo &match1, const SPubMatchInfo &match2)
#define S_MATCH(Obj1, Obj2, Field)
bool s_CitSubMatch(const CCit_sub &sub1, const CCit_sub &sub2)
@Auth_list.hpp User-defined methods of the data storage class.
bool SameCitation(const CPub_equiv &other) const
bool GetLabel(string *label, TLabelFlags flags=0, ELabelVersion version=eLabel_DefaultVersion) const override
Append a label to "label" based on content.
static void xs_AppendTitles(TOneTitleRefVec &out_title, size_t iMaxToGet, const CTitle &in_title)
vector< TOneTitleRef > TOneTitleRefVec
bool GetLabel(string *label, ELabelType type=eContent, TLabelFlags flags=0, ELabelVersion version=eLabel_DefaultVersion) const
Concatenate a label for this pub to label.
const CAuth_list & GetAuthors(void) const
CAuth_list & SetAuthors(void)
static TOneTitleRef xs_GetTitleFromPlainString(const string &sTitle)
bool SameCitation(const CPub &other) const
void GetTitles(TOneTitleRefVec &out_title, size_t iMaxToGet=std::numeric_limits< std::size_t >::max()) const
This gets the titles on the CPub.
bool IsSetAuthors(void) const
Root class for all serialization exceptions.
int TLabelFlags
binary OR of ELabelFlags
bool GetLabel(string *label, TLabelFlags flags=0, ELabelVersion version=eLabel_DefaultVersion) const override
Append a label to the specified string per the specified flags.
static const char * str(char *buf, int n)
SStrictId_Entrez::TId TEntrezId
TEntrezId type for entrez ids which require the same strictness as TGi.
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
virtual bool Equals(const CSerialObject &object, ESerialRecursionMode how=eRecursive) const
Check if both objects contain the same values.
NCBI_XOBJUTIL_EXPORT string GetTitle(const CBioseq_Handle &hnd, TGetTitleFlags flags=0)
void Reset(void)
Reset reference object.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
static bool IsBlank(const CTempString str, SIZE_TYPE pos=0)
Check if a string is blank (has no text).
static bool EqualNocase(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2)
Case-insensitive equality of a substring with another string.
static enable_if< is_arithmetic< TNumeric >::value||is_convertible< TNumeric, Int8 >::value, string >::type NumericToString(TNumeric value, TNumToStringFlags flags=0, int base=10)
Convert numeric value to string.
static const char label[]
bool IsProc(void) const
Check if variant Proc is selected.
const TTitle & GetTitle(void) const
Get the Title member data.
const TDate & GetDate(void) const
Get the Date member data.
const TCit & GetCit(void) const
Get the Cit member data.
bool IsSetNumber(void) const
Patent Document Number Check if a value has been assigned to Number data member.
const TCprt & GetCprt(void) const
Get the Cprt member data.
const TJournal & GetJournal(void) const
Get the variant data.
const TFrom & GetFrom(void) const
Get the From member data.
bool IsApp_number(void) const
Check if variant App_number is selected.
bool IsSetTitle(void) const
Title of book Check if a value has been assigned to Title data member.
bool IsNumber(void) const
Check if variant Number is selected.
bool IsSetCountry(void) const
Patent Document Country Check if a value has been assigned to Country data member.
const TMl_jta & GetMl_jta(void) const
Get the variant data.
const TIssn & GetIssn(void) const
Get the variant data.
bool IsSetTitle(void) const
title of paper (ANSI requires) Check if a value has been assigned to Title data member.
const TTitle & GetTitle(void) const
Get the Title member data.
E_Choice Which(void) const
Which variant is currently selected.
bool IsSetFrom(void) const
Check if a value has been assigned to From data member.
const TProc & GetProc(void) const
Get the variant data.
E_Choice Which(void) const
Which variant is currently selected.
list< CRef< C_E > > Tdata
bool IsSetId(void) const
Check if a value has been assigned to Id data member.
const TCoden & GetCoden(void) const
Get the variant data.
const TName & GetName(void) const
Get the variant data.
bool IsSetDate(void) const
replaces imp, will become required Check if a value has been assigned to Date data member.
const TIso_jta & GetIso_jta(void) const
Get the variant data.
const TJournal & GetJournal(void) const
Get the Journal member data.
const TJta & GetJta(void) const
Get the variant data.
bool IsSetJournal(void) const
Check if a value has been assigned to Journal data member.
const TId & GetId(void) const
Get the Id member data.
const TNumber & GetNumber(void) const
Get the Number member data.
const TAbr & GetAbr(void) const
Get the variant data.
bool IsSetDate(void) const
date of publication Check if a value has been assigned to Date data member.
const TIsbn & GetIsbn(void) const
Get the variant data.
const TImp & GetImp(void) const
Get the Imp member data.
bool IsSet(void) const
Check if a value has been assigned to data member.
bool IsBook(void) const
Check if variant Book is selected.
const TTsub & GetTsub(void) const
Get the variant data.
bool IsJournal(void) const
Check if variant Journal is selected.
bool IsSetCit(void) const
same fields as a book Check if a value has been assigned to Cit data member.
bool IsSetImp(void) const
this only used to get date.
const TDate & GetDate(void) const
Get the Date member data.
bool IsSetApp_number(void) const
Patent Doc Appl Number Check if a value has been assigned to App_number data member.
bool IsSetCprt(void) const
copyright date, " " " Check if a value has been assigned to Cprt data member.
const TApp_number & GetApp_number(void) const
Get the App_number member data.
const TNumber & GetNumber(void) const
Get the variant data.
const TApp_number & GetApp_number(void) const
Get the variant data.
const TTrans & GetTrans(void) const
Get the variant data.
const Tdata & Get(void) const
Get the member data.
const TCountry & GetCountry(void) const
Get the Country member data.
const TCountry & GetCountry(void) const
Get the Country member data.
const TBook & GetBook(void) const
Get the variant data.
bool IsSetCountry(void) const
Patent Document Country Check if a value has been assigned to Country data member.
@ e_Ml_jta
specifically MEDLINE jta J
@ e_Trans
Title, Translated AJB.
@ e_Abr
Title, Abbreviated B.
@ e_Jta
Title, Abbreviated J.
@ e_Tsub
Title, Subordinate A B.
@ e_not_set
No variant selected.
@ e_Iso_jta
specifically ISO jta J
@ e_Name
Title, Anal,Coll,Mono AJB.
TProc & SetProc(void)
Select the variant.
const TMedline & GetMedline(void) const
Get the variant data.
const TMan & GetMan(void) const
Get the variant data.
static string SelectionName(E_Choice index)
Retrieve selection name (for diagnostic purposes).
TBook & SetBook(void)
Select the variant.
const TPmid & GetPmid(void) const
Get the variant data.
const TArticle & GetArticle(void) const
Get the variant data.
const TJournal & GetJournal(void) const
Get the variant data.
const TSub & GetSub(void) const
Get the variant data.
const TPatent & GetPatent(void) const
Get the variant data.
const TProc & GetProc(void) const
Get the variant data.
const TEquiv & GetEquiv(void) const
Get the variant data.
E_Choice Which(void) const
Which variant is currently selected.
const TPat_id & GetPat_id(void) const
Get the variant data.
TMan & SetMan(void)
Select the variant.
TSub & SetSub(void)
Select the variant.
TGen & SetGen(void)
Select the variant.
TMedline & SetMedline(void)
Select the variant.
const TGen & GetGen(void) const
Get the variant data.
TMuid GetMuid(void) const
Get the variant data.
TPatent & SetPatent(void)
Select the variant.
TArticle & SetArticle(void)
Select the variant.
const TBook & GetBook(void) const
Get the variant data.
@ e_Pat_id
identify a patent
@ e_Gen
general or generic unparsed
@ e_not_set
No variant selected.
@ e_Proc
proceedings of a meeting
@ e_Equiv
to cite a variety of ways
@ e_Man
manuscript, thesis, or letter
const TYPE & Get(const CNamedParameterList *param)
const string version
version string
static PyObject * Date(PyObject *self, PyObject *args)
static int match(PCRE2_SPTR start_eptr, PCRE2_SPTR start_ecode, uint16_t top_bracket, PCRE2_SIZE frame_size, pcre2_match_data *match_data, match_block *mb)
Utility macros and typedefs for exploring NCBI objects from pub.asn.
#define FOR_EACH_PUB_ON_PUBEQUIV(Itr, Var)
#define FIELD_CHAIN_OF_2_IS_SET(Var, Fld1, Fld2)
FIELD_CHAIN_OF_2_IS_SET.