dump_cm_list(
CNcbiOstream& os,
constvector<SCitMatch>& cm_list)
49 for(
const auto& cm : cm_list) {
50 if(! cm.Journal.empty()) {
51os <<
"Journal="<< cm.Journal << endl;
53 if(! cm.Volume.empty()) {
54os <<
"Volume="<< cm.Volume << endl;
56 if(! cm.Page.empty()) {
57os <<
"Page="<< cm.Page << endl;
59 if(! cm.Year.empty()) {
60os <<
"Year="<< cm.Year << endl;
62 if(! cm.Author.empty()) {
63os <<
"Author="<< cm.Author << endl;
65 if(! cm.Issue.empty()) {
66os <<
"Issue="<< cm.Issue << endl;
68 if(! cm.Title.empty()) {
69os <<
"Title="<< cm.Title << endl;
72os <<
"InPress="<< cm.InPress << endl;
78 voidread_cm_list(
CNcbiIstream& is, vector<SCitMatch>& cm_list)
81unique_ptr<SCitMatch> cm;
87cm_list.push_back(*cm);
148arg_desc->SetUsageContext(
"",
"Match publications from PubMed and print Ids");
151arg_desc->AddOptionalKey(
"url",
"url",
"eutils base URL (http://eutils.ncbi.nlm.nih.gov/entrez/eutils/ by default)",
CArgDescriptions::eString);
153arg_desc->AddFlag(
"stats",
"Also print execution statistics");
161vector<SCitMatch> cm_list;
163read_cm_list(is, cm_list);
165 if(cm_list.empty()) {
166cerr <<
"Warning: No input data"<< endl;
170ostream*
output=
nullptr;
172 output= &args[
"o"].AsOutputFile();
180 stringurl = args[
"url"].AsString();
181upd->SetBaseURL(url);
184 boolbstats = args[
"stats"];
188 results.reserve(cm_list.size());
196 TEntrezIdpmid = upd->CitMatch(cm, &err);
202oss <<
"Error: "<< err;
216*
output<<
" * Number of runs: "<< nruns << endl;
217*
output<<
" * successful: "<< ngood << endl;
218*
output<<
" * Elapsed time: "<<
sw<< endl;
222args[
"o"].CloseFile();
229 int main(
intargc,
const char* argv[])
int Run() override
Run the application.
void Init() override
Initialize the application.
CPubmedFetchApplication()
static SQLCHAR output[256]
SStrictId_Entrez::TId TEntrezId
TEntrezId type for entrez ids which require the same strictness as TGi.
#define ENTREZ_ID_TO(T, entrez_id)
virtual const CArgs & GetArgs(void) const
Get parsed command line arguments.
int AppMain(int argc, const char *const *argv, const char *const *envp=0, EAppDiagStream diag=eDS_Default, const char *conf=NcbiEmptyCStr, const string &name=NcbiEmptyString)
Main function (entry point) for the NCBI application.
virtual void SetupArgDescriptions(CArgDescriptions *arg_desc)
Setup the command line argument descriptions.
void SetVersion(const CVersionInfo &version)
Set the version number for the program.
@ fHidden
Hide it in Usage.
@ eInputFile
Name of file (must exist and be readable)
@ eString
An arbitrary string.
@ eOutputFile
Name of file (must be writable)
virtual const char * what(void) const noexcept
Standard report (includes full backlog).
CNcbiIstream & NcbiGetlineEOL(CNcbiIstream &is, string &str, string::size_type *count=NULL)
Read from "is" to "str" the next line (taking into account platform specifics of End-of-Line)
IO_PREFIX::ostream CNcbiOstream
Portable alias for ostream.
IO_PREFIX::istream CNcbiIstream
Portable alias for istream.
static bool SplitInTwo(const CTempString str, const CTempString delim, string &str1, string &str2, TSplitFlags flags=0)
Split a string into two pieces using the specified delimiters.
static string Sanitize(CTempString str, TSS_Flags flags=fSS_print)
Sanitize a string, allowing only specified classes of characters.
static bool EqualNocase(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2)
Case-insensitive equality of a substring with another string.
void Stop(void)
Suspend the timer.
void Start(void)
Start the timer.
const struct ncbi::grid::netcache::search::fields::KEY key
#define NCBI_SC_VERSION_PROXY
#define NCBI_TEAMCITY_BUILD_NUMBER_PROXY
Defines the CNcbiApplication and CAppException classes for creating NCBI applications.
double r(size_t dimension_, const Int4 *score_, const double *prob_, double theta_)
int main(int argc, const char *argv[])
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