From 6f9894421280430c09d37bbe066552ef31c12db1 Mon Sep 17 00:00:00 2001 From: maartenkeijzer Date: Fri, 21 Mar 2003 02:41:54 +0000 Subject: [PATCH] again: std::ends and stringstream --- eo/src/utils/eoState.cpp | 3 ++- eo/src/utils/eoUpdater.cpp | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/eo/src/utils/eoState.cpp b/eo/src/utils/eoState.cpp index e8eec0dd..814a4aaa 100644 --- a/eo/src/utils/eoState.cpp +++ b/eo/src/utils/eoState.cpp @@ -188,10 +188,11 @@ string eoState::createObjectName(eoObject* obj) { #ifdef HAVE_SSTREAM ostringstream os; + os << obj->className().c_str() << count++; #else ostrstream os; -#endif os << obj->className().c_str() << count++ << ends; +#endif name = os.str(); diff --git a/eo/src/utils/eoUpdater.cpp b/eo/src/utils/eoUpdater.cpp index dd30b4b4..64b07dfc 100644 --- a/eo/src/utils/eoUpdater.cpp +++ b/eo/src/utils/eoUpdater.cpp @@ -23,10 +23,11 @@ void eoTimedStateSaver::operator()(void) #ifdef HAVE_SSTREAM ostringstream os; + os << prefix << (now - first_time) << '.' << extension; #else ostrstream os; -#endif os << prefix << (now - first_time) << '.' << extension << ends; +#endif state.save(os.str()); } } @@ -35,10 +36,11 @@ void eoCountedStateSaver::doItNow(void) { #ifdef HAVE_SSTREAM ostringstream os; + os << prefix << counter << '.' << extension; #else ostrstream os; -#endif os << prefix << counter << '.' << extension << ends; +#endif state.save(os.str()); }