libqalculate-3.6.0
|
A prefix with a free numerical value. More...
#include <Prefix.h>
Public Member Functions | |
NumberPrefix (const Number &nr, std::string long_name, std::string short_name="", std::string unicode_name="") | |
void | setValue (const Number &nr) |
Number | value (const Number &nexp) const |
Number | value (int iexp) const |
Number | value () const |
int | type () const |
![]() | |
Prefix (std::string long_name, std::string short_name="", std::string unicode_name="") | |
const std::string & | shortName (bool return_long_if_no_short=true, bool use_unicode=false) const |
const std::string & | longName (bool return_short_if_no_long=true, bool use_unicode=false) const |
const std::string & | unicodeName (bool return_short_if_no_uni=true) const |
void | setShortName (std::string short_name) |
void | setLongName (std::string long_name) |
void | setUnicodeName (std::string unicode_name) |
const std::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 |
Protected Attributes | |
Number | o_number |
![]() | |
std::string | l_name |
std::string | s_name |
std::string | u_name |
A prefix with a free numerical value.
A prefix without any predefined base, which can use any number.
NumberPrefix::NumberPrefix | ( | const Number & | nr, |
std::string | long_name, | ||
std::string | short_name = "" , |
||
std::string | unicode_name = "" |
||
) |
Create a number prefix.
nr | Value of the prefix. |
long_name | Long name. |
short_name | Short name. |
unicode_name | Unicode name. |
void NumberPrefix::setValue | ( | const Number & | nr | ) |
Sets the value of the prefix.
nr | New value for the prefix. |
|
virtual |
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.
Implements Prefix.
|
virtual |
Returns the value of the prefix.
nexp | The power of the prefixed unit. |
Implements Prefix.
|
virtual |
Returns the value of the prefix.
iexp | The power of the prefixed unit. |
Implements Prefix.