John Wiegley
92d2eb9574
Use ptr_deque for value_t::sequence_t
...
This is to work around undefined behavior according to the Standard,
[lib.res.on.functions]/2:
"In particular, the effects are undefined in the following cases: [..]
- if an incomplete type (3.9) is used as a template argument when
instantiating a template component."
2010-06-10 16:32:24 -04:00
John Wiegley
77c5df4053
Errors involving value objects provide more context
2010-06-10 08:16:59 -04:00
John Wiegley
da2f415f14
In value_t::print, pass along display flags
2010-06-09 06:36:40 -04:00
John Wiegley
be6cef93c4
A further simplification of -V and -X
...
With -X COMM, all values are computed in terms of COMM, regardless.
With -V, only secondary commodities will ever be computed, never
primaries. Further, if a secondary commodities has an associated price,
the valuation is done in terms of that price's commodity.
2010-06-07 09:49:17 -04:00
John Wiegley
a4d4f99794
amount_t::print and value_t::print now use flags
2010-06-07 08:32:13 -04:00
John Wiegley
16f799767c
Value expression sequences are now comparable
...
Fixes #228 / ED9388D7-E523-40EB-841B-9AE9BAA70329
2010-06-05 03:26:43 -04:00
John Wiegley
d5ea3080a7
Allow null values to be cast to int and string
2010-05-30 03:19:09 -06:00
John Wiegley
7ec52d2b39
Comparison of boolean values is now allowed
...
true > false
2010-05-30 02:16:32 -06:00
John Wiegley
66a26252df
Corrected error message text to be consistent
2010-05-30 02:15:45 -06:00
John Wiegley
2d28b34ff3
Allow expr_t& to be passed in a value_t
2010-05-08 02:00:35 -04:00
John Wiegley
7e79cd82cd
Corrected a case for value < value
2010-03-06 00:58:05 -05:00
John Wiegley
fd4fa8a114
Change an exception test to a plain if
2010-03-05 22:14:14 -05:00
John Wiegley
ab416f759f
Updated copyrights to 2003-2010
2010-03-05 22:14:10 -05:00
John Wiegley
6870c54644
Refactored some comparison helper classes
2010-02-05 00:00:38 -05:00
John Wiegley
5d4a0a39be
The Python web server now uses jQuery Tablesorter
2009-11-21 02:06:01 -05:00
John Wiegley
4e30fcdf40
Many improvements to Ledger's Python bindings
2009-11-19 22:24:24 -05:00
John Wiegley
9a389650ea
Allow ! and - operators on sequence values
2009-11-18 16:56:58 -05:00
John Wiegley
b2ba07b90c
Fixed several time and date duration type uses
2009-11-17 21:28:43 -05:00
John Wiegley
7a44791221
Optimization in the formatting of string values
2009-11-14 02:49:38 -05:00
John Wiegley
2986bc779e
Stylistic change: assert(0) -> assert(false)
2009-11-13 01:48:32 -05:00
John Wiegley
67c9cf134d
Added --date, similar to --account and --payee
...
This lets you do things like store a date as the value of a tag, then
run:
ledger --date='has_tag("Foo") ? to_date(tag("Foo")) : date' reg
2009-11-11 21:32:32 -05:00
John Wiegley
afe87280e0
Added floored() and in_place_floor() methods
2009-11-11 03:39:53 -05:00
John Wiegley
7cd37b1d50
Moving the #include of unistring.h into format.h
2009-11-10 18:43:38 -05:00
John Wiegley
6cdb79e2a6
XML reporting now works via the "xml" command
2009-11-09 03:42:35 -05:00
John Wiegley
2c80227339
Added basic foundation for XML reporting
2009-11-09 02:17:26 -05:00
John Wiegley
5e3f3d7f47
Report sought magnitude when balancing errors occur
2009-11-05 17:43:28 -05:00
John Wiegley
09ace752d6
Added missing call to _dup() in value_t::in_place_cast
2009-11-05 05:11:50 -05:00
John Wiegley
7ca80112fc
Change the value_t::POINTER type to value_t::SCOPE
...
scope_t pointers are the only kind that are ever stored in value
objects, so there was no need to make it generic and use boost::any.
2009-10-30 17:57:29 -04:00
John Wiegley
432be9e989
Removed unnused parameter to value_t::print
2009-10-27 22:25:13 -04:00
John Wiegley
aae134f692
Fixed a display issue with the balance report
2009-10-27 19:01:55 -04:00
John Wiegley
12616dd030
Fixed an error with post-simplified math
2009-10-27 17:30:34 -04:00
John Wiegley
3ea7fbd5f6
If doing math between amount and balance, simplify
2009-10-27 08:30:59 -04:00
John Wiegley
1f379eff70
Fixed some debug code
2009-10-27 08:30:59 -04:00
John Wiegley
a8768587c8
Allow any amount to be multipled by another
...
The result carries the commodity of the first amount, or the second if
the first had no commodity.
2009-10-27 08:30:59 -04:00
John Wiegley
4bdc0a663c
Added debug code
2009-10-27 08:30:59 -04:00
John Wiegley
fc84eeb358
Rewrote the way date and time I/O is managed
2009-10-25 05:01:47 -04:00
John Wiegley
588f2ef2f5
Fixed many compiler warnings from g++ 4.4
2009-10-25 05:01:39 -04:00
John Wiegley
bad1b13680
value_t::dump now faithfully represents strings
2009-06-28 16:00:29 +01:00
John Wiegley
2ef1934bb0
Restored --price option, added baseline test
...
This option reports only in terms of the annotated price of the
commodities involved, otherwise it reports the amounts themselves. It
can be used in conjunction with other reports, as it applies to the
displayed amounts, not the actual amounts being calculated.
2009-06-26 17:15:35 +01:00
John Wiegley
991e3a3eaf
Split commodity.h/cc into three files
...
commodity.h - code for commodity_t
annotate.h - commodity annotations
pool.h - commodity pool management
2009-06-24 16:43:46 +01:00
John Wiegley
fe6055bf16
value_t::in_place_unround wasn't doing it in-place
2009-06-21 18:35:48 +01:00
John Wiegley
86dfc1e0be
The -X option now accepts price settings
...
For example, if you had 100 AU (onces of gold) and wanted to report it
in dollars, but at a price of $997 per ounce, you could now easily say:
ledger bal -X '$,AU=$997'
2009-06-18 18:50:49 +01:00
John Wiegley
298a4faef3
Move amount colorization deeper into the core
...
This is necessary in order to redden negative amounts correctly under
all circumstances, such as component amounts of a multi-commodity
balance.
Fixes 727B2DF8-A2A1-4716-9C15-547F20D5F933
2009-06-16 16:57:10 +01:00
John Wiegley
981dc41eb7
Allow integers to be multiplied with amounts
...
Fixes other part of 04C5E1CA-1B39-4214-81C7-FD5AA785308F
2009-06-15 17:52:20 +01:00
John Wiegley
110f0b8023
Enabled use of pre-compiled headers by default
2009-03-10 17:02:03 -04:00
John Wiegley
c11d325712
Reduced the #include dependency tree to a minimum
2009-03-04 23:53:43 -04:00
John Wiegley
2d63c9364a
Changed many assert() calls to VERIFY()
2009-03-04 04:29:10 -04:00
John Wiegley
478998b4e9
Added a "null" value for value expressions
2009-03-03 13:36:23 -04:00
John Wiegley
fbb0d25831
Gave round/unround/truncate all in_place_ variants
2009-02-27 02:15:27 -04:00
John Wiegley
f09c3906a2
Print better error msg if evaluating mask as bool
2009-02-26 05:35:57 -04:00