27#include <ql/errors.hpp>
33#define snprintf _snprintf
49 int m =
static_cast<int>(date.month());
50 int d = date.dayOfMonth();
52 int n = snprintf(buf,
sizeof(buf),
"%04d-%02d-%02d", y, m, d);
53 QL_REQUIRE(n == 10,
"Failed to convert date " << date <<
" to_string() n:" << n);
54 return std::string(buf);
57string to_string(
bool aBool) {
return aBool ?
"true" :
"false"; }
60 Integer n = period.length();
63 switch (period.units()) {
70 if (n != 0 || m == 0) {
87 if (n != 0 || m == 0) {
99 ALOG(
"unknown time unit (" << Integer(period.units()) <<
")");
Classes and functions for log message handling.
#define ALOG(text)
Logging Macro (Level = Alert)
std::string to_string(const LocationInfo &l)
Serializable Credit Default Swap.
string conversion utilities