Library or Application Framework?

Rogus McBogus can be used as either a library or an application framework. Basically, the difference is that when you use Rogus as a library, you supply your own main() or WinMain() function, but when you use Rogus as an application framework, you only need to supply your parser code. If you like, you can think of the Rogus application framework as a library that includes a rather general-purpose example application.

Using Rogus as a Library

If you want to use Rogus McBogus as a library, you need to initialize Rogus at the beginning of your program, and have it clean up at the end. You do this by creating a Rogus_McBogus object. Its constructor handles initialization, and its destructor handles cleanup.

When you use Rogus as a library, be sure to remember to define the global variables default_input, default_output, and statistics_on. (See below)

Using Rogus as an Application Framework

If you want to use Rogus McBogus as an application framework, you need to put the source file "Rogus McBogus main.cpp" into your project. When the program runs, it will create a menu of parsers which you have registered with ParserRegistration objects.

To make sure that your parsers get linked in, you should reference them from the file "fooFinder.cpp". Also, there are three preference variables in "fooFinder.cpp" which you can modify:

bool statistics_on = 1;
const char* default_input = "sound blaster";
const char* default_output = "sound blaster";
The statistics_on variable determines whether Rogus gathers statistics on each parser used and writes them to the file "Rogus.log". The default_input and default_output variables specify what nodes should be the default for input and output.

Modified 21 January 1996