Added amount_t::commodity_ptr()
This commit is contained in:
parent
628875b33c
commit
ca8f702a1b
3 changed files with 14 additions and 8 deletions
|
|
@ -867,10 +867,15 @@ bool amount_t::fits_in_long() const
|
|||
return mpfr_fits_slong_p(tempf, GMP_RNDN);
|
||||
}
|
||||
|
||||
commodity_t& amount_t::commodity() const
|
||||
commodity_t * amount_t::commodity_ptr() const
|
||||
{
|
||||
return (has_commodity() ?
|
||||
*commodity_ : *commodity_pool_t::current_pool->null_commodity);
|
||||
commodity_ : commodity_pool_t::current_pool->null_commodity);
|
||||
}
|
||||
|
||||
commodity_t& amount_t::commodity() const
|
||||
{
|
||||
return *commodity_ptr();
|
||||
}
|
||||
|
||||
bool amount_t::has_commodity() const
|
||||
|
|
|
|||
|
|
@ -533,6 +533,7 @@ public:
|
|||
number() returns a commodity-less version of an amount. This is
|
||||
useful for accessing just the numeric portion of an amount.
|
||||
*/
|
||||
commodity_t * commodity_ptr() const;
|
||||
commodity_t& commodity() const;
|
||||
|
||||
bool has_commodity() const;
|
||||
|
|
|
|||
|
|
@ -2,16 +2,16 @@ test -f $sourcepath/src/amount.h reg -> 7
|
|||
__ERROR__
|
||||
While parsing file "$sourcepath/src/amount.h", line 66:
|
||||
Error: No quantity specified for amount
|
||||
While parsing file "$sourcepath/src/amount.h", line 731:
|
||||
While parsing file "$sourcepath/src/amount.h", line 732:
|
||||
Error: Invalid date/time: line amount_t amoun
|
||||
While parsing file "$sourcepath/src/amount.h", line 737:
|
||||
While parsing file "$sourcepath/src/amount.h", line 738:
|
||||
Error: Invalid date/time: line string amount_
|
||||
While parsing file "$sourcepath/src/amount.h", line 743:
|
||||
While parsing file "$sourcepath/src/amount.h", line 744:
|
||||
Error: Invalid date/time: line string amount_
|
||||
While parsing file "$sourcepath/src/amount.h", line 749:
|
||||
While parsing file "$sourcepath/src/amount.h", line 750:
|
||||
Error: Invalid date/time: line string amount_
|
||||
While parsing file "$sourcepath/src/amount.h", line 755:
|
||||
While parsing file "$sourcepath/src/amount.h", line 756:
|
||||
Error: Invalid date/time: line std::ostream&
|
||||
While parsing file "$sourcepath/src/amount.h", line 762:
|
||||
While parsing file "$sourcepath/src/amount.h", line 763:
|
||||
Error: Invalid date/time: line std::istream&
|
||||
end test
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue