19 #include <ndb_global.h>
22 #include <OutputStream.hpp>
28 static const char * fms[] = {
41 NdbOut::operator<<(Int8 v) { m_out->print(fms[0+isHex],(
int)v);
return *
this;}
43 NdbOut::operator<<(Uint8 v) { m_out->print(fms[2+isHex],(
int)v);
return *
this;}
45 NdbOut::operator<<(Int16 v) { m_out->print(fms[4+isHex],(
int)v);
return *
this;}
47 NdbOut::operator<<(Uint16 v) { m_out->print(fms[6+isHex],(
int)v);
return *
this;}
49 NdbOut::operator<<(Int32 v) { m_out->print(fms[8+isHex], v);
return *
this;}
51 NdbOut::operator<<(Uint32 v) { m_out->print(fms[10+isHex], v);
return *
this;}
53 NdbOut::operator<<(Int64 v) { m_out->print(fms[12+isHex], v);
return *
this;}
55 NdbOut::operator<<(Uint64 v) { m_out->print(fms[14+isHex], v);
return *
this;}
57 NdbOut::operator<<(
unsigned long int v) {
return *
this << (Uint64) v; }
60 NdbOut::operator<<(
const char* val){ m_out->print(
"%s", val ? val :
"(null)");
return *
this; }
62 NdbOut::operator<<(
const void* val){ m_out->print(
"%p", val);
return *
this; }
67 NdbOut::operator<<(
float val){ m_out->print(
"%f", (
double)val);
return *
this;}
69 NdbOut::operator<<(
double val){ m_out->print(
"%f", val);
return *
this; }
71 NdbOut& NdbOut::endline()
74 m_out->println(
"%s",
"");
80 NdbOut& NdbOut::flushline()
86 NdbOut& NdbOut::setHexFormat(
int _format)
88 isHex = (_format == 0 ? 0 : 1);
93 : m_out(& out), isHex(0), m_autoflush(autoflush)
98 : m_out(NULL), isHex(0)
114 NdbOut::print(
const char *
fmt, ...){
120 BaseString::vsnprintf(buf,
sizeof(buf)-1, fmt, ap);
126 NdbOut::println(
const char * fmt, ...){
132 BaseString::vsnprintf(buf,
sizeof(buf)-1, fmt, ap);
133 *
this << buf << endl;
139 vndbout_c(
const char * fmt, va_list ap){
144 BaseString::vsnprintf(buf,
sizeof(buf)-1, fmt, ap);
146 ndbout << buf << endl;
151 ndbout_c(
const char * fmt, ...){
159 extern "C" int ndbout_printer(
const char * fmt, ...)
171 int threshold,
int level)
174 m_threshold = threshold;
180 FilteredNdbOut::~FilteredNdbOut(){
185 FilteredNdbOut::setLevel(
int i){
187 if(m_level >= m_threshold){
195 FilteredNdbOut::setThreshold(
int i){
201 FilteredNdbOut::getLevel()
const {
205 FilteredNdbOut::getThreshold()
const {
216 new (&ndbout) NdbOut(ndbouts_fileoutputstream);
219 new (&ndberr) NdbOut(ndberrs_fileoutputstream);