53 virtual void Init(
void);
54 virtual int Run(
void);
55 virtual void Exit(
void);
69 arg_desc->SetUsageContext(
GetArguments().GetProgramBasename(),
70 "Dump the contents of an ASN cache index.\n"
71 "The output consists of seq-id, version, "
72 "GI and sequnece length.");
74 arg_desc->AddKey(
"cache",
"Database",
75 "Path to ASN.1 cache",
78 arg_desc->AddDefaultKey(
"o",
"GIOutputFile",
79 "If supplied, the list of seq IDs is written here.",
83 arg_desc->AddFlag(
"no-timestamp",
"Omit timestamp from output");
97 if (! args[
"no-timestamp"]) {
104 CDir cache_dir( args[
"cache"].AsString() );
105 if (! cache_dir.
Exists() ) {
108 }
else if ( ! cache_dir.
IsDir() ) {
110 <<
"valid cache path!" );
117 cache_stats.
DumpSeqIds( args[
"o"].AsOutputFile() );
137 int main(
int argc,
const char* argv[])
Contains the class definiton for CAsnCache, the main client class for accessing the ASN cache data.
virtual void Init(void)
Initialize the application.
virtual void Exit(void)
Cleanup on application exit.
virtual int Run(void)
Run the application.
void DumpSeqIds(CNcbiOstream &stream) const
CAsnCache is used by clients to access the ASN cache data.
int main(int argc, const char *argv[])
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.
const CNcbiArguments & GetArguments(void) const
Get the application's cached unprocessed command-line arguments.
@ eInputFile
Name of file (must exist and be readable)
@ eOutputFile
Name of file (must be writable)
#define ERR_POST(message)
Error posting with file, line number information but without error codes.
void SetDiagStream(CNcbiOstream *os, bool quick_flush=true, FDiagCleanup cleanup=0, void *cleanup_data=0, const string &stream_name="")
Set diagnostic stream.
void Error(CExceptionArgs_Base &args)
virtual bool Exists(void) const
Check if directory "dirname" exists.
bool IsDir(EFollowLinks follow=eFollowLinks) const
Check whether a directory entry is a directory.
const string & GetPath(void) const
Get entry path.
void Start(void)
Start the timer.
Defines the CNcbiApplication and CAppException classes for creating NCBI applications.
Defines command line argument related classes.
Defines unified interface to application:
Defines classes: CDirEntry, CFile, CDir, CSymLink, CMemoryFile, CFileUtil, CFileLock,...