#include <Env.h>
Inheritance diagram for Conjecture::Env:
###################################################################
This class acts as a front-end, maintaining all user-provided and internal meta-information. A 'main' program can create an instance of this class and interact entirely with it, with or without involving the other classes in Conjecture.
Public Member Functions | |
Env (int argc, const char *argv[]) | |
bool | processArgs (int argc, const char **argv) |
Initialize various fields based on command-line flags. | |
Page * | registerPage (const std::string &file) |
Page * | currentPage () |
void | wrapup () |
friend | Page::Page (Env *env, const std::string &file) |
const Page * | current () const |
const Job * | job () const |
const std::string & | alg () const |
const int | verbose () const |
const std::string & | infile () const |
const std::string & | outfile () const |
const std::vector< Page * > & | pages () const |
const std::string & | rawdata () const |
const StrategyFactory * | algorithms () const |
virtual StrategyFactory * | makeAlgorithms () |
Static Public Member Functions | |
static void | Initialize () |
static void | test (int argc=0, const char *argv[]=NULL) |
Protected Member Functions | |
void | currentIs (Page *current) |
void | algIs (const std::string &alg) |
void | pagesIs (const std::vector< Page * > &pages) |
void | jobIs (Job *job) |
void | verboseIs (int verbose) |
void | outfileIs (const std::string &outfile) |
void | infileIs (const std::string &infile) |
void | rawdataIs (const std::string &rawdata) |
|
Returns the currently "active" page. |
|
Perform class initializaton. This method is currently important because the GOCR code has a global variable that must be initialized in order for any gocr code to work. Once the global var is removed, this method may no longer be needed. This method is called in Env::Env, but must also be called in any unit-testing method that doesn't use Env directly (the global JOB variable must still be initialized if the class in question uses any gocr code). |
|
Factory Method for creating an appropriate StrategyFactory Note that the default implementation is auto-generated by 'ocrgen' based on the 'Algorithms' file. Subclassing should really not be necessary (and thus it isn't much of a Factory Method :-). FUTURE FIX: Currently invoked within the constructor, which means that subclass definitions may not work properly anyway! |
|
Initialize various fields based on command-line flags. Initialize fields that control variations in processing algorithm. |
|
Add a new Page to my list of pages |
|
Unit testing method. This static method should create instances of the class (and instances of any other class necessary) and perform tests to ensure that all methods within the class are working as expected. |
|
Perform any final post-processing mandated by config fields. |