PICout refactoring, new SHSTKMacros

This commit is contained in:
2022-08-07 22:07:26 +03:00
parent 1eaecb288f
commit 8551499a5e
36 changed files with 106 additions and 106 deletions

View File

@@ -350,25 +350,25 @@ private:
//! \relatesalso PICout \brief Output operator PIBinaryLog::BinLogInfo to PICout
inline PICout operator <<(PICout s, const PIBinaryLog::BinLogInfo & bi) {
s.space();
s.setControl(0, true);
s.saveAndSetControls(0);
s << "[PIBinaryLog] " << bi.path << "\n";
if (bi.log_size < 0) {
s << "invalid file path";
s.restoreControl();
s.restoreControls();
return s;
}
if (bi.log_size == 0) {
s << "Invalid empty file";
s.restoreControl();
s.restoreControls();
return s;
} if (bi.records_count < 0 && bi.records_count > -4) {
s << "Invalid file or corrupted signature";
s.restoreControl();
s.restoreControls();
return s;
}
if (bi.records_count < -3) {
s << "Invalid binlog version";
s.restoreControl();
s.restoreControls();
return s;
}
s << "read records " << bi.records_count << " in " << bi.records.size() << " types, log size " << bi.log_size;
@@ -380,7 +380,7 @@ inline PICout operator <<(PICout s, const PIBinaryLog::BinLogInfo & bi) {
s << "\n record start " << bri.start_time << " , end " << bri.end_time;
s << "\n record size " << bri.minimum_size << " - " << bri.maximum_size;
}
s.restoreControl();
s.restoreControls();
return s;
}

View File

@@ -518,7 +518,7 @@ PIP_EXPORT std::ostream & operator <<(std::ostream & s, const PIConfig::Branch &
PIP_EXPORT std::ostream & operator <<(std::ostream & s, const PIConfig::Entry & v);
#endif
inline PICout operator <<(PICout s, const PIConfig::Branch & v) {s.setControl(0, true); v.piCoutt(s, ""); s.restoreControl(); return s;}
inline PICout operator <<(PICout s, const PIConfig::Branch & v) {s.saveAndSetControls(0); v.piCoutt(s, ""); s.restoreControls(); return s;}
inline PICout operator <<(PICout s, const PIConfig::Entry & v) {
s << v.value() << "(" << v.type() << v.comment() << ")";
return s;

View File

@@ -189,7 +189,7 @@ inline bool operator !=(const PIFile::FileInfo & v0, const PIFile::FileInfo & v1
//! \relatesalso PICout
//! \~english Output operator to \a PICout
//! \~russian Оператор вывода в \a PICout
inline PICout operator <<(PICout s, const PIDir & v) {s.setControl(0, true); s << "PIDir(\"" << v.path() << "\")"; s.restoreControl(); return s;}
inline PICout operator <<(PICout s, const PIDir & v) {s.saveAndSetControls(0); s << "PIDir(\"" << v.path() << "\")"; s.restoreControls(); return s;}
#endif // PIDIR_H

View File

@@ -515,7 +515,7 @@ private:
inline bool operator <(const PIEthernet::Interface & v0, const PIEthernet::Interface & v1) {return (v0.name < v1.name);}
inline bool operator ==(const PIEthernet::Interface & v0, const PIEthernet::Interface & v1) {return (v0.name == v1.name && v0.address == v1.address && v0.netmask == v1.netmask);}
inline bool operator !=(const PIEthernet::Interface & v0, const PIEthernet::Interface & v1) {return (v0.name != v1.name || v0.address != v1.address || v0.netmask != v1.netmask);}
inline PICout operator <<(PICout s, const PIEthernet::Address & v) {s.space(); s.setControl(0, true); s << "Address(" << v.toString() << ")"; s.restoreControl(); return s;}
inline PICout operator <<(PICout s, const PIEthernet::Address & v) {s.space(); s.saveAndSetControls(0); s << "Address(" << v.toString() << ")"; s.restoreControls(); return s;}
inline bool operator ==(const PIEthernet::Address & v0, const PIEthernet::Address & v1) {return (v0.ip() == v1.ip() && v0.port() == v1.port());}
inline bool operator !=(const PIEthernet::Address & v0, const PIEthernet::Address & v1) {return (v0.ip() != v1.ip() || v0.port() != v1.port());}

View File

@@ -334,12 +334,12 @@ private:
//! \~english Output operator to \a PICout
//! \~russian Оператор вывода в \a PICout
inline PICout operator <<(PICout s, const PIFile::FileInfo & v) {
s.setControl(0, true);
s.saveAndSetControls(0);
s << "FileInfo(\"" << v.path << "\", " << PIString::readableSize(v.size) << ", "
<< v.perm_user.toString() << " " << v.perm_group.toString() << " " << v.perm_other.toString() << ", "
<< v.time_access.toString() << ", " << v.time_modification.toString()
<< ", 0x" << PICoutManipulators::Hex << v.flags << ")";
s.restoreControl();
s.restoreControls();
return s;
}