### Auxiliary Classes

The Test Framework defines two auxiliary classes: ITieredTextBuffer and IArgumentDictionary.

#### ITieredTextBuffer

ITieredTextBuffer behaves like the C++ ostream class. It contains << operators for all basic types. It can filter output so that detailed information is suppressed or displayed. The text is printed directly to the console (and log file, if the log option is specified). Each instance of itest contains a ITieredTextBuffer to which subclasses may stream diagnostic text messages. ITest itself uses this mechanism to report progress and results.

#### IArgumentDictionary

IArgumentDictionary is a general-purpose class for parsing text arguments on a command line. It takes as input an ordered collection of IString objects and parses them as arguments on a command line into pairs of keys and values. This allows you to quickly check for the existence of a keyword on the command line or to retrieve the value given for a certain option.

A leading-hyphen character identifies keywords. Anything without a leading hyphen is a value argument. A keyword picks up the following argument if it is not another keyword.

This example shows how IArgumentDictionary parses the command-line input to a test to create the key-value pairs:

    -parm -n sample1 Joan Tom -ccc 84 85

The following table explains the options used in the example.

Key | Value | Description
-parm |  | The value associated with -parm is an empty IText, not NIL. This allows you to distinguish "There is no -parm keyword" from "There is a -parm argument with no associated value."
-n | sample1 | The -n argument picks up the following argument, "sample1," as its value.
1 | Joan | There is no associated keyword, so "Joan" is assigned key 1. The key is an IText object, not a numeric value.
2 | Tom | There is no associated keyword, so "Tom" is assigned key 2. The key is an IText object, not a numeric value.
-ccc | 84 | The -ccc argument picks up the following argument, "84," as its value.
3 | 85 | There is no associated keyword, so "85" is assigned key 3. The key is an IText object, not a numeric value.

You also may specify, with the specifyNakedOptions function, that certain keywords never take value arguments. Such keywords are called naked options. Here is another example:

     -s 20 -l -o sampout

The following table explains the options used in the example.

Key | Value | Description
-s | 20 | The -s argument picks up the following argument, "20," as its value. The value must be between 1 and 256.
-l |  | The -l represens the loging option, which takes no arguments. If a value follows the -l, the value is taken to be a keyless option and is assigned the key 1. The key is an IText object, not a numeric value.
-o | sampout | The -o represents the output-file option, which takes a single argument.