Commit graph

10 commits

Author SHA1 Message Date
cbe29fead3 Library: allow for pretty-printing of smart-ptr values
- an extension to our custom toString and typeString helpers.
- currently just for shared_ptr and unique_ptr
- might add further overloads for other smart-ptr types
2016-07-31 00:33:26 +02:00
b033824342 fix spurious include
...which causes problems when a preceding include
has already dragged in <functional>

the actual problem is the std::hash hack, which probably
is even no longer possible and could be removed (but
I don't have the time to investigate this somewhat
tricky topic right now)

To prevent this confusing situation, I'm adding the
include of "lib/symbol.hpp", to ensure we do have
the actual definitions of string and Literal,
which trait.hpp just declares forward.

An note, lib/symbol.hpp also includes hash-standard.hpp
first, so we avoid triggering problematic situation
from a header (format-cout.hpp), which is pervasively used
all over the place....
2016-01-15 21:29:39 +01:00
b56f5a8945 type-display(#985): improvements and supplements
- a regexp based function to discard non-identifier chars
- nice human readable display of boolean values
2016-01-10 03:59:01 +01:00
88120eba1a unit-test(#985): define more tests 2016-01-09 22:23:50 +01:00
615f112f5c clean-up(#985): unify various type-indicating helpers
over time, we got quite a jungle with all those
shome-me-the-type-of helper functions.

Reduced and unified all those into
- typeString : a human readable, slightly simplified full type
- typeSymbol : a single word identifier, extracted lexically from the type

note: this changeset causes a lot of tests to break,
since we're using unmangeled type-IDs pretty much everywhere now.
Beore fixing those, I'll have to implement a better simplification
scheme for the "human readable" type names....
2016-01-09 02:05:23 +01:00
99c478768c generic-toString(#985): define streamlined converter
...based on all the clean-up and reorganisation done thus far,
we're now able to rebuild the util::str in a more direct and
sane way, and thus to disentangle the header inclusion problem.
2016-01-08 09:17:58 +01:00
b021a2e769 sharpen the formatting API: take arguments as const always 2016-01-07 20:17:07 +01:00
2cf127e16a formatting(#985): define pretty-printing format for addresses
use a shortened display, showing only the last 4 bytes for diagnostics
since we're typically only interested in spotting "same" and "different",
while the full memory address is irrelevant
2016-01-06 06:24:02 +01:00
60a7e7acb2 formatting-utils(#985): provide some basics
No more fiddling with printf just to show a number reliably!

simple functions to pretty-print addresses,
doubles and floats (fixed-point, with rounding).

Also make all these basic formatting helpers noexcept
2016-01-06 04:04:56 +01:00
0c4495a451 reorganisation(#985): move basic typeString implementation into lib::meta
- simple function to pick up the mangled type
- pretty-printing is implemented in format-obj.cpp
- also move the demangleCxx()-Function to that location,
  it starts to be used for real, outside the test framework
2016-01-05 23:34:53 +01:00