From 4d99cdb20546f52ac441de6441ae3e01666cb3c1 Mon Sep 17 00:00:00 2001 From: syntheticpp Date: Fri, 6 Jan 2006 14:06:26 +0000 Subject: [PATCH] add formated printing of std::strings git-svn-id: svn://svn.code.sf.net/p/loki-lib/code/trunk@442 7ec92016-0320-0410-acc4-a06ded1c099a --- CHANGES | 1 + include/loki/SafeFormat.h | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/CHANGES b/CHANGES index 7e2d151..53f43db 100755 --- a/CHANGES +++ b/CHANGES @@ -22,6 +22,7 @@ SafeFormat: - speed comparison added (pk) - 64 bit problems fixed (Thanks to Zak Kipling) - ported to 64-bit Windows, not tested (pk) + - Printf/SPrintfing of std::strings added SmallObject: - added functions to check for memory corruption (rs) diff --git a/include/loki/SafeFormat.h b/include/loki/SafeFormat.h index 29b14ef..9a3bcaf 100755 --- a/include/loki/SafeFormat.h +++ b/include/loki/SafeFormat.h @@ -166,6 +166,10 @@ namespace Loki return StoreCountHelper(pi); } + PrintfState& operator()(const std::string& stdstr) { + return operator()(stdstr.c_str()); + } + PrintfState& operator()(const char *const s) { if (result_ == -1) return *this; ReadLeaders();