35 using namespace basis;
45 #define LOG(s) CLASS_EMERGENCY_LOG(program_wide_logger::get(), s)
55 int test_command_line::execute()
59 LOG(
"these are the commands we got passed...");
61 for (
int i = 0; i < cmds.
length(); i++) {
69 log(
astring(
"got a program name of: [") + prog.dirname() +
astring(
"] ")
72 for (
int i = 0; i < cl1.entries(); i++) {
74 log(
astring(astring::SPRINTF,
"%d: type=%s text=%s", i,
86 astring cmd_line =
"tossedout spumeco -g -q --fleem -r -- spugnats.txt crumbole.h";
139 critical_events::alert_message(
astring(class_name()) +
": works for those functions tested.");
The application_shell is a base object for console programs.
static structures::string_array get_command_line()
returns the command line passed to the program as a list of strings.
const basis::astring & text() const
observes the string contents.
parameter_types type() const
observes the type of the parameter.
a_sprintf is a specialization of astring that provides printf style support.
int length() const
Returns the current reported length of the allocated C array.
Provides a dynamically resizable ASCII character string.
const char * s() const
synonym for observe. the 's' stands for "string", if that helps.
Provides operations commonly needed on file names.
An array of strings with some additional helpful methods.
#define non_continuable_error(c, f, i)
an extra piece of information used, if available, in bounds_halt below.
#define DEFINE_CLASS_NAME(objname)
Defines the name of a class by providing a couple standard methods.
#define FUNCDEF(func_in)
FUNCDEF sets the name of a function (and plugs it into the callstack).
Provides macros that implement the 'main' program of an application.
#define HOOPLE_MAIN(obj_name, obj_args)
options that should work for most unix and linux apps.
Implements an application lock to ensure only one is running at once.
The guards collection helps in testing preconditions and reporting errors.
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.
Useful support functions for unit testing, especially within hoople.