38 #ifndef OPENVDB_UTIL_FORMATS_HAS_BEEN_INCLUDED 39 #define OPENVDB_UTIL_FORMATS_HAS_BEEN_INCLUDED 64 const std::string& head =
"",
65 const std::string& tail =
"\n",
66 bool exact =
false,
int width = 8,
int precision = 3);
79 const std::string& head =
"",
80 const std::string& tail =
"\n",
81 bool exact =
true,
int width = 8,
int precision = 3);
93 printTime(std::ostream& os,
double milliseconds,
94 const std::string& head =
"",
95 const std::string& tail =
"\n",
96 int width = 4,
int precision = 1,
int verbose = 0);
103 template<
typename IntT>
107 static char sep() {
return ','; }
111 std::ostream&
put(std::ostream& os)
const 114 std::ostringstream ostr;
116 std::string s = ostr.str();
118 size_t padding = (s.size() % 3) ? 3 - (s.size() % 3) : 0;
119 s = std::string(padding,
' ') + s;
123 for (
size_t i = 0, N = s.size(); i < N; ) {
126 if (i >= padding && i % 3 == 0 && i < s.size()) {
132 os << s.substr(padding, s.size());
140 template<
typename IntT>
144 template<
typename IntT>
151 #endif // OPENVDB_UTIL_FORMATS_HAS_BEEN_INCLUDED
OPENVDB_API int printNumber(std::ostream &os, uint64_t number, const std::string &head="", const std::string &tail="\n", bool exact=true, int width=8, int precision=3)
#define OPENVDB_VERSION_NAME
The version namespace name for this library version.
Definition: version.h:128
Definition: Exceptions.h:40
OPENVDB_API int printTime(std::ostream &os, double milliseconds, const std::string &head="", const std::string &tail="\n", int width=4, int precision=1, int verbose=0)
Library and file format version numbers.
std::ostream & operator<<(std::ostream &os, const FormattedInt< IntT > &n)
Definition: Formats.h:141
FormattedInt< IntT > formattedInt(IntT n)
Definition: Formats.h:145
OPENVDB_API int printBytes(std::ostream &os, uint64_t bytes, const std::string &head="", const std::string &tail="\n", bool exact=false, int width=8, int precision=3)
#define OPENVDB_USE_VERSION_NAMESPACE
Definition: version.h:180