Main program.
This code tests reading and writing of binary data. And it performs some tests on the byte swapping facilities.
244 "usage: fortraniotest [-v] [-c] [-s] [-C]" "\n" 245 " [-w [file]] [-r [file]]" "\n" 246 " or: fortraniotest --help|-h" "\n" 254 "-c check byte size of data types" "\n" 255 "-s test byte swapping" "\n" 256 "-C tell us about the CPU model" "\n" 257 "-w [file] write to file" "\n" 258 "-r [file] read from file" "\n" 286 cerr << usage_text << endl;
294 if (cmdline.optset(0))
296 cerr << usage_text << endl;
297 cerr << help_text << endl;
301 bool verbose=cmdline.optset(1);
302 bool check_size=cmdline.optset(2);
303 bool byte_swapping=cmdline.optset(3);
304 bool tell_CPU=cmdline.optset(4);
305 bool write_file=cmdline.optset(5);
306 std::string outfile=cmdline.string_arg(5);
307 bool read_file=cmdline.optset(6);
308 std::string infile=cmdline.string_arg(6);
313 cout <<
"NOTICE: check_assumed_size() no longer exists!" 315 <<
" and the even better news: there is no need for it" 329 if (read_file)
read_data(infile, verbose);
void write_data(const std::string &name, const bool &verbose=false)
write test data
#define FORTRANIOTEST_VERSION
#define SWAPIT(T)
Macro function to preform easy to use swap check.
Namespace containing all components of module commandline. ,.
Evaluates commandline by calling long_getopt. ,You may instantiate a Commandline object by passing th...
option may have an optional argument
struct to define options ,This struct is used to define a list of options. An example is: ...
void cpu_type()
Ask for CPU type and print result.
void read_data(const std::string &name, const bool &verbose=false)
read test data