#include <cstdio>
#include <fstream>
#include "defs.h"
#include "encodings.h"
#include "exaltcodec.h"
#include "list.h"
#include "options.h"
Go to the source code of this file.
Defines | |
#define | PRINT_VERSION |
Display the program version. More... | |
#define | OPT(_x_) !strcmp(argv[i], (_x_)) |
Test if the current command line argument matches with specified option. More... | |
#define | OPT_ERROR(_i_) |
Report an error when an option without required argument occurs. More... | |
#define | OPT_UNKNOWN(_opt_) |
Report unknown option. More... | |
#define | OPT_NONE |
Report an error when no input files have been specified. More... | |
#define | ENCODING_UNKNOWN(_name_) |
Report unknown encodings. More... | |
#define | SET_OUTPUT_ENCODING(_enc_) |
Set output encoding. More... | |
#define | ENCODE_DECODE(_action_) |
Perform compression/decompression based on the given parameter. More... | |
Functions | |
int | testFileNameSuffix (const char *str, const char *suf) |
Test if the file name ends with given suffix. More... | |
void | usage (void) |
Print basic program usage. | |
int | main (int argc, char **argv) |
The main program. More... |
The main() function parses the command line options, constructs an exalt codec, and starts (de)compression.
Definition in file main.cpp.
|
Perform compression/decompression based on the given parameter.
Definition at line 139 of file main.cpp. Referenced by main. |
|
Value: { \ ERR("Unknown encoding: '" << _name_ << "'."); \ throw ExaltUnknownEncodingException(); \ }
|
|
Test if the current command line argument matches with specified option.
Definition at line 54 of file main.cpp. Referenced by main. |
|
Value: { \ ERR("'" << argv[_i_-1] << "' requires an argument"); \ throw ExaltOptionException(); \ }
Definition at line 63 of file main.cpp. Referenced by main. |
|
Value: { \ ERR("No input files specified."); \ throw ExaltOptionException(); \ }
|
|
Value: { \ ERR("Unknown option: '" << _opt_ << "'."); \ throw ExaltOptionException(); \ }
Definition at line 76 of file main.cpp. Referenced by main. |
|
Value: { \ OUTPUTNL("This is " << PACKAGE \ << ", XML data compressor."); \ OUTPUTNL("Version " << VERSION << ", build date: " \ << __DATE__); \ OUTPUTNL("Built against expat " << EXPAT_VERSION); \ OUTPUTNL("Copyright 2002 Vojtech Toman"); \ }
Definition at line 38 of file main.cpp. Referenced by main. |
|
Value: { \ size_t j = 0; \ Encodings::MIB mib = Encodings::Unknown; \ \ while (encodingNames[j].name) \ { \ if (!strcmp(_enc_, encodingNames[j].name)) \ mib = encodingNames[j].mib; \ j++; \ } \ if (mib != Encodings::Unknown) \ encodingMIB = mib; \ else \ { \ ENCODING_UNKNOWN(_enc_); \ } \ }
Definition at line 113 of file main.cpp. Referenced by main. |
|
The main program.
Function parses the command line options, constructs an exalt codec, and starts (de)compression.
Definition at line 271 of file main.cpp. References ExaltOptions::AdaptiveModel, List::append, Compress, DBG, Decompress, DEFAULT_FILE_SUFFIX, DEFAULT_OUTPUT_ENCODING, DELETE, ENCODE_DECODE, ExaltOptions::Encoding, ENCODING_NAMES, ERR, List::first, Collection::isEmpty, LIST_ENCODINGS, ExaltOptions::Model, NEW, List::next, ExaltOptions::No, OPT, OPT_ERROR, OPT_UNKNOWN, OUTPUTEENDLINE, OUTPUTENDLINE, OUTPUTENL, OUTPUTNL, PRINT_VERSION, ExaltOptions::PrintGrammar, ExaltOptions::PrintModels, ExaltOptions::resetOptions, SET_OUTPUT_ENCODING, ExaltOptions::setOption, ExaltOptions::SimpleModel, testFileNameSuffix, usage, UserAction, ExaltOptions::Verbose, and ExaltOptions::Yes. |
|
Test if the file name ends with given suffix.
Definition at line 201 of file main.cpp. Referenced by main. |