PIString delete operator += int
PICout fix
This commit is contained in:
@@ -317,65 +317,67 @@ PICout PICout::operator <<(const PIFlags<PICoutManipulators::PICoutFormat> & v)
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
#define PICOUTTOTARGET(v) { \
|
||||
if (buffer_) {\
|
||||
(*buffer_) += (v);\
|
||||
} else {\
|
||||
if (PICout::isOutputDeviceActive(PICout::StdOut)) std::cout << (v);\
|
||||
if (PICout::isOutputDeviceActive(PICout::Buffer)) PICout::__string__() += (v);\
|
||||
}\
|
||||
}
|
||||
|
||||
#define PINUMERICCOUT(v) { \
|
||||
#define PIINTCOUT(v) { \
|
||||
if (!act_) return *this; \
|
||||
space(); \
|
||||
write(PIString::fromNumber(v, cnb_)); \
|
||||
if (cnb_ == 10) {\
|
||||
if (buffer_) {\
|
||||
(*buffer_) += PIString::fromNumber(v);\
|
||||
} else {\
|
||||
if (PICout::isOutputDeviceActive(PICout::StdOut)) std::cout << (v);\
|
||||
if (PICout::isOutputDeviceActive(PICout::Buffer)) PICout::__string__() += PIString::fromNumber(v);\
|
||||
}\
|
||||
} else write(PIString::fromNumber(v, cnb_)); \
|
||||
return *this; \
|
||||
}
|
||||
|
||||
#define PIFLOATCOUT(v) { \
|
||||
if (buffer_) {\
|
||||
(*buffer_) += PIString::fromNumber(v, 'g');\
|
||||
} else {\
|
||||
if (PICout::isOutputDeviceActive(PICout::StdOut)) std::cout << (v);\
|
||||
if (PICout::isOutputDeviceActive(PICout::Buffer)) PICout::__string__() += PIString::fromNumber(v, 'g');\
|
||||
}\
|
||||
}
|
||||
|
||||
PICout PICout::operator <<(const char * v) {if (!act_ || !v) return *this; if (v[0] == '\0') return *this; space(); quote(); PICOUTTOTARGET(v) quote(); return *this;}
|
||||
|
||||
PICout PICout::operator <<(const bool v) {if (!act_) return *this; space(); if (v) PICOUTTOTARGET("true") else PICOUTTOTARGET("false") return *this;}
|
||||
PICout PICout::operator <<(const char * v) {if (!act_ || !v) return *this; if (v[0] == '\0') return *this; space(); quote(); write(v); quote(); return *this;}
|
||||
|
||||
PICout PICout::operator <<(const char v) {if (!act_) return *this; space(); PICOUTTOTARGET(v) return *this;}
|
||||
PICout PICout::operator <<(const bool v) {if (!act_) return *this; space(); if (v) write("true"); else write("false"); return *this;}
|
||||
|
||||
PICout PICout::operator <<(const uchar v) {PINUMERICCOUT(ushort(v))}
|
||||
PICout PICout::operator <<(const char v) {if (!act_) return *this; space(); write(v); return *this;}
|
||||
|
||||
PICout PICout::operator <<(const short int v) {PINUMERICCOUT(v)}
|
||||
PICout PICout::operator <<(const uchar v) {PIINTCOUT(ushort(v))}
|
||||
|
||||
PICout PICout::operator <<(const ushort v) {PINUMERICCOUT(v)}
|
||||
PICout PICout::operator <<(const short int v) {PIINTCOUT(v)}
|
||||
|
||||
PICout PICout::operator <<(const int v) {PINUMERICCOUT(v)}
|
||||
PICout PICout::operator <<(const ushort v) {PIINTCOUT(v)}
|
||||
|
||||
PICout PICout::operator <<(const uint v) {PINUMERICCOUT(v)}
|
||||
PICout PICout::operator <<(const int v) {PIINTCOUT(v)}
|
||||
|
||||
PICout PICout::operator <<(const long v) {PINUMERICCOUT(v)}
|
||||
PICout PICout::operator <<(const uint v) {PIINTCOUT(v)}
|
||||
|
||||
PICout PICout::operator <<(const ulong v) {PINUMERICCOUT(v)}
|
||||
PICout PICout::operator <<(const long v) {PIINTCOUT(v)}
|
||||
|
||||
PICout PICout::operator <<(const llong v) {PINUMERICCOUT(v)}
|
||||
PICout PICout::operator <<(const ulong v) {PIINTCOUT(v)}
|
||||
|
||||
PICout PICout::operator <<(const ullong v) {PINUMERICCOUT(v)}
|
||||
PICout PICout::operator <<(const llong v) {PIINTCOUT(v)}
|
||||
|
||||
PICout PICout::operator <<(const float v) {if (!act_) return *this; space(); PICOUTTOTARGET(v) return *this;}
|
||||
PICout PICout::operator <<(const ullong v) {PIINTCOUT(v)}
|
||||
|
||||
PICout PICout::operator <<(const double v) {if (!act_) return *this; space(); PICOUTTOTARGET(v) return *this;}
|
||||
PICout PICout::operator <<(const float v) {if (!act_) return *this; space(); PIFLOATCOUT(v) return *this;}
|
||||
|
||||
PICout PICout::operator <<(const void * v) {if (!act_) return *this; space(); PICOUTTOTARGET("0x") write(PIString::fromNumber(ullong(v), 16)); return *this;}
|
||||
PICout PICout::operator <<(const double v) {if (!act_) return *this; space(); PIFLOATCOUT(v) return *this;}
|
||||
|
||||
PICout PICout::operator <<(const void * v) {if (!act_) return *this; space(); write("0x" + PIString::fromNumber(ullong(v), 16)); return *this;}
|
||||
|
||||
PICout PICout::operator <<(const PIObject * v) {
|
||||
if (!act_) return *this;
|
||||
space();
|
||||
if (v == 0) PICOUTTOTARGET("PIObject*(0x0)")
|
||||
if (v == 0) write("PIObject*(0x0)");
|
||||
else {
|
||||
PICOUTTOTARGET(v->className())
|
||||
PICOUTTOTARGET("*(0x")
|
||||
write(PIString::fromNumber(ullong(v), 16));
|
||||
PICOUTTOTARGET(", \"")
|
||||
write(v->name());
|
||||
PICOUTTOTARGET("\")")
|
||||
write(v->className());
|
||||
write("*(0x" + PIString::fromNumber(ullong(v), 16) + ", \"" + v->name() + "\")");
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
@@ -455,8 +457,6 @@ PICout & PICout::restoreControl() {
|
||||
}
|
||||
|
||||
|
||||
#undef PICOUTTOTARGET
|
||||
#undef PINUMERICCOUT
|
||||
|
||||
//! \details
|
||||
//! \~english
|
||||
@@ -519,6 +519,18 @@ PICout & PICout::newLine() {
|
||||
}
|
||||
|
||||
|
||||
PICout & PICout::write(char c) {
|
||||
if (!act_) return *this;
|
||||
if (buffer_) {
|
||||
buffer_->append(c);
|
||||
} else {
|
||||
if (PICout::isOutputDeviceActive(PICout::StdOut)) std::cout << c;
|
||||
if (PICout::isOutputDeviceActive(PICout::Buffer)) PICout::__string__().append(c);
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
PICout & PICout::write(const char * str) {
|
||||
if (!act_ || !str) return *this;
|
||||
return write(str, strlen(str));
|
||||
|
||||
@@ -287,6 +287,10 @@ public:
|
||||
//! \~russian Условно добавляет новую строку
|
||||
PICout & newLine();
|
||||
|
||||
//! \~english Write char
|
||||
//! \~russian Пишет символ
|
||||
PICout & write(char c);
|
||||
|
||||
//! \~english Write raw data
|
||||
//! \~russian Пишет сырые символы
|
||||
PICout & write(const char * str);
|
||||
|
||||
@@ -77,6 +77,16 @@ public:
|
||||
PIString & operator +=(const PIString & str);
|
||||
PIString & operator +=(const PIConstChars & str);
|
||||
|
||||
PIString & operator +=(uchar ) = delete;
|
||||
PIString & operator +=( short) = delete;
|
||||
PIString & operator +=(ushort) = delete;
|
||||
PIString & operator +=( int ) = delete;
|
||||
PIString & operator +=(uint ) = delete;
|
||||
PIString & operator +=( long ) = delete;
|
||||
PIString & operator +=(ulong ) = delete;
|
||||
PIString & operator +=( llong) = delete;
|
||||
PIString & operator +=(ullong) = delete;
|
||||
|
||||
//! \~english Contructs a copy of string.
|
||||
//! \~russian Создает копию строки.
|
||||
PIString(const PIString & o) {d = o.d;}
|
||||
|
||||
Reference in New Issue
Block a user