A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://www.ncbi.nlm.nih.gov/IEB/ToolBox/CPP_DOC/doxyhtml/macro__fn__pubfields_8cpp_source.html below:

NCBI C++ ToolKit: src/gui/objutils/macro_fn_pubfields.cpp Source File

106  auto

it = find_if(pub_fncs.begin(), pub_fncs.end(),

107

[&fn_name](

const auto

& elem) { return NStr::EqualNocase(fn_name, elem); });

108  return

(it != pub_fncs.end());

114  const CPubdesc

* const_pubdesc =

dynamic_cast<const CPubdesc

*

>

(

object

.GetPointer());

125  else if

(const_block) {

132  if

(res_oi.empty()) {

134

vector<string> statuses;

142

statuses.push_back(status);

154  if

(res_oi.empty()) {

172  while

(elem.

Valid

()) {

178  else if

(const_block) {

193  for

(

auto

&& it : res_oi) {

195  while

(elem.

Valid

()) {

216

objs_to.push_back(*it);

238  switch

(pub.

Which

()) {

287  switch

(pub.

Which

()) {

305  switch

(pub.

Which

()) {

364  else if

(pub.

IsMan

()) {

378  switch

(pub.

Which

()) {

412

field_name.assign(

"volume"

);

415

field_name.assign(

"issue"

);

418

field_name.assign(

"pages"

);

427  switch

(pub.

Which

()) {

458  switch

(pub.

Which

()) {

474  if

(

GetFieldsByName

(&res, oi,

"authors.affil"

) && res.size() == 1) {

494  switch

(pub.

Which

()) {

510  if

(

GetFieldsByName

(&res, oi,

"authors.names"

) && res.size() == 1) {

560  for

(

auto

&& it: pdesc.

GetPub

().

Get

()) {

582  switch

(pub.

Which

()) {

603  if

(imp->IsSetPrepub()) {

677  string

var_name =

names

.GetCurrentChoiceVariant().GetVariantInfo()->GetId().GetName();

678  switch

(

names

.GetCurrentChoiceVariantIndex()) {

683  if

(field_name.empty()) {

707  if

(

names

.GetCurrentChoiceVariantIndex() == 1) {

711  while

(elem.

Valid

()) {

720

}

else if

(

names

.GetCurrentChoiceVariantIndex() == 3) {

724  while

(elem.

Valid

()) {

743  while

(elem.

Valid

()) {

861  if

(

GetFieldsByName

(&res, sub_oi,

"authors.affil"

) && res.size() == 1) {

873  if

(

GetFieldsByName

(&res, sub_oi,

"authors.names"

) && res.size() == 1) {

904  const string

& author_field =

m_Args

[0]->GetString();

934

new_desc->

SetPub

().

SetPub

().Set().push_back(new_pub);

945  cmd

->AddCommand(*create_cmd);

949  log

<<

m_DataIter

->GetBestDescr() <<

": added new publication"

;

986  for

(; iter != sm_AuthorFixMap.end(); ++iter){

987  if

(iter->second == fix_type){

997  if

(iter != sm_AuthorFixMap.end()){

1006  const CPubdesc

* const_pubdesc =

dynamic_cast<const CPubdesc

*

>

(

object

.GetPointer());

1010  if

(const_pubdesc) {

1017  switch

(pub.

Which

()) {

1052  else if

(const_block) {

1077  if

(!

names

.IsStd())

1131

vector<string>

names

;

1133  if

(!first_name.empty()) {

1134

vector<string>::iterator it =

names

.begin();

1135  while

(it !=

names

.end()) {

1136  if

((!first_name_initial.empty() &&

NStr::EqualCase

(*it, first_name_initial)) ||

1137

it->length() <= 2) {

1138

it =

names

.erase(it);

1146  for

(

auto

& it :

names

) {

1147  if

(!first_name.empty()) {

1154  if

(first_name.empty() ||

1174  string

new_middle_init;

1178  string

middle_init = original_init.substr(first_init.length());

1179  if

(!middle_init.empty()) {

1188  if

(!new_middle_init.empty()) {

1209

middle_init = original_init.substr(first_init.length());

1210  if

(!middle_init.empty()) {

1219  string

new_initials = first_init + middle_init;

1242

string::const_iterator p =

orig

.begin();

1243  while

(p !=

orig

.end()) {

1244

string::const_iterator q = p;

1247

inits.append(

buf

);

1249

inits.append(

"."

);

1264

string::const_iterator p = first_name.begin();

1265  while

(p != first_name.end()) {

1267  while

(p != first_name.end() && (*p <=

' '

|| *p ==

'-'

)) {

1270  if

(p != first_name.end() &&

isalpha

(*p)) {

1272

inits.append(

buf

);

1276  while

(p != first_name.end() && *p >

' '

&& *p !=

'-'

) {

1279  if

(p != first_name.end() && *p ==

'-'

) {

1281

inits.append(

buf

);

1290  bool

modified =

false

;

1299  string

middle_init = initials;

1301

middle_init = middle_init.substr(first_init.length());

1313  const string

& lastname,

const string

& suffix,

CName_std

& name)

1337  string

inits = macro::CMacroFunction_AuthorFix::s_GetFirstNameInitials(name.

GetFirst

());

1339

inits.append(mid_initials);

1343

inits.append(

"."

);

1373  if

(!const_pubdesc) {

1387  for

(

auto

&& it : pubdesc->

SetPub

().Set()) {

1389

&& it->GetArticle().IsSetFrom()

1390

&& it->GetArticle().GetFrom().IsJournal()) {

1399  string msg

=

"ISOJTA lookup, updated: "

;

1401  msg

+=

"'"

+ it.first +

"' to '"

+ it.second +

"'\n"

;

1408  for

(

const auto

& it :

m_Hits

) {

1409  if

(it.second.empty()) {

1410  msg

+=

"ISOJTA Lookup:\nNo ISOJTA title was found for '"

+ it.first +

"'\n"

;

1413  msg

+=

"ISOJTA Lookup:\nMultiple titles were found for '"

+ it.first +

"':\n"

;

1414  for

(

const auto

& title_it : it.second) {

1415  msg

+= title_it +

"\n"

;

1419  if

(!

msg

.empty()) {

1434  if

(titles.size() == 1) {

1436  if

(old_title != titles[0]) {

1437  for

(

auto

& it : title.

Set

()) {

1438  if

(it->IsIso_jta()) {

1439

it->SetIso_jta(titles[0]);

1447  if

(find(titles.begin(), titles.end(), old_title) == titles.end()) {

1448  m_Hits

.emplace(old_title, titles);

1454  for

(

auto

& title_it : title.

Set

()) {

1455  if

(title_it->IsJta() || title_it->IsName()) {

1459  if

(titles.size() == 1) {

1460

title_it->SetIso_jta(titles[0]);

1465  m_Hits

.emplace(old_title, titles);

1474  if

(title.

IsSet

()) {

1475  for

(

const auto

& title_it : title.

Get

()) {

1476  if

(title_it->IsIso_jta()) {

1486  if

(title.

IsSet

()) {

1487  for

(

const auto

& title_it : title.

Get

()) {

1488  if

(title_it->IsIso_jta()) {

1489  return

title_it->GetIso_jta();

1498

vector<string> titles;

1500  if

(

auto

& isojta_updater =

m_DataIter

->ISOJTAUpdater(); isojta_updater) {

1501

isojta_updater->GetJournalAbbr(title, titles);

1509  auto

& isojta_map = pubdesc_iter->SetISOJTALookupMap();

1510  if

(

auto

it = isojta_map.find(title); it != isojta_map.end()) {

1511

titles = it->second;

1515

isojta_map[title] = titles;

1523  return

(

m_Args

.empty());

1529  void

GenerateFirstName(

CAuthor

& author)

1532  auto

& std_name = author.

SetName

().SetName();

1541

list<CRef<CAuthor>> standard_names;

1547

GenerateFirstName(*new_auth);

1549

standard_names.push_back(new_auth);

1553

auth_list.

SetNames

().SetStd().insert(auth_list.

SetNames

().SetStd().begin(), standard_names.begin(), standard_names.end());

1556  void

ConvertToStandardAuthors(

CAuth_list

& auth_list)

1563

FixMedLineList(auth_list);

1568  if

((*it)->GetName().IsMl()) {

1571

GenerateFirstName(*new_auth);

1573

(*it)->Assign(*new_auth);

1578

affil->Assign(auth_list.

GetNames

().

GetStd

().front()->GetAffil());

1584  void

AdjustAuthors(

CPubdesc

& pubdesc)

1586  for

(

auto

& pub_it : pubdesc.

SetPub

().Set()) {

1587  if

(pub_it->IsSetAuthors()) {

1588  auto

& auth_list = pub_it->SetAuthors();

1590  for

(

auto

& it : auth_list.

SetNames

().SetStd()) {

1591

GenerateFirstName(*it);

1595

affil->Assign(auth_list.

GetNames

().

GetStd

().front()->GetAffil());

1613  if

(!const_pubdesc) {

1624  if

(

auto

& remote_updater =

m_DataIter

->RemoteUpdater(); remote_updater) {

1626

orig_pubdesc.

Assign

(*pubdesc);

1630

remote_updater->UpdatePubReferences(desc);

1631

AdjustAuthors(*pubdesc);

1633  if

(!pubdesc->

Equals

(orig_pubdesc)) {

1644  for

(

auto

&& it : pubdesc->

SetPub

().Set()) {

1650  if

(it !=

map

.

end

()) {

1651

looked_up_pub = it->second;

1655  if

(looked_up_pub) {

1656  map

.emplace(pmid, looked_up_pub);

1660  if

(looked_up_pub) {

1664

pubdesc->

SetPub

().Set().push_back(pmid_pub);

1665

pubdesc->

SetPub

().Set().push_back(looked_up_pub);

1685  return

(

m_Args

.empty());

1698

vector<TEntrezId> uids;

1699

uids.push_back(

id

);

1704

ecli.

Fetch

(

"pubmed"

, uids, asnPubMedEntry,

"asn.1"

);

1708  LOG_POST

(

Error

<<

"CMacroFunction_LookupPub::s_GetArticleFromEntrezById(): error fetching ID "

<<

id

<<

": "

<< e.

GetMsg

());

1711  if

(pubmed_entry->IsSetMedent() && pubmed_entry->GetMedent().IsSetCit()) {

1721

edit::CEUtilsUpdater updater;

1723

pub = updater.GetPub(

id

, &

error

);

1726

ConvertToStandardAuthors(pub->

SetAuthors

());

1732  const string

err_msg = oss.str();

1733  LOG_POST

(

Error

<<

"CMacroFunction_LookupPub::s_GetArticleFromEntrezById(): error fetching ID "

<<

id

<<

": "

<< err_msg);

1746

void CMacroFunction_DOILookup::TheFunction()

1750  if

(!const_pubdesc) {

1760  const string

& new_doi = m_Args[0]->GetString();

1761  if

(new_doi.empty())

1765  bool

modify =

false

;

1766  for

(

const auto

& it : pubdesc->

GetPub

().

Get

()) {

1768  const CCit_gen

& genref = it->GetGen();

1778  if

(m_DataIter->IsHugeDataMode()) {

1779  if

(

auto

& doi_updater = m_DataIter->DOIUpdater(); doi_updater) {

1780

pair<CRef<CPubdesc>,

string

> new_pubdesc_str = doi_updater->GetPub(new_doi);

1781  if

(new_pubdesc_str.first) {

1783

pubdesc->

Assign

(*new_pubdesc_str.first);

1784

m_QualsChangedCount++;

1788  log

<<

"Problem resolving DOI '"

<< new_doi <<

": "

<< new_pubdesc_str.second;

1799  auto

it =

map

.

find

(new_doi);

1800  if

(it !=

map

.

end

()) {

1801

looked_up_pubdesc = it->second;

1805

looked_up_pubdesc = new_pubdesc_str.first;

1806  if

(looked_up_pubdesc) {

1807  map

.emplace(new_doi, looked_up_pubdesc);

1811  log

<<

"Problem resolving DOI '"

<< new_doi <<

": "

<< new_pubdesc_str.second;

1816  if

(looked_up_pubdesc) {

1818

pubdesc->

Assign

(*looked_up_pubdesc);

1820

m_QualsChangedCount++;

1824  if

(m_QualsChangedCount) {

1825

m_DataIter->SetModified();

1827

report[

"doi lookup"

] = m_QualsChangedCount;

1829

x_LogChangedQuals(fnc_log);

1833 bool

CMacroFunction_DOILookup::x_ValidArguments()

const 1835  return

(m_Args.size() == 1) && (m_Args[0]->IsString());

1842  for

(

const auto

& it : pubdesc.

GetPub

().

Get

()) {

1843  if

(it->IsGen() && it->GetGen().IsSetCit()) {

1844  const string

& citation = it->GetGen().GetCit();

1863  for

(

const auto

& it : pubdesc.

GetPub

().

Get

()) {

1864  if

(it->IsArticle() && it->GetArticle().IsSetIds()) {

1865  for

(

const auto

&

id

: it->GetArticle().GetIds().Get()) {

1867

doi =

id

->GetDoi();

1890

m_getDoi = make_unique<CGetDOIFromCitGen>();

1897  if

(!const_pubdesc) {

1907  string

doi_name =

m_getDoi

->GetDOI(*pubdesc);

1908  if

(doi_name.empty())

1912  if

(

auto

& doi_updater =

m_DataIter

->DOIUpdater(); doi_updater) {

1913

pair<CRef<CPubdesc>,

string

> new_pubdesc_str = doi_updater->GetPub(doi_name);

1914  if

(new_pubdesc_str.first) {

1916

pubdesc->

Assign

(*new_pubdesc_str.first);

1921  log

<<

"Problem resolving DOI '"

<< doi_name <<

": "

<< new_pubdesc_str.second;

1933  auto

it =

map

.

find

(doi_name);

1934  if

(it !=

map

.

end

()) {

1935

looked_up_pubdesc = it->second;

1939

looked_up_pubdesc = new_pubdesc_str.first;

1940  if

(looked_up_pubdesc) {

1941  map

.emplace(doi_name, looked_up_pubdesc);

1945  log

<<

"Problem resolving DOI '"

<< doi_name <<

"': "

<< new_pubdesc_str.second;

1950  if

(looked_up_pubdesc) {

1952

pubdesc->

Assign

(*looked_up_pubdesc);

1969  return

(

m_Args

.empty());

1981

m_getDoi = make_unique<CGetDOIFromCitArt>();

1993  const CPubdesc

* const_pubdesc =

dynamic_cast<const CPubdesc

*

>

(

object

.GetPointer());

1995  if

(!const_pubdesc && !const_block)

2000

x_GetObjectsFromRef(res_oi, 0);

2003  const string

& newValue = m_Args[index]->GetString();

2004  const string

& action_type = m_Args[++index]->GetString();

2006  bool

remove_field =

false

;

2007

x_GetOptionalArgs(

delimiter

, remove_field, index);

2010  if

(!newValue.empty()) {

2011  if

(res_oi.empty()) {

2013  if

(const_pubdesc) {

2015

x_SetTitleInPubdesc(*pubdesc, newValue);

2017  else if

(const_block) {

2019

x_SetTitleInSubmitBlock(*submit_block, newValue);

2029

SetQualStringValue(obj, orig_value);

2036  if

(m_QualsChangedCount) {

2037

m_DataIter->SetModified();

2039  log

<< m_DataIter->GetBestDescr() <<

": set "

<< m_QualsChangedCount <<

" publication title"

;

2040

x_LogFunction(

log

);

2043  else if

(remove_field) {

2045  if

(m_QualsChangedCount) {

2046

m_DataIter->SetModified();

2048  log

<< m_DataIter->GetBestDescr() <<

": removed "

<< m_QualsChangedCount <<

" publication title"

;

2049

x_LogFunction(

log

);

2056  auto

arg_nr =

m_Args

.size();

2057  if

(arg_nr > 5 || arg_nr < 3) {

2061  if

(!

m_Args

[index]->IsRef()) {

2065  bool

second_ok =

m_Args

[index]->IsString() ||

m_Args

[index]->IsInt() ||

m_Args

[index]->IsDouble();

2066  if

(!second_ok)

return false

;

2068  if

(!

m_Args

[++index]->IsString())

return false

;

2069  if

(arg_nr > 3 && (!

m_Args

[++index]->IsString() && !

m_Args

[index]->IsBool()))

return false

;

2070  if

(arg_nr > 4 && !

m_Args

[++index]->IsBool())

return false

;

2077

title->SetName(

value

);

2078  for

(

auto

& it : pubdesc.

SetPub

().Set()) {

2079  switch

(it->Which())

2082

it->SetGen().SetTitle(

value

);

2086

it->SetSub().SetDescr(

value

);

2090

it->SetArticle().SetTitle().Set().push_back(title);

2094

it->SetBook().SetTitle().Set().push_back(title);

2098

it->SetProc().SetBook().SetTitle().Set().push_back(title);

2102

it->SetPatent().SetTitle(

value

);

2106

it->SetMan().SetCit().SetTitle().Set().push_back(title);

2138  const CPubdesc

* const_pubdesc =

dynamic_cast<const CPubdesc

*

>

(

object

.GetPointer());

2140  if

(!const_pubdesc && !const_block)

2144  const string

& field = m_Args[index]->GetString();

2146  const string

& action_type = m_Args[++index]->GetString();

2148  bool

remove_field =

false

;

2149

x_GetOptionalArgs(

delimiter

, remove_field, index);

2153  if

(!newValue.empty()) {

2155  if

(const_pubdesc) {

2157  for

(

auto

& it : pubdesc->

SetPub

().Set()) {

2158  if

(it->IsSetAuthors()) {

2159

x_SetAffilField(it->SetAuthors(), field, newValue, existing_text);

2164  else if

(const_block) {

2166  if

(submit_block->

IsSetCit

() && submit_block->

SetCit

().IsSetAuthors()) {

2167

x_SetAffilField(submit_block->

SetCit

().SetAuthors(), field, newValue, existing_text);

2171  if

(m_QualsChangedCount) {

2172  log

<< m_DataIter->GetBestDescr() <<

": set "

;

2175  else if

(remove_field) {

2177  if

(const_pubdesc) {

2179  for

(

auto

& it : pubdesc->

SetPub

().Set()) {

2180  if

(it->IsSetAuthors()) {

2181

x_RemoveAffilField(it->SetAuthors(), field);

2186  if

(m_QualsChangedCount) {

2187  log

<< m_DataIter->GetBestDescr() <<

": removed "

;

2191  if

(m_QualsChangedCount) {

2192

m_DataIter->SetModified();

2193  log

<< m_QualsChangedCount <<

" publication "

;

2194  if

(field ==

"affil"

) {

2195  log

<<

"institution"

;

2197  else if

(field ==

"div"

) {

2198  log

<<

"department"

;

2200  else if

(field ==

"sub"

) {

2206

x_LogFunction(

log

);

2212  auto

arg_nr =

m_Args

.size();

2213  if

(arg_nr < 3 || arg_nr > 5) {

2218  if

(!

m_Args

[index]->IsString())

return false

;

2220  if

(!

m_Args

[index]->IsString() && !

m_Args

[index]->IsInt()) {

2223  if

(!

m_Args

[++index]->IsString())

return false

;

2224  if

(arg_nr > 3 && (!

m_Args

[++index]->IsString() && !

m_Args

[index]->IsBool()))

return false

;

2225  if

(arg_nr > 4 && !

m_Args

[++index]->IsBool())

return false

;

2232  string

field_name =

"affil.std."

+ field;

2238  string

orig_value = res_oi.front().field.GetPrimitiveValueString();

2247  string

field_name =

"affil.std."

+ field;

2263  const CPubdesc

* const_pubdesc =

dynamic_cast<const CPubdesc

*

>

(

object

.GetPointer());

2265  if

(!const_pubdesc && !const_block)

2271  if

(m_Args[index]->AreObjects()) {

2272

res_oi = m_Args[index]->GetObjects();

2274  else if

(m_Args[index]->IsRef()) {

2275

x_GetObjectsFromRef(res_oi, index);

2278  const string

& field = m_Args[++index]->GetString();

2279  const string

& newValue = m_Args[++index]->GetString();

2280  const string

& action_type = m_Args[++index]->GetString();

2282  bool

remove_field =

false

;

2283

x_GetOptionalArgs(

delimiter

, remove_field, index);

2287  if

(!newValue.empty()) {

2290  if

(const_pubdesc) {

2292

x_SetAuthorInPubdesc(*pubdesc, field, *m_Args[2], existing_text);

2294  else if

(const_block) {

2297

x_SetNewAuthor(submit_block->

SetCit

().SetAuthors(), field, *m_Args[2]);

2302  for

(

auto

&& it : res_oi) {

2308

SetQualStringValue(obj, orig_value);

2314  if

(field ==

"consortium"

) {

2319

m_QualsChangedCount++;

2322  else if

(field ==

"first"

) {

2325

m_QualsChangedCount++;

2329

m_QualsChangedCount++;

2336  if

(m_QualsChangedCount) {

2337

m_DataIter->SetModified();

2339  log

<< m_DataIter->GetBestDescr() <<

": set "

<< m_QualsChangedCount <<

" publication author field"

;

2340

x_LogFunction(

log

);

2343  else if

(remove_field) {

2344  for

(

auto

&& it : res_oi) {

2348

m_QualsChangedCount++;

2359  if

(const_pubdesc) {

2361  for

(

auto

& it : pubdesc->

SetPub

().Set()) {

2364  auto

& authors = auth_list.

SetNames

().SetStd();

2365

CAuth_list_Base::TNames::TStd::iterator auth_it = authors.begin();

2366  while

(auth_it != authors.end()) {

2367  if

((*auth_it)->IsSetName() &&

2368

(*auth_it)->GetName().IsConsortium() &&

2369

(*auth_it)->GetName().GetConsortium().empty()) {

2370

auth_it = authors.erase(auth_it);

2379  if

(m_QualsChangedCount) {

2380

m_DataIter->SetModified();

2382  log

<< m_DataIter->GetBestDescr() <<

": removed "

<< m_QualsChangedCount <<

" publication author field"

;

2383

x_LogFunction(

log

);

2391  auto

arg_nr =

m_Args

.size();

2392  if

(arg_nr > 6 || arg_nr < 4) {

2397  if

(!

m_Args

[index]->IsRef() && !

m_Args

[index]->AreObjects()) {

2402  for

(

size_t i

= 1;

i

< index; ++

i

) {

2403  if

(!

m_Args

[

i

]->IsString()) {

2407  if

(arg_nr > 4 && (!

m_Args

[index]->IsString() && !

m_Args

[index]->IsBool()))

return false

;

2408  if

(arg_nr > 5 && !

m_Args

[++index]->IsBool())

return false

;

2414  for

(

auto

& it : pubdesc.

SetPub

().Set()) {

2416  if

(it->IsSetAuthors()) {

2417

auth_list = &(it->SetAuthors());

2421

auth_list = &(it->SetAuthors());

2436  if

(field ==

"consortium"

) {

2437

field_name =

"name."

+ field;

2440

field_name =

"name.name."

+ field;

2443

auth_list.

SetNames

().SetStd().push_back(new_author);

2453

void CMacroFunction_SetPubAuthorMI::TheFunction()

2456  const CPubdesc

* const_pubdesc =

dynamic_cast<const CPubdesc

*

>

(

object

.GetPointer());

2458  if

(!const_pubdesc && !const_block)

2463  if

(m_Args[0]->AreObjects()) {

2464

res_oi = m_Args[0]->GetObjects();

2466  else if

(m_Args[0]->IsRef()) {

2467

x_GetObjectsFromRef(res_oi, 0);

2471  const string

& newValue = m_Args[index]->GetString();

2472  const string

& action_type = m_Args[++index]->GetString();

2474  bool

remove_field =

false

;

2475

x_GetOptionalArgs(

delimiter

, remove_field, index);

2483  log

<< m_DataIter->GetBestDescr();

2485  if

(!newValue.empty()) {

2486  for

(

auto

&& it : res_oi) {

2492

SetQualStringValue(obj, orig_value);

2499

m_QualsChangedCount++;

2504  if

(m_QualsChangedCount) {

2508  else if

(remove_field) {

2509  for

(

auto

&& it : res_oi) {

2514

m_QualsChangedCount++;

2519  if

(m_QualsChangedCount) {

2520  log

<<

": removed "

;

2523  if

(m_QualsChangedCount) {

2524

m_DataIter->SetModified();

2525  log

<< m_QualsChangedCount <<

" publication author middle initial"

;

2530 bool

CMacroFunction_SetPubAuthorMI::x_ValidArguments()

const 2532  auto

arg_nr = m_Args.size();

2533  if

(arg_nr > 5 || arg_nr < 3) {

2537  if

(!m_Args[index]->IsRef() && !m_Args[index]->AreObjects()) {

2541  if

(!m_Args[index]->IsString() || !m_Args[++index]->IsString())

2544  if

(arg_nr > 3 && (!m_Args[++index]->IsString() && !m_Args[index]->IsBool()))

return false

;

2545  if

(arg_nr > 4 && !m_Args[++index]->IsBool())

return false

;

2558  const CPubdesc

* const_pubdesc =

dynamic_cast<const CPubdesc

*

>

(

object

.GetPointer());

2560  if

(!const_pubdesc && !const_block)

2564  if

(m_Args[0]->GetString().empty()) {

2570  if

(const_pubdesc) {

2572

x_AddAuthorInPubdesc(*pubdesc, existing_text);

2574  else if

(const_block) {

2577

x_AddAuthor(submit_block->

SetCit

().SetAuthors(), existing_text);

2581  if

(m_QualsChangedCount) {

2582

m_DataIter->SetModified();

2584  log

<< m_DataIter->GetBestDescr() <<

": added "

<< m_QualsChangedCount <<

" publication author"

;

2585

x_LogFunction(

log

);

2595  for

(

auto

& it :

m_Args

) {

2596  if

(!it->IsString()) {

2605  for

(

auto

& it : pubdesc.

SetPub

().Set()) {

2607  if

(it->IsSetAuthors()) {

2608

auth_list = &(it->SetAuthors());

2612

auth_list = &(it->SetAuthors());

2630  const string

middle_init =

m_Args

[2]->GetString();

2632  if

(!middle_init.empty()) {

2633

initials.append(middle_init);

2637

initials.append(

"."

);

2639  if

(!initials.empty()) {

2642  if

(!

m_Args

[3]->GetString().empty()) {

2648

auth_list.

SetNames

().SetStd().push_back(author);

2652

auth_list.

SetNames

().SetStd().push_back(author);

2673  const CPubdesc

* const_pubdesc =

dynamic_cast<const CPubdesc

*

>

(

object

.GetPointer());

2675  if

(!const_pubdesc && !const_block)

2679  const string

& newValue = m_Args[index]->GetString();

2680  bool

remove_field = (++index < m_Args.size()) ? m_Args[index]->GetBool() :

false

;

2684  log

<< m_DataIter->GetBestDescr();

2686  if

(!newValue.empty()) {

2687  if

(const_pubdesc) {

2689

x_AddAuthorListInPubdesc(*pubdesc);

2691  else if

(const_block) {

2698  if

(m_QualsChangedCount) {

2702  else if

(remove_field) {

2703  if

(const_pubdesc) {

2705  for

(

auto

& it : pubdesc->

SetPub

().Set()) {

2706  if

(it->IsSetAuthors()) {

2710

auth_list.

SetNames

().SetStr().push_back(

"?"

);

2714  if

(m_QualsChangedCount) {

2715  log

<<

": removed "

;

2719  if

(m_QualsChangedCount) {

2720

m_DataIter->SetModified();

2721  log

<< m_QualsChangedCount <<

" author names"

;

2722

x_LogFunction(

log

);

2733  if

(!

m_Args

[index]->IsString())

2735  if

(++index <

m_Args

.size() && !

m_Args

[index]->IsBool())

2743  for

(

auto

& it : pubdesc.

SetPub

().Set()) {

2745  if

(it->IsSetAuthors()) {

2746

auth_list = &(it->SetAuthors());

2750

auth_list = &(it->SetAuthors());

2771  const CPubdesc

* const_pubdesc =

dynamic_cast<const CPubdesc

*

>

(

object

.GetPointer());

2776  const string

& newValue = m_Args[index]->GetString();

2777  const string

& action_type = m_Args[++index]->GetString();

2779  bool

remove_field =

false

;

2780

x_GetOptionalArgs(

delimiter

, remove_field, index);

2786  log

<< m_DataIter->GetBestDescr();

2788  if

(!newValue.empty()) {

2789

x_SetJournalInPubdesc(*pubdesc, newValue, existing_text);

2790  if

(m_QualsChangedCount) {

2794  else if

(remove_field) {

2795

x_RemoveJournalInPubdesc(*pubdesc);

2796  if

(m_QualsChangedCount) {

2797  log

<<

": removed "

;

2801  if

(m_QualsChangedCount) {

2802

m_DataIter->SetModified();

2803  log

<< m_QualsChangedCount <<

" publication journal "

;

2804

x_LogFunction(

log

);

2810  auto

arg_nr =

m_Args

.size();

2811  if

(arg_nr < 2 || arg_nr > 4) {

2817  if

(!

m_Args

[index]->IsString()) {

2820  if

(!

m_Args

[++index]->IsString())

return false

;

2821  if

(arg_nr > 2 && (!

m_Args

[++index]->IsString() && !

m_Args

[index]->IsBool()))

return false

;

2822  if

(arg_nr > 3 && !

m_Args

[++index]->IsBool())

return false

;

2829  CTitle

* title =

nullptr

;

2830  for

(

auto

& it : pubdesc.

SetPub

().Set()) {

2831  switch

(it->Which()) {

2833

title = &it->SetGen().SetJournal();

2836

title = &it->SetArticle().SetFrom().SetJournal().SetTitle();

2839

title = &it->SetJournal().SetTitle();

2848  if

(title->

IsSet

()) {

2849  for

(

auto

& it : title->

Set

()) {

2851  string

orig_value = it->GetName();

2853

it->SetName(orig_value);

2861  for

(

auto

& it : title->

Set

()) {

2863

it->SetName(newValue);

2873

this_title->SetName(newValue);

2874

title->

Set

().push_back(this_title);

2882  for

(

auto

& it : pubdesc.

SetPub

().Set()) {

2883  switch

(it->Which()) {

2885  if

(it->GetGen().IsSetJournal()) {

2886

it->SetGen().ResetJournal();

2891  if

(it->GetArticle().IsSetFrom() &&

2892

it->GetArticle().GetFrom().IsJournal() &&

2893

it->GetArticle().GetFrom().GetJournal().IsSetTitle()) {

2894

it->SetArticle().SetFrom().SetJournal().ResetTitle();

2899  if

(it->GetJournal().IsSetTitle()) {

2900

it->SetJournal().ResetTitle();

2923  const CPubdesc

* const_pubdesc =

dynamic_cast<const CPubdesc

*

>

(

object

.GetPointer());

2928  const string

& newValue =

m_Args

[index]->GetString();

2929  const string

& action_type =

m_Args

[++index]->GetString();

2931  bool

remove_field =

false

;

2937  if

(!newValue.empty()) {

2946  else if

(remove_field) {

2952  log

<<

": removed "

;

2965  auto

arg_nr =

m_Args

.size();

2966  if

(arg_nr < 2 || arg_nr > 4) {

2972  if

(!

m_Args

[index]->IsString()) {

2975  if

(!

m_Args

[++index]->IsString())

return false

;

2976  if

(arg_nr > 2 && (!

m_Args

[++index]->IsString() && !

m_Args

[index]->IsBool()))

return false

;

2977  if

(arg_nr > 3 && !

m_Args

[++index]->IsBool())

return false

;

2985  for

(

auto

& it : pubdesc.

SetPub

().Set()) {

2986  CObjectInfo

pub_oi(it.GetNCPointer(), it->GetThisTypeInfo());

2988  switch

(it->Which()) {

2993  if

(field ==

"date.std"

) {

2998  if

(it->GetArticle().IsSetFrom()) {

2999  switch

(it->GetArticle().GetFrom().Which()) {

3034  for

(

auto

& it : objs) {

3061  const CPubdesc

* const_pubdesc =

dynamic_cast<const CPubdesc

*

>

(

object

.GetPointer());

3063  if

(!const_pubdesc && !const_block)

3066  const string

date_field =

"date.std"

;

3068  if

(const_pubdesc) {

3073  else if

(const_block) {

3083  if

(m_QualsChangedCount) {

3084

m_DataIter->SetModified();

3086  log

<< m_DataIter->GetBestDescr() <<

": set publication date"

;

3087

x_LogFunction(

log

);

3093  auto

arg_nr =

m_Args

.size();

3094  if

(arg_nr != 1 && arg_nr != 3)

return false

;

3098  if

(!

m_Args

[0]->IsString())

3102  for

(

auto

& it :

m_Args

) {

3112  if

(objs.empty())

return

;

3113  if

(

m_Args

.size() == 3) {

3115  auto

it =

m_Args

.begin();

3118  if

((*it)->GetInt() > 0) {

3130  string

orig_date =

m_Args

[0]->GetString();

3141  bool

ambiguous =

false

, day_first =

false

;

3144  bool

month_ambiguous =

false

;

3151

date_obj->

Assign

(date->GetStd());

3166  const CPubdesc

* const_pubdesc =

dynamic_cast<const CPubdesc

*

>

(

object

.GetPointer());

3168  if

(!const_pubdesc && !const_block)

3173  if

(m_Args[index]->IsInt()) {

3176  else if

(m_Args[index]->IsString()) {

3177

newValue = m_Args[index]->GetString();

3179  if

(m_Args[0]->GetString() !=

"season"

&& !newValue.empty()) {

3183  bool

remove_field = (++index < m_Args.size()) ? m_Args[index]->GetBool() :

false

;

3186  log

<< m_DataIter->GetBestDescr();

3188  const string

date_field =

"date.std"

;

3190  if

(const_pubdesc) {

3193  if

(!newValue.empty()) {

3194

x_AddDateField(objs);

3195  if

(m_QualsChangedCount) {

3199  else if

(remove_field) {

3200

x_RemoveDateField(objs);

3201  if

(m_QualsChangedCount) {

3202  log

<<

": removed "

;

3206  else if

(const_block) {

3211  if

(!newValue.empty()) {

3213

x_AddDateField(objs);

3214  if

(m_QualsChangedCount) {

3218  else if

(remove_field) {

3220

x_RemoveDateField(objs);

3221  if

(m_QualsChangedCount) {

3222  log

<<

": removed "

;

3228  if

(m_QualsChangedCount) {

3229

m_DataIter->SetModified();

3230  log

<< m_QualsChangedCount <<

" publication "

+ m_Args[0]->GetString();

3231

x_LogFunction(

log

);

3242  if

(!

m_Args

[index]->IsString())

return false

;

3244  if

(!

m_Args

[index]->IsString() && !

m_Args

[index]->IsInt()) {

3247  if

(++index <

m_Args

.size() && !

m_Args

[index]->IsBool())

return false

;

3253  if

(objs.empty())

return

;

3264  if

(objs.empty())

return

;

3276

void CMacroFunction_SetPubCitation::TheFunction()

3279  const CPubdesc

* const_pubdesc =

dynamic_cast<const CPubdesc

*

>

(

object

.GetPointer());

3284  const string

& newValue = m_Args[index]->GetString();

3285  const string

& action_type = m_Args[++index]->GetString();

3287  bool

remove_field =

false

;

3288

x_GetOptionalArgs(

delimiter

, remove_field, index);

3295  log

<< m_DataIter->GetBestDescr();

3297  if

(!newValue.empty()) {

3299  for

(

auto

& it : pubdesc->

SetPub

().Set()) {

3300  CObjectInfo

pub_oi(it.GetNCPointer(), it->GetThisTypeInfo());

3302  switch

(it->Which()) {

3311  for

(

auto

& it : objs) {

3316

(SetQualStringValue(obj, orig_value));

3321  if

(m_QualsChangedCount) {

3325  else if

(remove_field) {

3327  for

(

auto

& it : pubdesc->

SetPub

().Set()) {

3328  CObjectInfo

pub_oi(it.GetNCPointer(), it->GetThisTypeInfo());

3330  switch

(it->Which()) {

3339  if

(m_QualsChangedCount) {

3340  log

<<

": removed "

;

3344  if

(m_QualsChangedCount) {

3345

m_DataIter->SetModified();

3346  log

<< m_QualsChangedCount <<

" publication citation"

;

3351 bool

CMacroFunction_SetPubCitation::x_ValidArguments()

const 3353  auto

arg_nr = m_Args.size();

3354  if

(arg_nr < 2 || arg_nr > 4) {

3359  if

(!m_Args[index]->IsString() || !m_Args[++index]->IsString()) {

3362  if

(arg_nr > 2 && (!m_Args[++index]->IsString() && !m_Args[index]->IsBool()))

return false

;

3363  if

(arg_nr > 3 && !m_Args[++index]->IsBool())

return false

;

3372

void CMacroFunction_SetSerialNumber::TheFunction()

3375  const CPubdesc

* const_pubdesc =

dynamic_cast<const CPubdesc

*

>

(

object

.GetPointer());

3381  if

(m_Args[index]->IsString()) {

3382

newValue = m_Args[0]->GetString();

3384  else if

(m_Args[index]->IsInt()) {

3390  const string

& action_type = m_Args[++index]->GetString();

3392  bool

remove_field =

false

;

3393

x_GetOptionalArgs(

delimiter

, remove_field, index);

3400  log

<< m_DataIter->GetBestDescr();

3402  if

(!newValue.empty()) {

3404  for

(

auto

& it : pubdesc->

SetPub

().Set()) {

3405  CObjectInfo

pub_oi(it.GetNCPointer(), it->GetThisTypeInfo());

3407  switch

(it->Which()) {

3416  for

(

auto

& it : objs) {

3427

m_QualsChangedCount++;

3432  if

(m_QualsChangedCount) {

3436  else if

(remove_field) {

3438  for

(

auto

& it : pubdesc->

SetPub

().Set()) {

3439  CObjectInfo

pub_oi(it.GetNCPointer(), it->GetThisTypeInfo());

3441  switch

(it->Which()) {

3450  if

(m_QualsChangedCount) {

3451  log

<<

": removed "

;

3455  if

(m_QualsChangedCount) {

3456

m_DataIter->SetModified();

3457  log

<< m_QualsChangedCount <<

" publication serial number"

;

3462 bool

CMacroFunction_SetSerialNumber::x_ValidArguments()

const 3464  auto

arg_nr = m_Args.size();

3465  if

(arg_nr > 4 || arg_nr < 2) {

3470  if

(!m_Args[index]->IsInt() && !m_Args[index]->IsString())

3473  if

(!m_Args[++index]->IsString())

return false

;

3474  if

(arg_nr > 2 && (!m_Args[++index]->IsString() && !m_Args[index]->IsBool()))

return false

;

3475  if

(arg_nr > 3 && !m_Args[++index]->IsBool())

return false

;

3488  const CPubdesc

* const_pubdesc =

dynamic_cast<const CPubdesc

*

>

(

object

.GetPointer());

3493  if

(const_pubdesc) {

3495  if

(s_SetStatus(*pubdesc, m_Args[0]->GetString()))

3496

m_QualsChangedCount++;

3499  if

(m_QualsChangedCount) {

3500

m_DataIter->SetModified();

3502  log

<< m_DataIter->GetBestDescr() <<

": set publication status"

;

3503

x_LogFunction(

log

);

3509  return

(

m_Args

.size() == 1 &&

m_Args

[0]->IsString());

3520  for

(

auto

&& it: pubdesc.

SetPub

().Set()) {

3532  if

(status == curr_status) {

3540

new_imp->

Assign

(*old_imp);

3561  else if

(pub.

IsGen

()) {

3577  auto

& cit_gen = tmp_pub.

GetGen

();

3579  if

(cit_gen.IsSetTitle()) {

3581

new_title->SetName(cit_gen.GetTitle());

3582

article.SetTitle().Set().push_back(new_title);

3584  if

(cit_gen.IsSetAuthors()) {

3585

article.SetAuthors().Assign(cit_gen.GetAuthors());

3588  auto

&

journal

= article.SetFrom().SetJournal();

3592  if

(cit_gen.IsSetJournal()) {

3593  journal

.SetTitle().Assign(cit_gen.GetJournal());

3598  journal

.SetTitle().Set().push_back(new_title);

3602  if

(cit_gen.IsSetDate()) {

3603  journal

.SetImp().SetDate().Assign(cit_gen.GetDate());

3609  journal

.SetImp().SetDate().SetStd().SetYear(year);

3612  if

(cit_gen.IsSetVolume()) {

3613  journal

.SetImp().SetVolume(cit_gen.GetVolume());

3615  if

(cit_gen.IsSetIssue()) {

3616  journal

.SetImp().SetIssue(cit_gen.GetIssue());

3618  if

(cit_gen.IsSetPages()) {

3619  journal

.SetImp().SetPages(cit_gen.GetPages());

3632

void CMacroFunction_SetPubPMID::TheFunction()

3635  const CPubdesc

* const_pubdesc =

dynamic_cast<const CPubdesc

*

>

(

object

.GetPointer());

3636  if

(!const_pubdesc)

return

;

3645  if

(m_Args[index]->IsString()) {

3646

newStrValue = m_Args[index]->GetString();

3651  else if

(m_Args[index]->GetInt()) {

3652  TIntId id

= m_Args[index]->GetInt();

3656  bool

remove_field = (++index < m_Args.size()) ? m_Args[index]->GetBool() :

false

;

3659  log

<< m_DataIter->GetBestDescr();

3661  if

(!newStrValue.empty()) {

3662  bool

has_pmid =

false

;

3663  for

(

auto

& it : pubdesc->

SetPub

().Set()) {

3666  if

(it->GetPmid().Get() != new_pmid) {

3667

it->SetPmid().Set(new_pmid);

3668

m_QualsChangedCount++;

3675  for

(

auto

& it : pubdesc->

GetPub

().

Get

()) {

3683

new_pub->SetPmid().Set(new_pmid);

3684

pubdesc->

SetPub

().Set().push_back(new_pub);

3685

m_QualsChangedCount++;

3689  bool

has_art_pmid =

false

;

3690  for

(

auto

& it : pubdesc->

SetPub

().Set()) {

3691  if

(it->IsArticle()) {

3692  if

(it->SetArticle().IsSetIds()) {

3694  if

((*id)->IsPubmed()) {

3695

has_art_pmid =

true

;

3696  if

((*id)->GetPubmed().Get() != new_pmid) {

3697

(*id)->SetPubmed().Set(new_pmid);

3698

m_QualsChangedCount++;

3705  if

(!has_art_pmid) {

3707

art_id->SetPubmed().Set(new_pmid);

3708

it->SetArticle().SetIds().Set().push_back(art_id);

3709

m_QualsChangedCount++;

3713  if

(m_QualsChangedCount) {

3714  log

<<

": applied pmid "

<< new_pmid;

3717  else if

(remove_field) {

3718

CPub_equiv::Tdata::iterator pub_it = pubdesc->

SetPub

().Set().begin();

3719  while

(pub_it != pubdesc->

SetPub

().Set().end()) {

3720  auto

& pub_elem = (*pub_it);

3721  if

(pub_elem->IsPmid()) {

3722

pub_it = pubdesc->

SetPub

().Set().erase(pub_it);

3723

m_QualsChangedCount++;

3726  else if

(pub_elem->IsArticle() && pub_elem->GetArticle().IsSetIds()) {

3728  if

((*id)->IsPubmed()) {

3730

m_QualsChangedCount++;

3733  if

(pub_elem->GetArticle().GetIds().Get().empty()) {

3734

pub_elem->SetArticle().ResetIds();

3739  if

(m_QualsChangedCount) {

3740  log

<<

": removed pmid"

;

3743  if

(m_QualsChangedCount) {

3744

m_DataIter->SetModified();

3749 bool

CMacroFunction_SetPubPMID::x_ValidArguments()

const 3751  if

(m_Args.empty() || m_Args.size() > 2) {

3755  if

(!m_Args[0]->IsInt() && !m_Args[0]->IsString())

3757  if

(m_Args.size() == 2 && !m_Args[1]->IsBool())

3770

void CMacroFunction_SetPubDOI::TheFunction()

3773  const CPubdesc

* const_pubdesc =

dynamic_cast<const CPubdesc

*

>

(

object

.GetPointer());

3781  const string

& new_doi = m_Args[0]->GetString();

3782  if

(new_doi.empty())

3785  bool

remove_field =

false

;

3788  log

<< m_DataIter->GetBestDescr();

3791  bool

has_doi =

false

;

3792  for

(

auto

& it : pubdesc->

SetPub

().Set()) {

3793  if

(it->IsArticle()) {

3794  if

(it->SetArticle().IsSetIds()) {

3796  if

((*id)->IsDoi()) {

3799

(*id)->SetDoi().Set(new_doi);

3800

m_QualsChangedCount++;

3809

art_id->SetDoi().Set(new_doi);

3810

it->SetArticle().SetIds().Set().push_back(art_id);

3811

m_QualsChangedCount++;

3816  if

(m_QualsChangedCount) {

3817

m_DataIter->SetModified();

3818  log

<<

": applied doi "

<< new_doi;

3823 bool

CMacroFunction_SetPubDOI::x_ValidArguments()

const 3825  if

(m_Args.empty() || m_Args.size() > 1) {

3828  return

(m_Args[0]->IsString());

3848

void CMacroFunction_ApplyPmidToEntry::TheFunction()

3861  for

(; b_iter; ++b_iter) {

3866  bool

multiple = (m_Args.size() == 2) ? m_Args[1]->GetBool() :

false

;

3867  if

(

count

!= 1 && !multiple) {

3869  log

<<

"Pmid "

<< m_Args[0]->GetInt() <<

" was not applied as the record has "

<<

count

<<

" nucleotide sequences. "

;

3875  TIntId id

= m_Args[0]->GetInt();

3879  if

(m_DataIter->IsHugeDataMode()) {

3880  if

(

auto

& remote_updater = m_DataIter->RemoteUpdater(); remote_updater) {

3885

pubdesc.

SetPub

().Set().emplace_back(&pmid_pub);

3891

tmp_pubdesc.

Assign

(pubdesc);

3893

remote_updater->UpdatePubReferences(desc);

3894

AdjustAuthors(pubdesc);

3896  if

(!pubdesc.

Equals

(tmp_pubdesc)) {

3897

m_QualsChangedCount++;

3898

new_pub.Reset(

new CPub

);

3899  for

(

const auto

& pub_it : pubdesc.

GetPub

().

Get

()) {

3900  if

(!pub_it->IsPmid()) {

3901

new_pub->Assign(*pub_it);

3915  log

<< new_pmid <<

" pmid failed to look up"

;

3924  if

(orig_pmids.

find

(new_pmid) != orig_pmids.

end

()) {

3932

m_DataIter->RunCommand(add_cmd, m_CmdComposite);

3938  log

<<

"Applied "

<< new_pmid <<

" pmid to "

<< best_id;

3943  unsigned

seq_nr = 0;

3950  if

(orig_pmids.

find

(new_pmid) != orig_pmids.

end

()) {

3961

pub->Assign(*new_pub);

3967

m_DataIter->RunCommand(add_cmd, m_CmdComposite);

3973  if

(m_DataIter->IsHugeDataMode()) {

3977

report[

msg

] = m_QualsChangedCount;

3979

x_LogChangedQuals(fnc_log);

3983  log

<<

"Applied "

<< new_pmid <<

" pmid to "

<< seq_nr <<

" sequences"

;

3991 bool

CMacroFunction_ApplyPmidToEntry::x_ValidArguments()

const 3993  if

(m_Args.size() != 1 && m_Args.size() != 2)

3996  return

(m_Args[0]->IsInt() && (m_Args.size() == 2) ? m_Args[1]->IsBool() :

true

);

4004  for

(

auto

& it : pub.

GetPub

().

Get

()) {

4006

pmids.

insert

(it->GetPmid().Get());

4008  if

(it->IsArticle() && it->GetArticle().IsSetIds()) {

4010  if

((*id)->IsPubmed()) {

4011

pmids.

insert

((*id)->GetPubmed().Get());

4015  if

(it->IsMedline() && it->GetMedline().IsSetPmid()) {

4016

pmids.

insert

(it->GetMedline().GetPmid().Get());

4029

new_pubdesc->SetPub().Set().push_back(pmid_pub);

4030

new_pubdesc->SetPub().Set().push_back(new_pub);

4033

new_desc->

SetPub

(*new_pubdesc);

4049

void CMacroFunction_ApplyDOIToEntry::TheFunction()

4062  for

(; b_iter; ++b_iter) {

4066  const string

& new_doi = m_Args[0]->GetString();

4067  bool

multiple = (m_Args.size() == 2) ? m_Args[1]->GetBool() :

false

;

4068  if

(

count

!= 1 && !multiple) {

4070  log

<<

"DOI "

<< new_doi <<

" was not applied as the record has "

<<

count

<<

" nucleotide sequences. "

;

4075

pair<CRef<CPubdesc>,

string

> new_pubdesc_str;

4077  if

(m_DataIter->IsHugeDataMode()) {

4078  if

(

auto

& doi_updater = m_DataIter->DOIUpdater(); doi_updater) {

4079

new_pubdesc_str = doi_updater->GetPub(new_doi);

4089  log

<<

"Failed to resolve DOI "

<< new_doi <<

": "

<< new_pubdesc_str.second;

4098  if

(orig_dois.

find

(new_doi) != orig_dois.

end

()) {

4103

new_desc->

SetPub

(*new_pubdesc);

4108

m_DataIter->RunCommand(add_cmd, m_CmdComposite);

4114  log

<<

"Applied publication with "

<< new_doi <<

" doi to "

<< best_id;

4119  unsigned

seq_nr = 0;

4126  if

(orig_dois.

find

(new_doi) != orig_dois.

end

()) {

4137

new_desc->

SetPub

(*new_pubdesc);

4142

m_DataIter->RunCommand(add_cmd, m_CmdComposite);

4148  if

(m_DataIter->IsHugeDataMode()) {

4150

report[new_doi +

" DOI lookup"

] = seq_nr;

4152

x_LogChangedQuals(fnc_log);

4156  log

<<

"Applied "

<< new_doi <<

" DOI to "

<< seq_nr <<

" sequences"

;

4163 bool

CMacroFunction_ApplyDOIToEntry::x_ValidArguments()

const 4165  if

(m_Args.size() != 1 && m_Args.size() != 2)

4168  return

(m_Args[0]->IsString() && (m_Args.size() == 2) ? m_Args[1]->IsBool() :

true

);

4176  for

(

auto

& it : pub.

GetPub

().

Get

()) {

4177  if

(it->IsArticle() && it->GetArticle().IsSetIds()) {

4179  if

((*id)->IsDoi()) {

4180

dois.

insert

((*id)->GetDoi());

4194

void CMacroFunction_RemovePubAuthors::TheFunction()

4197  const CPubdesc

* const_pubdesc =

dynamic_cast<const CPubdesc

*

>

(

object

.GetPointer());

4199  if

(!const_pubdesc && !const_block)

4202  bool

modified =

false

;

4204  if

(const_pubdesc) {

4206  for

(

auto

& it : pubdesc->

SetPub

().Set()) {

4207  if

(it->IsSetAuthors()) {

4210

auth_list.

SetNames

().SetStr().push_back(

"?"

);

4216  else if

(const_block) {

4218  if

(submit_block->

IsSetCit

() && submit_block->

SetCit

().IsSetAuthors()) {

4219

submit_block->

SetCit

().SetAuthors().ResetNames();

4220

submit_block->

SetCit

().SetAuthors().SetNames().SetStr().push_back(

"?"

);

4226

m_DataIter->SetModified();

4228  log

<< m_DataIter->GetBestDescr() <<

": removed publication authors"

;

4233 bool

CMacroFunction_RemovePubAuthors::x_ValidArguments()

const 4235  return

m_Args.empty();

4244

void CMacroFunction_RemovePubAuthorMI::TheFunction()

4247  const CPubdesc

* const_pubdesc =

dynamic_cast<const CPubdesc

*

>

(

object

.GetPointer());

4249  if

(!const_pubdesc && !const_block)

4253  if

(m_Args[0]->AreObjects()) {

4254

res_oi = m_Args[0]->GetObjects();

4256  else if

(m_Args[0]->IsRef()) {

4257

x_GetObjectsFromRef(res_oi, 0);

4260  if

(res_oi.empty()) {

4264  for

(

auto

&& it : res_oi) {

4272

m_QualsChangedCount++;

4277  if

(m_QualsChangedCount) {

4278

m_DataIter->SetModified();

4280  log

<< m_DataIter->GetBestDescr() <<

": removed "

<< m_QualsChangedCount <<

" publication author middle initial"

;

4285 bool

CMacroFunction_RemovePubAuthorMI::x_ValidArguments()

const 4287  if

(m_Args.size() != 1) {

4290  return

(m_Args[0]->AreObjects() || m_Args[0]->IsRef());

4321  while

(elem.

Valid

()) {

4356  switch

(pub.

Which

()) {

4369  auto

it =

m_Args

.begin();

4370  for

(; mem.

Valid

() && it !=

m_Args

.end(); ++mem, ++it) {

4388  switch

(pub.Which()) {

4392  string

field_name(

"authors.affil.std."

);

4393

field_name.append(

m_Args

[0]->GetString());

4412

vector<CMQueryNodeValue::EType> valid_types;

4419  for

(

size_t i

= 0;

i

<

m_Args

.size(); ++

i

) {

4420  if

(

i

== 3 && !

m_Args

[

i

]->IsString()) {

4423  else if

(!

m_Args

[

i

]->IsInt()) {

User-defined methods of the data storage class.

User-defined methods of the data storage class.

User-defined methods of the data storage class.

Utility macros and typedefs for exploring NCBI objects from biblio.asn.

#define FOR_EACH_ARTICLEID_ON_CITART(Itr, Var)

#define EDIT_EACH_ARTICLEID_ON_CITART(Itr, Var)

#define ERASE_ARTICLEID_ON_CITART(Itr, Var)

@Affil.hpp User-defined methods of the data storage class.

@Auth_list.hpp User-defined methods of the data storage class.

size_t GetNameCount() const

static CRef< CAuthor > ConvertMlToStandard(const CAuthor &author, bool normalize_suffix=false)

void SetToTime(const CTime &time, EPrecision prec=ePrecision_second)

static pair< CRef< objects::CPubdesc >, string > GetPubFromCrossRef(const string &doi)

void Fetch(const string &db, const vector< objects::CSeq_id_Handle > &uids, CNcbiOstream &ostr, const string &retmode="xml")

void SetMaxReturn(int ret_max)

static void s_DoLookup(const string &old_title, vector< string > &titles)

Subclass of the IQueryParseUserObject which is held as the user-defined object in each CQueryParseNod...

CMacroBioData_PubdescIter - iterates over all publication descriptors and features in the seq-entry.

@Name_std.hpp User-defined methods of the data storage class.

static EPubFieldStatus GetStatusFromString(const string &str)

static bool SetImprint(objects::CPub &pub, const objects::CImprint &imp)

static string GetLabelForStatus(EPubFieldStatus status)

static CConstRef< objects::CImprint > GetImprint(const objects::CPub &pub)

@ ePubFieldStatus_InPress

@ ePubFieldStatus_Published

@ ePubFieldStatus_Unpublished

CAuth_list & SetAuthors(void)

bool IsSetAuthors(void) const

@Pubdesc.hpp User-defined methods of the data storage class.

class CStaticArrayMap<> provides access to a static array in much the same way as CStaticArraySet<>,...

TBase::const_iterator const_iterator

static string FixDateFormat(const string &orig_date)

Attempt to fix the format of the date Returns a blank if the format of the date cannot be determined.

static CRef< CDate > DateFromCollectionDate(const string &str) THROWS((CException))

static void DetectDateFormat(const string &orig_date, bool &ambiguous, bool &day_first)

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

static bool GetBestId(CSeq_id_Handle, CScope &, string &)

Base class for any user function that performs editing operations on ASN.1 data.

const_iterator end() const

const_iterator find(const key_type &key) const

iterator_bool insert(const value_type &val)

const_iterator find(const key_type &key) const

const_iterator end() const

static const struct name_t names[]

static DLIST_TYPE *DLIST_NAME() first(DLIST_LIST_TYPE *list)

static DLIST_TYPE *DLIST_NAME() last(DLIST_LIST_TYPE *list)

SStrictId_Entrez::TId TEntrezId

TEntrezId type for entrez ids which require the same strictness as TGi.

#define ENTREZ_ID_TO(T, entrez_id)

#define ITERATE(Type, Var, Cont)

ITERATE macro to sequence through container elements.

#define NON_CONST_ITERATE(Type, Var, Cont)

Non constant version of ITERATE macro.

#define ENTREZ_ID_FROM(T, value)

#define LOG_POST(message)

This macro is deprecated and it's strongly recomended to move in all projects (except tests) to macro...

void Error(CExceptionArgs_Base &args)

const string & GetMsg(void) const

Get message string.

static void s_GetObjectsFromAuthListNames(const CObjectInfo &names, const string &field_name, CMQueryNodeValue::TObs &objs)

virtual bool x_ValidArguments() const

Tests the number and the type of function arguments.

void x_GetObjectsForPubField_SerialNumber(const objects::CPub &pub, const CObjectInfo &pub_var, CMQueryNodeValue::TObs &objs)

void x_GetObjectsForPubField_Title(const objects::CPub &pub, const CObjectInfo &pub_var, CMQueryNodeValue::TObs &objs)

static string s_GetFirstNameInitials(const string &first_name)

void x_GetObjectsForPubField_VolIssuePage(const objects::CPub &pub, const CObjectInfo &pub_var, CMQueryNodeValue::TObs &objs)

bool ApplyMiddleInitial(objects::CName_std &std_name, const string &newValue, objects::edit::EExistingText existing_text)

static string s_InsertInitialPeriods(const string &orig)

bool SetQualStringValue(CObjectInfo &oi, const string &value)

Functions make the action and collect statistics.

void SetString(const string &data)

Set/get underlying data type.

unique_ptr< CGetDOI > m_getDoi

static const char * sm_PubIssue

void x_SetPubFieldInPub(CObjectInfo &pub_oi)

static bool s_FixInitials(objects::CName_std &name)

string m_ResField

used for resolving fields for authors, date, affiliation

string x_GetPubStatus(const CObjectInfo &pubdesc_oi)

void x_RemoveVolIssuePagesInPubdesc(objects::CPubdesc &pubdesc)

static bool s_SetStatus(objects::CPubdesc &pubdesc, const string &value)

ENestedFunc m_Nested

flag indicating whether the function is nested within another function

static const TAuthorFixPair s_AuthorFixString[]

static const char * sm_FunctionName

class CMacroFunction_SetPubField SetPub_Date(year, month, day, season, hour, minute,...

virtual bool x_ValidArguments() const

Tests the number and the type of function arguments.

virtual void TheFunction()

Function implementation.

static void s_GetObjectsFromTitle(const CObjectInfo &title, CMQueryNodeValue::TObs &objs)

CRef< CMacroCmdComposite > m_CmdComposite

static bool s_IsPubFieldFnc(const string &fn_name)

void x_LogChangedQuals(const CRef< IFunctionLog > &log)

virtual bool x_ValidArguments() const

Tests the number and the type of function arguments.

static const char * sm_FunctionName

class CMacroFunction_ApplyPublication SetPub_Sub(author_field_name, author_field_value) Apply new pub...

void x_GetObjectsForPubField_Cit(const objects::CPub &pub, const CObjectInfo &pub_var, CMQueryNodeValue::TObs &objs)

static const char * sm_PubJournal

CStaticArrayMap< string, CMacroFunction_AuthorFix::EActionType > TAuthorFixTypeMap

CMQueryNodeValue::EType GetPrimitiveFromRef(CMQueryNodeValue &node)

virtual void TheFunction()

Function implementation.

void x_RemoveDateField(CMQueryNodeValue::TObs &objs)

static void s_GetObjectsFromImprint(const CObjectInfo &imp, const string &field_name, CMQueryNodeValue::TObs &objs)

DEFINE_STATIC_ARRAY_MAP(TAuthorFixTypeMap, sm_AuthorFixMap, s_AuthorFixString)

bool ResolveAndSetSimpleTypeValue(CObjectInfo &oi, const string &field_name, const CMQueryNodeValue &value, objects::edit::EExistingText existing_text=objects::edit::eExistingText_replace_old)

Resolve dot qualified ASN.1 node_name using the object information instance provided as a parameter (...

bool RemoveFieldByName(CMQueryNodeValue::SResolvedField &res_field)

Remove the object information instance corresponding to field, using information about its parent nod...

list< SResolvedField > TObs

virtual bool x_ValidArguments() const

Tests the number and the type of function arguments.

virtual bool x_ValidArguments() const

Tests the number and the type of function arguments.

map< string, vector< string > > m_Hits

void x_GetObjectsForPubField_Date(const objects::CPub &pub, const CObjectInfo &pub_var, CMQueryNodeValue::TObs &objs)

virtual bool x_ValidArguments() const

Tests the number and the type of function arguments.

static void s_GetObjectsFromAffil(const CObjectInfo &affil, const string &field_name, CMQueryNodeValue::TObs &objs)

static const char * sm_PubSerialNumber

void AssignFromObjectInfo(const CObjectInfo &objinfo)

Assigns data from objinfo. It is used when storing evaluation result.

virtual bool x_ValidArguments() const

Tests the number and the type of function arguments.

objects::CPub::E_Choice m_PubType

static const char * sm_FuncVolume

class CMacroFunction_SetPubVolIssuePages SetPubVolume(newValue, existing_text, delimiter,...

void x_SetAuthorInPubdesc(objects::CPubdesc &pubdesc, const string &field, const CMQueryNodeValue &value, objects::edit::EExistingText existing_text)

static const char * sm_PubAuthors

static void s_CopyResolvedObjs(const CMQueryNodeValue::TObs &objs_from, CMQueryNodeValue::TObs &objs_to)

bool SetSimpleTypeValue(CObjectInfo &oi, const CMQueryNodeValue &value, objects::edit::EExistingText existing_text=objects::edit::eExistingText_replace_old)

Set single node data to the node specified by parameter of type CObjectInfo.

void x_GetPubFieldObjectFromPub(const CObjectInfo &pub_oi, CMQueryNodeValue::TObs &objs)

string GetStringValue(CRef< CMQueryNodeValue > &value)

converts ints and doubles into string, by changing the type of the value

virtual bool x_ValidArguments() const

Tests the number and the type of function arguments.

unsigned ApplyAuthorNames(objects::CAuth_list &auth_list, const string &newValue)

void x_SetObjects_Date(objects::CPub &pub, CObjectInfo &pub_var)

void x_GetObjectsForPubField_Authors(const objects::CPub &pub, const CObjectInfo &pub_var, CMQueryNodeValue::TObs &objs)

void x_SetTitleInPubdesc(objects::CPubdesc &pubdesc, const string &value)

string GetDOI(const objects::CPubdesc &pubdesc) const override

virtual bool x_ValidArguments() const

Tests the number and the type of function arguments.

virtual void TheFunction()

Function implementation.

CMacroFunction_PubFields(EScopeEnum func_scope, objects::EPublication_field field)

CObjectInfo GetPrimitiveObjInfo(const CObjectInfo &info)

virtual void TheFunction()

Function implementation.

void x_LookupTitleInJournal(objects::CCit_jour &journal)

static const char * sm_FunctionName

static const string & GetDescription(EActionType fix_type)

vector< string > x_FindIsoJtaTitle(const string &title)

static void s_GetObjectsFromDate(const CObjectInfo &date, const string &field_name, CMQueryNodeValue::TObs &objs)

static set< string > s_GatherExistingDOIs(const CBioseq_Handle &bsh)

virtual void TheFunction()

Function implementation.

static bool s_ReverseAuthorNames(objects::CName_std &name)

bool x_HasIsoJtaTitle(const objects::CTitle &title) const

void x_GetOptionalArgs(string &delimiter, bool &remove_field, size_t &index)

void x_SetTitleInSubmitBlock(objects::CSubmit_block &submit_block, const string &value)

static string x_GetStatus(const objects::CPub &pub)

void x_GetObjectsForPubField_AffilField(const objects::CPub &pub, const CObjectInfo &pub_var, CMQueryNodeValue::TObs &objs)

void x_LogError(CNcbiOstrstream &logstr)

Int4 m_QualsChangedCount

Number of changed qualifiers during the function call.

bool GetFieldsByName(CMQueryNodeValue::TObs *results, const CObjectInfo &oi_i, const string &field_name)

Resolve existing dot qualified ASN.1 name (field_name) starting from the object information instance ...

static const char * sm_PubVolume

bool RemoveMiddleInitial(objects::CName_std &std_name)

void x_AddAuthorInPubdesc(objects::CPubdesc &pubdesc, objects::edit::EExistingText existing_text)

void SetRef(CRef< CMQueryNodeValue > node)

void x_SetAffilField(objects::CAuth_list &auth_list, const string &field, const string &value, objects::edit::EExistingText existing_text)

virtual bool x_ValidArguments() const

Tests the number and the type of function arguments.

objects::EPublication_field m_FieldType

void x_GetObjectsForPubField_DOI(objects::CPub &pub, const CObjectInfo &pub_var, CMQueryNodeValue::TObs &objs)

virtual void TheFunction()

Function implementation.

DEFINE_MACRO_FUNCNAME(CMacroFunction_MoveMiddleName, "MoveMiddleToFirstName")

class CMacroFunction_AuthorFix MoveMiddleToFirstName(); - moves middle name to first name and fixes t...

bool SetFieldsByName(CMQueryNodeValue::TObs *results, CObjectInfo &oi_i, const string &field_name)

Resolve not necessarily existing dot qualified ASN.1 name (field_name) starting from the object infor...

static const char * sm_FuncPages

void x_RemoveAffilField(objects::CAuth_list &auth_list, const string &field)

static const char * sm_PubStatus

void x_RemoveJournalInPubdesc(objects::CPubdesc &pubdesc)

virtual bool x_ValidArguments() const

Tests the number and the type of function arguments.

objects::edit::EExistingText ActionTypeToExistingTextOption(const string &action_type, const string &delimiter)

static const char * sm_PubTitle

class CMacroFunction_PubFields PUB_TITLE(), PUB_ISSUE(), PUB_AFFIL(subfield) - returns a list of CObj...

static const char * sm_PubDOI

static void s_BuildName(const string &firstname, const string &mid_initials, const string &lastname, const string &suffix, objects::CName_std &name)

void x_GetObjectsForPubField_PMID(objects::CPub &pub, const CObjectInfo &pub_var, CMQueryNodeValue::TObs &objs)

const string & x_GetIsoJtaTitle(const objects::CTitle &title) const

static bool s_TruncateMiddleInitials(objects::CName_std &name)

vector< pair< string, string > > m_TitlePairs

int x_MakeAuthorChanges(objects::CAuth_list &auth_list)

CRef< CMQueryNodeValue > m_Result

static bool s_IsUnpublished(const string &citation)

static Int4 s_RemoveFields(CIRef< IMacroBioDataIter > &dataiter, CMQueryNodeValue::TObs &objs)

static string s_GetFirstNameInitialsWithoutStops(const string &first_name)

virtual bool x_ValidArguments() const

Tests the number and the type of function arguments.

void x_AddDate(CMQueryNodeValue::TObs &objs)

void x_SetNewAuthor(objects::CAuth_list &auth_list, const string &field, const CMQueryNodeValue &value)

void SetStrings(const vector< string > &data)

void x_GetPubFieldObjectFromSubmitBlock(const CObjectInfo &block_oi, CMQueryNodeValue::TObs &objs)

static const char * sm_PubPMID

static set< TEntrezId > s_GatherExistingPMIDs(const CBioseq_Handle &bsh)

static const char * sm_PubDate

static const char * sm_PubAffil

void x_AddDateField(CMQueryNodeValue::TObs &objs)

void x_AddAuthorListInPubdesc(objects::CPubdesc &pubdesc)

virtual bool x_ValidArguments() const

Tests the number and the type of function arguments.

static const char * sm_PubCit

virtual bool x_ValidArguments() const

Tests the number and the type of function arguments.

void x_LogFunction(CNcbiOstrstream &logstr)

string GetDOI(const objects::CPubdesc &pubdesc) const override

static void s_GetObjectsFromPersonID(const CObjectInfo &names, const string &field_name, CMQueryNodeValue::TObs &objs)

bool ApplyFirstName(objects::CName_std &std_name, const string &newValue, objects::edit::EExistingText existing_text)

virtual bool x_ValidArguments() const

Tests the number and the type of function arguments.

void x_SetJournalInPubdesc(objects::CPubdesc &pubdesc, const string &value, objects::edit::EExistingText existing_text)

virtual bool x_ValidArguments() const

Tests the number and the type of function arguments.

void x_SetObjects_Affil(objects::CPub &pub, CObjectInfo &pub_var)

static CMQueryNodeValue::TObs s_GetPubVolIssuePagesDateObjects(CPubdesc &pubdesc, const string &field)

virtual bool x_ValidArguments() const

Tests the number and the type of function arguments.

static string s_GetStatus(const objects::CPubdesc &pubdesc)

void SetObjects(const TObs &obs)

virtual void TheFunction()

Function implementation.

static const char * sm_PubPages

static CRef< objects::CPub > s_GetArticleFromEntrezById(TEntrezId pmid, bool asn_format=false)

static CRef< CSeqdesc > s_MakeNewPubdesc(CRef< CPub > &new_pub, TEntrezId pmid)

static EActionType GetActionType(const string &descr)

static const char * sm_FuncIssue

void x_GetObjectsForPubField_Journal(const objects::CPub &pub, const CObjectInfo &pub_var, CMQueryNodeValue::TObs &objs)

void x_AddAuthor(objects::CAuth_list &auth_list, objects::edit::EExistingText existing_text)

static bool s_MoveMiddleToFirst(objects::CName_std &name)

static CObjectInfo s_GetRelevantObjectInfoForPub(const CPub &pub, const CObjectInfo &pub_var)

CIRef< IMacroBioDataIter > m_DataIter

SStaticPair< const char *, CMacroFunction_AuthorFix::EActionType > TAuthorFixPair

static CPubFieldType::EPubFieldStatus s_GetStatusEnum(const objects::CPub &pub)

void x_SetVolIssuePagesInPubdesc(objects::CPubdesc &pubdesc, const string &value, objects::edit::EExistingText existing_text)

static const char * sm_PubClass

virtual void TheFunction()

Function implementation.

static bool x_SetStatus(objects::CPub &pub, CPubFieldType::EPubFieldStatus status)

virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)

Set object to copy of another one.

virtual const CTypeInfo * GetThisTypeInfo(void) const =0

static const TObjectType * SafeCast(TTypeInfo type)

#define MSerial_AsnText

I/O stream manipulators –.

virtual bool Equals(const CSerialObject &object, ESerialRecursionMode how=eRecursive) const

Check if both objects contain the same values.

@ ePrimitiveValueString

string|char*|const char*

@ ePrimitiveValueInteger

(signed|unsigned) (char|short|int|long)

bool Valid(void) const

Is iterator valid.

CElementIterator BeginElements(void) const

Create container elements iterator.

TMemberIndex GetMemberIndex(void) const

Get index of the member in the class.

pair< TObjectPtr, TTypeInfo > ObjectInfo(C &obj)

CObjectInfo GetPointedObject(void) const

Get data and type information of object to which this type refers.

CObjectInfo GetElement(void) const

Get element data and type information.

CMemberIterator BeginMembers(void) const

Create class member iterator.

TObjectPtr GetObjectPtr(void) const

Get pointer to object.

CObjectInfo GetMember(void) const

Get class member data.

TMemberIndex GetCurrentChoiceVariantIndex(void) const

Get index of currently selected choice variant.

CChoiceVariant GetCurrentChoiceVariant(void) const

Get data and type information of selected choice variant.

int GetPrimitiveValueInt(void) const

Get data as int.

CObjectInfo GetVariant(void) const

Get variant data.

bool Valid(void) const

Is iterator valid.

ETypeFamily GetTypeFamily(void) const

Get data type family.

void GetPrimitiveValueString(string &value) const

Get string data.

CMemberIterator FindClassMember(const string &memberName) const

Find class member by its name.

const string & GetName(void) const

Get type name.

void SetPrimitiveValueInt(int value)

EPrimitiveValueType GetPrimitiveValueType(void) const

Get type of primitive value.

bool IsSet(void) const

Is member assigned a value.

CBioseq_Handle GetBioseqHandle(const CSeq_id &id)

Get bioseq handle by seq-id.

TClass GetClass(void) const

CBioseq_set_Handle GetParentBioseq_set(void) const

Return a handle for the parent Bioseq-set, or null handle.

CSeq_id_Handle GetAccessSeq_id_Handle(void) const

Get any CSeq_id_Handle handle that can be used to access this bioseq Use GetSeq_id_Handle() if it's n...

CSeq_entry_Handle GetSeq_entry_Handle(void) const

Get parent Seq-entry handle.

CBioseq_set_Handle GetParentBioseq_set(void) const

Return a handle for the parent Bioseq-set, or null handle.

CSeq_entry_Handle GetParentEntry(void) const

Return a handle for the parent seq-entry of the bioseq.

bool IsSetClass(void) const

TObjectType * GetPointer(void) const THROWS_NONE

Get pointer,.

CRef< C > Ref(C *object)

Helper functions to get CRef<> and CConstRef<> objects.

TObjectType * GetPointer(void) THROWS_NONE

Get pointer,.

void Reset(void)

Reset reference object.

int32_t Int4

4-byte (32-bit) signed integer

int64_t Int8

8-byte (64-bit) signed integer

#define END_NCBI_SCOPE

End previously defined NCBI scope.

#define USING_SCOPE(ns)

Use the specified namespace.

#define END_SCOPE(ns)

End the previously defined scope.

#define BEGIN_NCBI_SCOPE

Define ncbi namespace.

#define BEGIN_SCOPE(ns)

Define a new scope.

static string Int8ToString(Int8 value, TNumToStringFlags flags=0, int base=10)

Convert Int8 to string.

static int StringToInt(const CTempString str, TStringToNumFlags flags=0, int base=10)

Convert string to int.

static Int8 StringToInt8(const CTempString str, TStringToNumFlags flags=0, int base=10)

Convert string to Int8.

static list< string > & Split(const CTempString str, const CTempString delim, list< string > &arr, TSplitFlags flags=0, vector< SIZE_TYPE > *token_pos=NULL)

Split a string using specified delimiters.

static bool EndsWith(const CTempString str, const CTempString end, ECase use_case=eCase)

Check if a string ends with a specified suffix value.

static bool IsBlank(const CTempString str, SIZE_TYPE pos=0)

Check if a string is blank (has no text).

static void TruncateSpacesInPlace(string &str, ETrunc where=eTrunc_Both)

Truncate whitespace in a string (in-place)

static string IntToString(int value, TNumToStringFlags flags=0, int base=10)

Convert int to string.

static bool EqualCase(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2)

Case-sensitive equality of a substring with another string.

static bool StartsWith(const CTempString str, const CTempString start, ECase use_case=eCase)

Check if a string starts with a specified prefix value.

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

@ fConvErr_NoThrow

Do not throw an exception on error.

@ eTrunc_End

Truncate trailing whitespace only.

@ eNocase

Case insensitive compare.

@ eCase

Case sensitive compare.

CTime CurrentTime(CTime::ETimeZone tz=CTime::eLocal, CTime::ETimeZonePrecision tzp=CTime::eTZPrecisionDefault)

bool IsProc(void) const

Check if variant Proc is selected.

void SetBook(TBook &value)

Assign a value to Book data member.

const TBook & GetBook(void) const

Get the Book member data.

bool IsSetAuthors(void) const

Check if a value has been assigned to Authors data member.

bool IsSetAuthors(void) const

authors (ANSI requires) Check if a value has been assigned to Authors data member.

const TJournal & GetJournal(void) const

Get the variant data.

void SetAuthors(TAuthors &value)

Assign a value to Authors data member.

const TFrom & GetFrom(void) const

Get the From member data.

const TCit & GetCit(void) const

Get the Cit member data.

void ResetNames(void)

Reset Names data member.

void SetName(TName &value)

Assign a value to Name data member.

void SetAffil(TAffil &value)

Assign a value to Affil data member.

bool IsSetFrom(void) const

Check if a value has been assigned to From data member.

void SetAuthors(TAuthors &value)

Assign a value to Authors data member.

bool IsSetAuthors(void) const

not necessarily authors of the paper Check if a value has been assigned to Authors data member.

const TName & GetName(void) const

Get the Name member data.

void SetAuthors(TAuthors &value)

Assign a value to Authors data member.

void ResetPrepub(void)

Reset Prepub data member.

bool IsSetCit(void) const

anything, not parsable Check if a value has been assigned to Cit data member.

const TProc & GetProc(void) const

Get the variant data.

list< CRef< CAuthor > > TStd

void SetCit(TCit &value)

Assign a value to Cit data member.

void ResetCit(void)

Reset Cit data member.

bool IsSetNames(void) const

Check if a value has been assigned to Names data member.

void SetCit(const TCit &value)

Assign a value to Cit data member.

void SetNames(TNames &value)

Assign a value to Names data member.

void SetAuthors(TAuthors &value)

Assign a value to Authors data member.

bool IsSetName(void) const

Author, Primary or Secondary Check if a value has been assigned to Name data member.

bool IsSet(void) const

Check if a value has been assigned to data member.

bool IsBook(void) const

Check if variant Book is selected.

bool IsJournal(void) const

Check if variant Journal is selected.

const TNames & GetNames(void) const

Get the Names member data.

bool IsMl(void) const

Check if variant Ml is selected.

const TStd & GetStd(void) const

Get the variant data.

void SetPrepub(TPrepub value)

Assign a value to Prepub data member.

const TMl & GetMl(void) const

Get the variant data.

const Tdata & Get(void) const

Get the member data.

void SetAuthors(TAuthors &value)

Assign a value to Authors data member.

Tdata & Set(void)

Assign a value to data member.

bool IsStd(void) const

Check if variant Std is selected.

const TBook & GetBook(void) const

Get the variant data.

@ e_not_set

No variant selected.

@ ePrepub_in_press

accepted, not published

void SetYear(TYear value)

Assign a value to Year data member.

void ResetLast(void)

Reset Last data member.

void SetInitials(const TInitials &value)

Assign a value to Initials data member.

bool IsSetSuffix(void) const

Jr, Sr, III Check if a value has been assigned to Suffix data member.

void ResetInitials(void)

Reset Initials data member.

const TInitials & GetInitials(void) const

Get the Initials member data.

void ResetFirst(void)

Reset First data member.

bool IsName(void) const

Check if variant Name is selected.

void SetLast(const TLast &value)

Assign a value to Last data member.

void SetFirst(const TFirst &value)

Assign a value to First data member.

bool IsSetInitials(void) const

first + middle initials Check if a value has been assigned to Initials data member.

TConsortium & SetConsortium(void)

Select the variant.

bool IsSetLast(void) const

Check if a value has been assigned to Last data member.

void SetSuffix(const TSuffix &value)

Assign a value to Suffix data member.

TName & SetName(void)

Select the variant.

TYear GetYear(void) const

Get the Year member data.

const TFirst & GetFirst(void) const

Get the First member data.

const TLast & GetLast(void) const

Get the Last member data.

bool IsSetFirst(void) const

Check if a value has been assigned to First data member.

const TStd & GetStd(void) const

Get the variant data.

void ResetSuffix(void)

Reset Suffix data member.

EPublication_field

publication fields

@ ePublication_field_affiliation

@ ePublication_field_pages

@ ePublication_field_pmid

@ ePublication_field_pub_class

@ ePublication_field_issue

@ ePublication_field_date

@ ePublication_field_title

@ ePublication_field_serial_number

@ ePublication_field_authors

@ ePublication_field_volume

@ ePublication_field_journal

bool IsPmid(void) const

Check if variant Pmid is selected.

TProc & SetProc(void)

Select the variant.

TPmid & SetPmid(void)

Select the variant.

TBook & SetBook(void)

Select the variant.

const TArticle & GetArticle(void) const

Get the variant data.

bool IsSet(void) const

Check if a value has been assigned to data member.

const Tdata & Get(void) const

Get the member data.

void Select(E_Choice index, EResetVariant reset=eDoResetVariant)

Select the requested variant if needed.

E_Choice Which(void) const

Which variant is currently selected.

TMan & SetMan(void)

Select the variant.

TSub & SetSub(void)

Select the variant.

bool IsSub(void) const

Check if variant Sub is selected.

virtual void Reset(void)

Reset the whole object.

TGen & SetGen(void)

Select the variant.

const TGen & GetGen(void) const

Get the variant data.

TPatent & SetPatent(void)

Select the variant.

bool IsArticle(void) const

Check if variant Article is selected.

TArticle & SetArticle(void)

Select the variant.

bool IsGen(void) const

Check if variant Gen is selected.

bool IsMan(void) const

Check if variant Man is selected.

@ e_Pat_id

identify a patent

@ e_Gen

general or generic unparsed

@ e_Proc

proceedings of a meeting

@ e_Equiv

to cite a variety of ways

@ e_Man

manuscript, thesis, or letter

@ eClass_nuc_prot

nuc acid and coded proteins

void SetPub(TPub &value)

Assign a value to Pub data member.

TPub & SetPub(void)

Select the variant.

virtual void Reset(void)

Reset the whole object.

bool IsSetPub(void) const

the citation(s) Check if a value has been assigned to Pub data member.

const TPub & GetPub(void) const

Get the Pub member data.

@ e_Pub

a reference to the publication

@ eMol_na

just a nucleic acid

const TCit & GetCit(void) const

Get the Cit member data.

void SetCit(TCit &value)

Assign a value to Cit data member.

bool IsSetCit(void) const

citation for this submission Check if a value has been assigned to Cit data member.

where boath are integers</td > n< td ></td > n</tr > n< tr > n< td > tse</td > n< td > optional</td > n< td > String</td > n< td class=\"description\"> TSE option controls what blob is orig

Functions that resolve field names described in asn format.

constexpr bool empty(list< Ts... >) noexcept

const GenericPointer< typename T::ValueType > T2 value

Utility macros and typedefs for exploring NCBI objects from pub.asn.

#define EDIT_EACH_PUB_ON_PUBEQUIV(Itr, Var)

string GetFirstInitial(string input, bool skip_rest)

CRef< CPub > journal(ParserPtr pp, char *bptr, char *eptr, CRef< CAuth_list > &auth_list, CRef< CTitle::C_E > &title, bool has_muid, CRef< CCit_art > &cit_art, Int4 er)

static const char delimiter[]

static SLJIT_INLINE sljit_ins msg(sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b)

@ eExistingText_append_none

@ eExistingText_prefix_none

@ eExistingText_replace_old

bool AddValueToString(string &str, const string &value, EExistingText existing_text)

Add text to an existing string, using the "existing_text" directive to combine new text with existing...

Template structure SStaticPair is simlified replacement of STL pair<> Main reason of introducing this...


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4