Milo  0.1
Milo:EquationManipulationProgram
Classes | Typedefs | Functions | Variables
milo_test.cpp File Reference
#include <iostream>
#include <vector>
#include <map>
#include "milo.h"
#include "ui.h"
#include "panel.h"
Include dependency graph for milo_test.cpp:

Classes

class  AsciiGraphics
 
class  AsciiApp
 

Typedefs

using func_ptr = void(*)(const string &s)
 

Functions

static void parse (const string &eqn_str)
 EqnPanel class object. More...
 
static void xml_in (const string &fname)
 
static void xml_out (const string &)
 
static void test (const string &)
 
static void eqn_out (const string &)
 
static void art (const string &)
 
static void normalize (const string &)
 
static void simplify (const string &)
 
static void keys (const string &keys)
 
static void geometry (const string &params)
 
static void help (const string &)
 
int main (int argc, char *argv[])
 

Variables

AsciiApp app
 
Graphics & gc = app.getGraphics()
 
EqnPanel panel
 Asciigraphics class objects.
 
const unordered_map< string, func_ptr > test_funcs
 

Detailed Description

This file allows you to test the equation engine of milo.

Typedef Documentation

using func_ptr = void (*)(const string& s)

Pointer to function from command line argument.

Function Documentation

static void art ( const string &  )
static

Output current equation as ascii art to standard output.

static void eqn_out ( const string &  )
static

Output current equation in ascii to standard output.

static void geometry ( const string &  params)
static

Set geometry of internal ascii screen

static void help ( const string &  )
static

Output help to standard output.

static void keys ( const string &  keys)
static

Add keys as input to equation.

int main ( int  argc,
char *  argv[] 
)

Command line milo test main function. Takes name of test for argument plus argument passed to text if needed. More than one test command maybe passed on command line for serial tests.

Parameters
argcNumber of arguments.
argvArray of argugments.
Returns
Exit code.
static void normalize ( const string &  )
static

Normalize current equation.

static void parse ( const string &  eqn_str)
static

EqnPanel class object.

Load parsed equation string into global equation object.

Parameters
eqn_strString with text version of equation.
static void simplify ( const string &  )
static

Simplify current equation.

static void test ( const string &  )
static

Test output of current equation.

static void xml_in ( const string &  fname)
static

Load filename with xml version of equation

Parameters
fnameName of file with xml
static void xml_out ( const string &  )
static

Output current equation in xml to standard output.

Variable Documentation

const unordered_map<string, func_ptr> test_funcs
Initial value:
= {
{ "parse:", parse },
{ "xml:", xml_in },
{ "test", test },
{ "ascii-art", art },
{ "eqn-out", eqn_out },
{ "xml-out", xml_out },
{ "normalize", normalize },
{ "simplify", simplify },
{ "keys:", keys },
{ "geom:", geometry },
{ "help", help }
}
static void art(const string &)
Definition: milo_test.cpp:328
static void help(const string &)
Definition: milo_test.cpp:405
static void xml_in(const string &fname)
Definition: milo_test.cpp:280
static void keys(const string &keys)
Definition: milo_test.cpp:352
static void simplify(const string &)
Definition: milo_test.cpp:345
static void eqn_out(const string &)
Definition: milo_test.cpp:321
static void parse(const string &eqn_str)
EqnPanel class object.
Definition: milo_test.cpp:271
static void xml_out(const string &)
Definition: milo_test.cpp:288
static void test(const string &)
Definition: milo_test.cpp:297
static void geometry(const string &params)
Definition: milo_test.cpp:371
static void normalize(const string &)
Definition: milo_test.cpp:338

Associate command with an internal function. ':' means it takes argument.