#include <mi32/uom.h>
Public Member Functions | |
| CONVERTER (const MEASURE &measure) | |
| CONVERTER (const CONVERTER &rhs) | |
| CONVERTER () | |
| ~CONVERTER () | |
| ERRVALUE | ConvertForward (const MISTRING &instr, MISTRING &outstr) const |
| ERRVALUE | ConvertForward (double inval, MISTRING &outstr) const |
| ERRVALUE | ConvertForward (const MISTRING &instr, double &outval) const |
| double | ConvertForward (double value) const |
| ERRVALUE | ConvertInverse (const MISTRING &instr, MISTRING &outstr) const |
| ERRVALUE | ConvertInverse (double inval, MISTRING &outstr) const |
| ERRVALUE | ConvertInverse (const MISTRING &instr, double &outval) const |
| double | ConvertInverse (double value) const |
| const MEASURE & | GetMeasure () const |
| double | GetScale () const |
| const UNIT & | GetSourceUnit () const |
| const UNIT & | GetTargetUnit () const |
| void | IniReadSource (INIHANDLE IniHandle, const char *IniGroup, const char *IniName, int micode=0) |
| void | IniReadTarget (INIHANDLE IniHandle, const char *IniGroup, const char *IniName, int micode=0) |
| void | IniWriteSource (INIHANDLE IniHandle, const char *IniGroup, const char *IniName) const |
| void | IniWriteTarget (INIHANDLE IniHandle, const char *IniGroup, const char *IniName) const |
| CONVERTER & | operator= (const CONVERTER &rhs) |
| ERRVALUE | SetSourceUnit (const UNIT &SourceUnit) |
| ERRVALUE | SetTargetUnit (const UNIT &TargetUnit) |
| ERRVALUE | SetUnits (const UNIT &SourceUnit, const UNIT &TargetUnit) |
| UOM::CONVERTER::CONVERTER | ( | ) |
Default constructor.
| UOM::CONVERTER::CONVERTER | ( | const CONVERTER & | rhs | ) |
Copy constructor.
| UOM::CONVERTER::CONVERTER | ( | const MEASURE & | measure | ) |
Identity constructor.
| UOM::CONVERTER::~CONVERTER | ( | ) |
Destructor.
Convert string in source unit to string in target unit.
| instr | String in source unit to convert | |
| outstr | String in target unit returned |
Convert numeric value in source unit to string in target unit.
If source unit requires a string representation an error will be returned.
| inval | Value in source unit to convert | |
| outstr | String in target unit returned |
Convert string in source unit to numeric value in target unit.
If target unit requires a string representation an error will be returned.
| instr | String in source unit to convert | |
| outval | Value in target unit returned |
| double UOM::CONVERTER::ConvertForward | ( | double | value | ) | const |
Convert numeric value from source unit to target unit.
If either source or target unit requires a string representation the original value will be returned.
| value | Value in source unit to convert |
Convert string in target unit to string in source unit.
| instr | String in target unit to convert | |
| outstr | String in source unit returned |
Convert numeric value in target unit to string in source unit.
If target unit requires a string representation an error will be returned.
| inval | Value in target unit to convert | |
| outstr | String in source unit returned |
Convert string in target unit to numeric value in source unit.
If source unit requires a string representation an error will be returned.
| instr | String in target unit to convert | |
| outval | Value in source unit returned |
| double UOM::CONVERTER::ConvertInverse | ( | double | value | ) | const |
Convert numeric value from target unit to source unit.
If either target or source unit requires a string representation the original value will be returned.
| value | Value in target unit to convert |
| const MEASURE& UOM::CONVERTER::GetMeasure | ( | ) | const |
Get measure associated with converter.
| double UOM::CONVERTER::GetScale | ( | ) | const |
Get scale multiplication value from source to target.
| const UNIT& UOM::CONVERTER::GetSourceUnit | ( | ) | const |
Get source unit.
| const UNIT& UOM::CONVERTER::GetTargetUnit | ( | ) | const |
Get target unit.
| void UOM::CONVERTER::IniReadSource | ( | INIHANDLE | IniHandle, | |
| const char * | IniGroup, | |||
| const char * | IniName, | |||
| int | micode = 0 | |||
| ) |
Read source unit from INI file.
Target unit will be left unchanged.
| micode | Default unit code |
| void UOM::CONVERTER::IniReadTarget | ( | INIHANDLE | IniHandle, | |
| const char * | IniGroup, | |||
| const char * | IniName, | |||
| int | micode = 0 | |||
| ) |
Read target unit from INI file.
Source unit will be left unchanged.
| micode | Default unit code |
| void UOM::CONVERTER::IniWriteSource | ( | INIHANDLE | IniHandle, | |
| const char * | IniGroup, | |||
| const char * | IniName | |||
| ) | const |
Write source unit code to INI file.
| void UOM::CONVERTER::IniWriteTarget | ( | INIHANDLE | IniHandle, | |
| const char * | IniGroup, | |||
| const char * | IniName | |||
| ) | const |
Write target unit code to INI file.
Set source unit.
If the current measure is of TYPE_None it will be set to the measure of the specified unit. Otherwise, an error will be returned if the unit does not refer to the current measure.
Set target unit.
If the current measure is of TYPE_None it will be set to the measure of the specified unit. Otherwise, an error will be returned if the unit does not refer to the current measure.
Set both source and target units.
An error will be returned if the specified units do not refer to the same MEASURE.
1.6.1