libqalculate-3.5.0: NumberPrefix Class Reference

libqalculate-3.5.0

Public Member Functions | Protected Attributes | List of all members
NumberPrefix Class Reference

A prefix with a free numerical value. More...

`#include <Prefix.h>`

Inheritance diagram for NumberPrefix:

## Public Member Functions
| NumberPrefix (const Number &nr, string long_name, string short_name="", 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
Public Member Functions inherited from Prefix
| 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

## Protected Attributes
Number | o_number
Protected Attributes inherited from Prefix
string | l_name
string | s_name
string | u_name

## Detailed Description

A prefix with a free numerical value.

A prefix without any predefined base, which can use any number.

## Constructor & Destructor Documentation

## ◆ NumberPrefix()

NumberPrefix::NumberPrefix | ( | const Number & | nr,
|  | string | long_name,
|  | string | short_name = `""`,
|  | string | unicode_name = `""`
| ) |  |

Create a number prefix.

Parameters

  nr | Value of the prefix.
  long_name | Long name.
  short_name | Short name.
  unicode_name | Unicode name.

## Member Function Documentation

## ◆ setValue()

void NumberPrefix::setValue | ( | const Number & | nr | ) |

Sets the value of the prefix.

Parameters

  nr | New value for the prefix.

## ◆ type()

int NumberPrefix::type | ( |  | ) | const
| 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.

Returns
  The type of the prefix.

Implements Prefix.

## ◆ value() [1/3]

Number NumberPrefix::value | ( |  | ) | const
| virtual

Returns the value of the prefix.

Returns
  The value of the prefix.

Implements Prefix.

## ◆ value() [2/3]

Number NumberPrefix::value | ( | const Number & | nexp | ) | const
| virtual

Returns the value of the prefix.

Parameters

  nexp | The power of the prefixed unit.

Returns
  The value of the prefix.

Implements Prefix.

## ◆ value() [3/3]

Number NumberPrefix::value | ( | int | iexp | ) | const
| virtual

Returns the value of the prefix.

Parameters

  iexp | The power of the prefixed unit.

Returns
  The value of the prefix.

Implements Prefix.

The documentation for this class was generated from the following file:

- libqalculate/Prefix.h