arg_desc->SetUsageContext(
"",
"Retrieve publications data from PubMed and display in ASN");
61arg_desc->AddOptionalKey(
"url",
"url",
"eutils base URL (http://eutils.ncbi.nlm.nih.gov/entrez/eutils/ by default)",
CArgDescriptions::eString);
64arg_desc->AddFlag(
"stats",
"Only print execution statistics");
72vector<TEntrezId> pmids;
75 TIntId id= args[
"id"].AsIntId();
79cerr <<
"Warning: Invalid ID: "<<
id<< endl;
81}
else if(args[
"ids"]) {
84 for(
stringid_str : ids) {
89cerr <<
"Warning: Invalid ID: "<< id_str << endl;
92}
else if(args[
"idfile"]) {
97 if(id_str.empty() || id_str.front() ==
'#') {
104cerr <<
"Warning: Invalid ID: "<< id_str << endl;
108cerr <<
"Error: One of -id, -ids, or -idfile must be specified."<< endl;
113cerr <<
"Warning: No PMIDs specified"<< endl;
119ostream*
output=
nullptr;
121 output= &args[
"o"].AsOutputFile();
129 stringurl = args[
"url"].AsString();
130upd->SetBaseURL(url);
133 boolbstats = args[
"stats"];
143 CRef<CPub>pub(upd->GetPubmedEntry(pmid, &err));
150cerr <<
"Error: "<< err << endl;
153cerr <<
"CException: "<< e.
what() << endl;
159*
output<<
" * Number of runs: "<< nruns << endl;
160*
output<<
" * successful: "<< ngood << endl;
161*
output<<
" * Elapsed time: "<<
sw<< endl;
165args[
"o"].CloseFile();
172 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.
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.
#define ENTREZ_ID_FROM(T, value)
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)
@ eIntId
Convertible to TIntId (int or Int8 depending on NCBI_INT8_GI)
@ eString
An arbitrary string.
@ eOutputFile
Name of file (must be writable)
virtual const char * what(void) const noexcept
Standard report (includes full backlog).
#define MSerial_AsnText
I/O stream manipulators â.
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::istream CNcbiIstream
Portable alias for istream.
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 TNumeric StringToNumeric(const CTempString str, TStringToNumFlags flags=0, int base=10)
Convert string to a numeric value.
static void TruncateSpacesInPlace(string &str, ETrunc where=eTrunc_Both)
Truncate whitespace in a string (in-place)
@ fConvErr_NoThrow
Do not throw an exception on error.
void Stop(void)
Suspend the timer.
void Start(void)
Start the timer.
#define NCBI_SC_VERSION_PROXY
#define NCBI_TEAMCITY_BUILD_NUMBER_PROXY
Defines the CNcbiApplication and CAppException classes for creating NCBI applications.
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