/*
-Copyright (c) 2005-2008, John Hurst
+Copyright (c) 2005-2009, John Hurst
All rights reserved.
Redistribution and use in source and binary forms, with or without
{
fprintf(stream, "\n\
%s (asdcplib %s)\n\n\
-Copyright (c) 2005-2008 John Hurst\n\
+Copyright (c) 2005-2009 John Hurst\n\
%s is part of the asdcplib DCP tools package.\n\
asdcplib may be copied only under the terms of the license found at\n\
the top of every file in the asdcplib distribution kit.\n\n\
Specify the -h (help) option for further information about %s\n\n",
- PROGRAM_NAME, ASDCP::Version(), PROGRAM_NAME, PROGRAM_NAME);
+ PROGRAM_NAME, Kumu::Version(), PROGRAM_NAME, PROGRAM_NAME);
}
bool verbose_flag; // true if the verbose option was selected
bool version_flag; // true if the version display option was selected
bool help_flag; // true if the help display option was selected
- const char* filename; // filename to be processed
- const char* write_filename; // filename to write with val_write_flag
+ std::string filename; // filename to be processed
+ std::string write_filename; // filename to write with val_write_flag
ui32_t chunk_count;
MajorMode_t mode; // MajorMode selector
//
CommandOptions(int argc, const char** argv) :
- error_flag(true), order(""), verbose_flag(false), version_flag(false), help_flag(false),
- filename(""), write_filename(""), chunk_count(0), mode(MMT_VALIDATE)
+ error_flag(true), order(""), verbose_flag(false),
+ version_flag(false), help_flag(false),
+ chunk_count(0), mode(MMT_VALIDATE)
{
// order = "rand";
case 'c':
mode = MMT_CREATE;
TEST_EXTRA_ARG(i, 'c');
- chunk_count = atoi(argv[i]);
+ chunk_count = Kumu::xabs(strtol(argv[i], 0, 10));
break;
case 'V': version_flag = true; break;
{
if (argv[i][0] != '-' )
{
- if ( filename != "" )
+ if ( ! filename.empty() )
{
fprintf(stderr, "Extra filename found: %s\n", argv[i]);
return;
if ( help_flag || version_flag )
return;
- if ( strlen ( filename ) == 0 )
+ if ( filename.empty() )
{
fprintf(stderr, "Filename required.\n");
return;
if ( strcmp(order, "") == 0 )
order = "rand";
- if ( strcmp ( filename, write_filename ) == 0 )
+ if ( filename == write_filename )
{
fprintf(stderr, "Output and input files must be different.\n");
return;
Result_t
ReadValidateWriteLargeFile(CommandOptions& Options)
{
- assert(Options.write_filename);
+ assert(!Options.write_filename.empty());
ui32_t check_total = 0;
ui32_t write_total = 0;
ui32_t read_count = 0;