Introduction¶
Using Hippo¶
Hippo is a header-only library, so install the headers however you’d like.
To begin using Hippo, include the following:
#include "hippo/hippo.h"
Printing a value¶
Printing values is performed by the hippo::print()
or hippo::print_to()
functions.
Both functions take a value and a hippo::configuration
and produce a pretty-printed output.
A simple example of printing a vector:
#include "hippo/hippo.h"
#include "hippo/std/vector.h"
#include <iostream>
int main() {
std::vector<int> v {0, 1, 2};
hippo::print_to(std::cout, v, hippo::configuration());
}
This example will print:
std::vector [0, 1, 2]
Interface¶
-
struct
configuration
¶ Global configuration values applied to all printers.
-
template<typename
T
>
std::vector<std::string>hippo
::
print
(const T &t, const hippo::configuration &config)¶ Print any printable value
t
with configurationconfig
-
template<typename
T
>
std::ostream &hippo
::
print_to
(std::ostream &os, const T &t, const hippo::configuration &config)¶ Print any printable value
t
with configurationconfig
to the specifiedstd::ostream