diff options
author | 2017-01-19 18:05:19 +0100 | |
---|---|---|
committer | 2017-01-20 22:29:23 +0100 | |
commit | 4d15501a30d78eecc5011ebdd12a7568954129cb (patch) | |
tree | f3364bc26aae7719fb8fa3b153847188446844a7 /src/lib/netlist/plib/pfmtlog.h | |
parent | 1ae3e29ea3fd90e5df31d52c5d3860fde7f3cbac (diff) |
Netlist: code refactoring
Make streams provide binary access only. Use putf8_reader and
putf8_writer to actually access streams. Replace some char * parameters
with pstring where appropriate. Minor code refactoring and move
functionality were it belongs. (nw)
Diffstat (limited to 'src/lib/netlist/plib/pfmtlog.h')
-rw-r--r-- | src/lib/netlist/plib/pfmtlog.h | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/lib/netlist/plib/pfmtlog.h b/src/lib/netlist/plib/pfmtlog.h index 0aeb015dc2c..fbae59673d7 100644 --- a/src/lib/netlist/plib/pfmtlog.h +++ b/src/lib/netlist/plib/pfmtlog.h @@ -157,13 +157,12 @@ protected: class pfmt : public pformat_base<pfmt> { public: - explicit pfmt(const pstring &fmt); - explicit pfmt(const char *fmt); + explicit pfmt(const pstring fmt); virtual ~pfmt(); operator pstring() const { return pstring(m_str, pstring::UTF8); } - const char *cstr() { return m_str; } + const char *c_str() { return m_str; } protected: @@ -190,41 +189,42 @@ class plog_dispatch_intf; template <bool build_enabled = true> class pfmt_writer_t { + P_PREVENT_COPYING(pfmt_writer_t) public: - pfmt_writer_t() : m_enabled(true) { } + explicit pfmt_writer_t() : m_enabled(true) { } virtual ~pfmt_writer_t() { } - void operator ()(const char *fmt) const + void operator ()(const pstring fmt) const { - if (build_enabled && m_enabled) vdowrite(pstring(fmt, pstring::UTF8)); + if (build_enabled && m_enabled) vdowrite(fmt); } template<typename T1> - void operator ()(const char *fmt, const T1 &v1) const + void operator ()(const pstring fmt, const T1 &v1) const { if (build_enabled && m_enabled) vdowrite(pfmt(fmt)(v1)); } template<typename T1, typename T2> - void operator ()(const char *fmt, const T1 &v1, const T2 &v2) const + void operator ()(const pstring fmt, const T1 &v1, const T2 &v2) const { if (build_enabled && m_enabled) vdowrite(pfmt(fmt)(v1)(v2)); } template<typename T1, typename T2, typename T3> - void operator ()(const char *fmt, const T1 &v1, const T2 &v2, const T3 &v3) const + void operator ()(const pstring fmt, const T1 &v1, const T2 &v2, const T3 &v3) const { if (build_enabled && m_enabled) vdowrite(pfmt(fmt)(v1)(v2)(v3)); } template<typename T1, typename T2, typename T3, typename T4> - void operator ()(const char *fmt, const T1 &v1, const T2 &v2, const T3 &v3, const T4 &v4) const + void operator ()(const pstring fmt, const T1 &v1, const T2 &v2, const T3 &v3, const T4 &v4) const { if (build_enabled && m_enabled) vdowrite(pfmt(fmt)(v1)(v2)(v3)(v4)); } template<typename T1, typename T2, typename T3, typename T4, typename T5> - void operator ()(const char *fmt, const T1 &v1, const T2 &v2, const T3 &v3, const T4 &v4, const T5 &v5) const + void operator ()(const pstring fmt, const T1 &v1, const T2 &v2, const T3 &v3, const T4 &v4, const T5 &v5) const { if (build_enabled && m_enabled) vdowrite(pfmt(fmt)(v1)(v2)(v3)(v4)(v5)); } @@ -248,7 +248,7 @@ template <plog_level::e L, bool build_enabled = true> class plog_channel : public pfmt_writer_t<build_enabled> { public: - explicit plog_channel(plog_dispatch_intf *b) : pfmt_writer_t<build_enabled>(), m_base(b) { } + explicit plog_channel(plog_dispatch_intf *b) : pfmt_writer_t<build_enabled>(), m_base(b) { } virtual ~plog_channel() { } protected: |