27 using namespace basis;
40 #define console program_wide_logger::get()
45 Usage:\n\t%s filename [filename]\n\n\
46 Prints out (on standard output) a abyte dump of the files specified.\n\n",
47 program_name), ALWAYS_PRINT);
51 int main(
int argc,
char *argv[])
57 int current_parameter = 0;
69 bool past_first_file =
false;
70 while (++current_parameter < argc) {
71 if (past_first_file) {
73 console.log(astring::empty_string(), ALWAYS_PRINT);
74 console.log(astring::empty_string(), ALWAYS_PRINT);
76 past_first_file =
true;
77 astring name = argv[current_parameter];
79 if (!current.
good()) {
86 bool printed_header =
false;
87 int current_label = 0;
90 if (bytes_read <= 0)
break;
92 if (!printed_header) {
93 console.log(name +
":", ALWAYS_PRINT);
94 console.log(astring::empty_string(), ALWAYS_PRINT);
95 printed_header =
true;
97 astring to_log = byte_formatter::text_dump(buff, bytes_read,
99 if (to_log[to_log.
end()] ==
'\n')
101 console.log(to_log, ALWAYS_PRINT);
102 current_label += bytes_read;
int main(int argc, char *argv[])
int print_instructions_and_exit(char *program_name)
const int MAXIMUM_BYTEDUMP_BUFFER_SIZE
HOOPLE_STARTUP_CODE;.
Provides a dynamically resizable ASCII character string.
virtual void zap(int start, int end)
Deletes the characters between "start" and "end" inclusively.
int end() const
returns the index of the last (non-null) character in the string.
Provides file managment services using the standard I/O support.
int read(basis::abyte *buffer, int buffer_size)
reads "buffer_size" bytes from the file into "buffer".
bool good()
returns true if the file seems to be in the appropriate desired state.
#define SETUP_CONSOLE_LOGGER
< a macro that retasks the program-wide logger as a console_logger.
Provides macros that implement the 'main' program of an application.
Implements an application lock to ensure only one is running at once.
The guards collection helps in testing preconditions and reporting errors.
unsigned char abyte
A fairly important unit which is seldom defined...
A platform independent way to obtain the timestamp of a file.
A logger that sends to the console screen using the standard output device.
A dynamic container class that holds any kind of object via pointers.