#include <Prefix.h>
Inheritance diagram for Prefix:
Public Member Functions | |
Prefix (string long_name, string short_name="", string unicode_name="") | |
const string & | shortName (bool return_long_if_no_short=true, bool use_unicode=false) const |
const string & | longName (bool return_short_if_no_long=true, bool use_unicode=false) const |
const string & | unicodeName (bool return_short_if_no_uni=true) const |
void | setShortName (string short_name) |
void | setLongName (string long_name) |
void | setUnicodeName (string unicode_name) |
const string & | name (bool short_default=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const |
virtual Number | value (const Number &nexp) const =0 |
virtual Number | value (int iexp) const =0 |
virtual Number | value () const =0 |
virtual int | type () const =0 |
Protected Attributes | |
string | l_name |
string | s_name |
string | u_name |
A prefix is prepended to a unit to specificy a quantity multiplicator. A prefix has a numerical value which raised to the units power defines the quantity. In for example the expression "3 kilometers", meter is the unit, 3 is regular quantity, and kilo is a prefix with a value 1000, thus the example equals "3000 meters". If the unit instead had been squared, the value of the prefix would have been raised by two and the total quantity would have been 3.000.000.
Prefixes can have up to free different three names -- a long name, a short name and a short unicode name. The unicode name is an alternative to the short name that is preferred if unicode characters can be displayed. The names or used to reference the prefix in mathematical expressions and to display a prefix in a result.
|
Create a prefix.
|
|
Returns the long name of the prefix.
|
|
Returns a preferred name of the prefix.
|
|
Sets the long name of the prefix.
|
|
Sets the short name of the prefix.
|
|
Sets the unicode name of the prefix. The unicode name is an alternative to the short name that is preferred if unicode characters can be displayed.
|
|
Returns the short name of the prefix.
|
|
Returns type, subclass, of the prefix. This can be PREFIX_DECIMAL for prefixes of the class DecimalPrefix, PREFIX_BINARY for BinaryPrefix, or PREFIX_NUMBER for NumberPrefix.
Implemented in DecimalPrefix, BinaryPrefix, and NumberPrefix. |
|
Returns the unicode name of the prefix.
|
|
Returns the value of the prefix.
Implemented in DecimalPrefix, BinaryPrefix, and NumberPrefix. |
|
Returns the value of the prefix.
Implemented in DecimalPrefix, BinaryPrefix, and NumberPrefix. |
|
Returns the value of the prefix.
Implemented in DecimalPrefix, BinaryPrefix, and NumberPrefix. |