Expression Refactor

- Refactoring complete.  Arg objects now uses enumerations for _type
  and _category, which should help with performance.
This commit is contained in:
Paul Beckingham 2011-08-21 01:06:50 -04:00
parent 9086f51d29
commit 7aa4efef8d
6 changed files with 331 additions and 247 deletions

View file

@ -35,19 +35,28 @@
class Arg
{
public:
enum category {cat_none=1, cat_terminator, cat_program, cat_command, cat_rc, cat_override, cat_attr, cat_attmod, cat_id, cat_uuid, cat_subst, cat_pattern, cat_rx, cat_tag, cat_dom, cat_op, cat_literal};
enum type {type_none=20, type_pseudo, type_bool, type_string, type_date, type_duration, type_number};
Arg ();
Arg (const std::string&);
Arg (const std::string&, const std::string&);
Arg (const std::string&, const std::string&, const std::string&);
Arg (const std::string&, const category);
Arg (const std::string&, const type, const category);
Arg (const Arg&);
Arg& operator= (const Arg&);
bool operator== (const Arg&) const;
static const type type_id (const std::string&);
static const std::string type_name (type);
static const category category_id (const std::string&);
static const std::string category_name (category);
public:
std::string _value; // Interpreted value
std::string _raw; // Raw input token, never modified
std::string _type; // Data type
std::string _category; // Categorized argument
type _type; // Data type
category _category; // Categorized argument
};
#endif