/* * MathPlanner 3.1.0 - Mathematical design tool. * Copyright(C) 2002 Jarmo Nikkanen * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation. * * You should have received a copy of the GNU General Public License with this program. * */ #ifndef _MATHPLANNER_UNIT_H #define _MATHPLANNER_UNIT_H #include class config_file_reader; #define COUNT 32 // Max count of base units #define MAX_BASE 32 struct mpl_base_unit { QString name; QString unit; QString subs; bool base; bool process; char prefix; char pwrs[COUNT]; }; class mpl_unit { mpl_base_unit unit[MAX_BASE]; char pwrs[COUNT]; int total,base; public: mpl_unit(class config_file_reader *); int FindUnit(QString arg); bool IsBaseUnit(QString arg); QString Argument(QString subs,int); char Power(QString arg); QString Unit(QString arg); void ProcessSubs(); void CreatePowers(); void CreatePower(QString subs,char *pw); void Clear(); void Add(char *); void Sub(char *); void Compare(char *); QString Subs(int index); QString UnitName(int index); QString Display(QString subs,bool f=false); QString CreateSubs(char *pw); QString CreateUnit(char *pw); int Units(); }; #endif