NCBI C++ ToolKit
Cit_book.cpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 /* $Id: Cit_book.cpp 49240 2011-04-08 18:57:08Z ucko $
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  * 'biblio.asn'.
35  */
36 
37 // standard includes
38 
39 // generated includes
40 #include <ncbi_pch.hpp>
42 
43 // generated classes
44 
46 
47 BEGIN_objects_SCOPE // namespace ncbi::objects::
48 
49 // destructor
51 {
52 }
53 
54 
56 {
57  return x_GetLabelV1(label, (flags & fLabel_Unique) != 0, &GetAuthors(),
58  &GetImp(), &GetTitle(), this, 0);
59 }
60 
61 
62 // Based on FormatCitJour from the C Toolkit's api/asn2gnb5.c.
64 {
65  const CImprint& imp = GetImp();
66 
68  string title = GetTitle().GetTitle();
69  *label += "(in) " + NStr::ToUpper(title) + '.';
70 
71  if (imp.CanGetPub()) {
72  *label += ' ';
73  imp.GetPub().GetLabel(label, flags, eLabel_V1); // sic
74  // "V1" taken over by MakeAffilStr translation
75  }
76 
77  string year = GetParenthesizedYear(imp.GetDate());
78  if ( !year.empty() ) {
79  *label += ' ' + year;
80  }
81 
82  if (imp.CanGetPrepub() && imp.GetPrepub() == CImprint::ePrepub_in_press) {
83  *label += ", In press";
84  }
85 
86  return true;
87 }
88 
89 END_objects_SCOPE // namespace ncbi::objects::
90 
92 
93 /* Original file checksum: lines: 61, chars: 1883, CRC32: a9269cf4 */
~CCit_book(void)
Definition: Cit_book.cpp:50
bool GetLabelV1(string *label, TLabelFlags flags) const override
Definition: Cit_book.cpp:55
bool GetLabelV2(string *label, TLabelFlags flags) const override
Definition: Cit_book.cpp:63
CImprint –.
Definition: Imprint.hpp:66
const string & GetTitle(C_E::E_Choice type=C_E::e_not_set) const
If the internal list contains a title (of the specified type, if given), returns the corresponding st...
Definition: Title.cpp:56
@ eLabel_V1
Traditional GetLabel semantics, modeled on the C Toolkit's PubLabelUnique.
int TLabelFlags
binary OR of ELabelFlags
@ fLabel_Unique
Append a unique tag [V1].
static string GetParenthesizedYear(const CDate &date)
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)
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 void MaybeAddSpace(string *label)
static uch flags
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
static string & ToUpper(string &str)
Convert string to upper case – string& version.
Definition: ncbistr.cpp:424
static const char label[]
const TTitle & GetTitle(void) const
Get the Title member data.
Definition: Cit_book_.hpp:296
const TAuthors & GetAuthors(void) const
Get the Authors member data.
Definition: Cit_book_.hpp:347
bool CanGetPrepub(void) const
Check if it is safe to call GetPrepub method.
Definition: Imprint_.hpp:1086
TPrepub GetPrepub(void) const
Get the Prepub member data.
Definition: Imprint_.hpp:1099
const TPub & GetPub(void) const
Get the Pub member data.
Definition: Imprint_.hpp:946
bool CanGetPub(void) const
Check if it is safe to call GetPub method.
Definition: Imprint_.hpp:940
const TDate & GetDate(void) const
Get the Date member data.
Definition: Imprint_.hpp:728
const TImp & GetImp(void) const
Get the Imp member data.
Definition: Cit_book_.hpp:377
@ ePrepub_in_press
accepted, not published
Definition: Imprint_.hpp:96
Modified on Fri May 24 14:56:55 2024 by modify_doxy.py rev. 669887