From 4f46bb0e09ddfa540b60bd4d152385729127aceb Mon Sep 17 00:00:00 2001 From: MenTaLguY Date: Mon, 6 Feb 2006 04:15:05 +0000 Subject: replace Util::SharedCStringPtr with the more general Util::shared_ptr<> (bzr r87) --- src/debug/logger.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/debug/logger.cpp') diff --git a/src/debug/logger.cpp b/src/debug/logger.cpp index a3c7b0430..6fb1aee05 100644 --- a/src/debug/logger.cpp +++ b/src/debug/logger.cpp @@ -25,7 +25,7 @@ bool Logger::_category_mask[Event::N_CATEGORIES]; namespace { -static void write_escaped_value(std::ostream &os, Util::SharedCStringPtr value) { +static void write_escaped_value(std::ostream &os, Util::shared_ptr value) { for ( char const *current=value ; *current ; ++current ) { switch (*current) { case '&': @@ -57,7 +57,7 @@ static void write_indent(std::ostream &os, unsigned depth) { static std::ofstream log_stream; static bool empty_tag=false; -typedef std::vector > TagStack; +typedef std::vector, GC::Alloc, GC::MANUAL> > TagStack; static TagStack &tag_stack() { static TagStack stack; return stack; @@ -128,7 +128,7 @@ void Logger::init() { log_stream << "\n"; log_stream.flush(); _enabled = true; - start >(Util::SharedCStringPtr::coerce("session")); + start >(Util::share_static("session")); std::atexit(&do_shutdown); } } @@ -136,7 +136,7 @@ void Logger::init() { } void Logger::_start(Event const &event) { - Util::SharedCStringPtr name=event.name(); + Util::shared_ptr name=event.name(); if (empty_tag) { log_stream << ">\n"; @@ -144,12 +144,12 @@ void Logger::_start(Event const &event) { write_indent(log_stream, tag_stack().size()); - log_stream << "<" << name.cString(); + log_stream << "<" << name.pointer(); unsigned property_count=event.propertyCount(); for ( unsigned i = 0 ; i < property_count ; i++ ) { Event::PropertyPair property=event.property(i); - log_stream << " " << property.name.cString() << "=\""; + log_stream << " " << property.name.pointer() << "=\""; write_escaped_value(log_stream, property.value); log_stream << "\""; } @@ -161,7 +161,7 @@ void Logger::_start(Event const &event) { } void Logger::_skip() { - tag_stack().push_back(Util::SharedCStringPtr()); + tag_stack().push_back(Util::shared_ptr()); } void Logger::_finish() { @@ -170,7 +170,7 @@ void Logger::_finish() { log_stream << "/>\n"; } else { write_indent(log_stream, tag_stack().size() - 1); - log_stream << "\n"; + log_stream << "\n"; } log_stream.flush(); -- cgit v1.2.3