NCBI C++ ToolKit
Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | List of all members
ICitationBase Class Referenceabstract

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>

+ Inheritance diagram for ICitationBase:
+ Collaboration diagram for ICitationBase:

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...
 

Detailed Description

GetLabel interface for actual citation objects, as opposed to mere containers such as CPub.

Definition at line 97 of file citation_base.hpp.

Member Function Documentation

◆ FixPages()

string ICitationBase::FixPages ( const string orig_pages)
static

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().

◆ GetLabel() [1/2]

bool ICitationBase::GetLabel ( string label,
bool  unique 
) const
inline

Definition at line 103 of file citation_base.hpp.

References IAbstractCitation::fLabel_Unique, GetLabel(), and label.

◆ GetLabel() [2/2]

bool ICitationBase::GetLabel ( string label,
TLabelFlags  flags = 0,
ELabelVersion  version = eLabel_DefaultVersion 
) const
overridevirtual

◆ GetLabelV1()

virtual bool ICitationBase::GetLabelV1 ( string label,
TLabelFlags  flags 
) const
protectedpure virtual

◆ GetLabelV2()

virtual bool ICitationBase::GetLabelV2 ( string label,
TLabelFlags  flags 
) const
protectedpure virtual

◆ GetParenthesizedYear()

string ICitationBase::GetParenthesizedYear ( const CDate date)
static

◆ HasText() [1/2]

static bool ICitationBase::HasText ( const string s)
inlinestatic

◆ HasText() [2/2]

static bool ICitationBase::HasText ( const string s)
inlinestatic

Definition at line 120 of file citation_base.hpp.

References HasText(), and NULL.

Referenced by HasText().

◆ MaybeAddSpace()

void ICitationBase::MaybeAddSpace ( string label)
inlinestatic

◆ NoteSup()

void ICitationBase::NoteSup ( string label,
const CImprint imp 
)
static

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().

◆ SWNC()

static bool ICitationBase::SWNC ( const string str,
const string pfx 
)
inlinestatic

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().

◆ x_GetLabelV1()

bool ICitationBase::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 
)
staticprotected

The documentation for this class was generated from the following files:
Modified on Tue Apr 23 07:38:35 2024 by modify_doxy.py rev. 669887