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

Go to the SVN repository for this file.

1 /* $Id: Cit_let.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 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 GetCit().GetLabelV1(label, flags);
58  return GetCit().GetLabel(label, flags, eLabel_V1);
59 }
60 
61 
63 {
64  if ( !CanGetType() || GetType() != eType_thesis ) {
65  // return GetCit().GetLabel(label, flags, eLabel_V2);
66  return false;
67  }
68 
69  const CCit_book& cit = GetCit();
70  const CImprint& imp = cit.GetImp();
71 
73 
74  *label += "Thesis " + GetParenthesizedYear(imp.GetDate());
75 
76  if (imp.CanGetPub()) {
77  SIZE_TYPE pos = label->size();
78  *label += ' ';
79  if (imp.GetPub().GetLabel(label, flags, eLabel_V1)) { // sic
80  // "V1" taken over by MakeAffilStr translation
81  NStr::ReplaceInPlace(*label, "\"", "'", pos);
82  } else {
83  label->resize(pos);
84  }
85  }
86 
87  if (imp.CanGetPrepub() && imp.GetPrepub() == CImprint::ePrepub_in_press) {
88  *label += ", In press";
89  }
90 
91  return true;
92 }
93 
94 
95 END_objects_SCOPE // namespace ncbi::objects::
96 
98 
99 /* Original file checksum: lines: 64, chars: 1875, CRC32: a30ca943 */
bool GetLabelV2(string *label, TLabelFlags flags) const override
Definition: Cit_let.cpp:62
bool GetLabelV1(string *label, TLabelFlags flags) const override
Definition: Cit_let.cpp:55
~CCit_let(void)
Definition: Cit_let.cpp:50
CImprint –.
Definition: Imprint.hpp:66
@ eLabel_V1
Traditional GetLabel semantics, modeled on the C Toolkit's PubLabelUnique.
int TLabelFlags
binary OR of ELabelFlags
static string GetParenthesizedYear(const CDate &date)
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
NCBI_NS_STD::string::size_type SIZE_TYPE
Definition: ncbistr.hpp:132
static string & ReplaceInPlace(string &src, const string &search, const string &replace, SIZE_TYPE start_pos=0, SIZE_TYPE max_replace=0, SIZE_TYPE *num_replace=0)
Replace occurrences of a substring within a string.
Definition: ncbistr.cpp:3396
static const char label[]
const TCit & GetCit(void) const
Get the Cit member data.
Definition: Cit_let_.hpp:267
bool CanGetType(void) const
Check if it is safe to call GetType method.
Definition: Cit_let_.hpp:338
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
TType GetType(void) const
Get the Type member data.
Definition: Cit_let_.hpp:351
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 Wed Sep 04 15:03:04 2024 by modify_doxy.py rev. 669887