summaryrefslogtreecommitdiffstats
path: root/src/debug
diff options
context:
space:
mode:
authorMenTaLguY <mental@rydia.net>2006-02-06 04:15:05 +0000
committermental <mental@users.sourceforge.net>2006-02-06 04:15:05 +0000
commit4f46bb0e09ddfa540b60bd4d152385729127aceb (patch)
tree7b30dc6f0d64d847c422352d23ef1187ec04802a /src/debug
parentsilence warnings (diff)
downloadinkscape-4f46bb0e09ddfa540b60bd4d152385729127aceb.tar.gz
inkscape-4f46bb0e09ddfa540b60bd4d152385729127aceb.zip
replace Util::SharedCStringPtr with the more general Util::shared_ptr<>
(bzr r87)
Diffstat (limited to '')
-rw-r--r--src/debug/event.h22
-rw-r--r--src/debug/gc-heap.h4
-rw-r--r--src/debug/heap.h4
-rw-r--r--src/debug/logger.cpp16
-rw-r--r--src/debug/simple-event.h8
-rw-r--r--src/debug/sysv-heap.h4
6 files changed, 29 insertions, 29 deletions
diff --git a/src/debug/event.h b/src/debug/event.h
index c3b3a83fb..8232f890d 100644
--- a/src/debug/event.h
+++ b/src/debug/event.h
@@ -13,7 +13,7 @@
#define SEEN_INKSCAPE_DEBUG_EVENT_H
#include <utility>
-#include "util/shared-c-string-ptr.h"
+#include "util/share.h"
namespace Inkscape {
@@ -37,23 +37,23 @@ public:
struct PropertyPair {
public:
PropertyPair() {}
- PropertyPair(Util::SharedCStringPtr n, Util::SharedCStringPtr v)
+ PropertyPair(Util::shared_ptr<char> n, Util::shared_ptr<char> v)
: name(n), value(v) {}
- PropertyPair(char const *n, Util::SharedCStringPtr v)
- : name(Util::SharedCStringPtr::copy(n)), value(v) {}
- PropertyPair(Util::SharedCStringPtr n, char const *v)
- : name(n), value(Util::SharedCStringPtr::copy(v)) {}
+ PropertyPair(char const *n, Util::shared_ptr<char> v)
+ : name(Util::share_string(n)), value(v) {}
+ PropertyPair(Util::shared_ptr<char> n, char const *v)
+ : name(n), value(Util::share_string(v)) {}
PropertyPair(char const *n, char const *v)
- : name(Util::SharedCStringPtr::copy(n)),
- value(Util::SharedCStringPtr::copy(v)) {}
+ : name(Util::share_string(n)),
+ value(Util::share_string(v)) {}
- Util::SharedCStringPtr name;
- Util::SharedCStringPtr value;
+ Util::shared_ptr<char> name;
+ Util::shared_ptr<char> value;
};
static Category category() { return OTHER; }
- virtual Util::SharedCStringPtr name() const=0;
+ virtual Util::shared_ptr<char> name() const=0;
virtual unsigned propertyCount() const=0;
virtual PropertyPair property(unsigned property) const=0;
};
diff --git a/src/debug/gc-heap.h b/src/debug/gc-heap.h
index b3042432e..0a9534701 100644
--- a/src/debug/gc-heap.h
+++ b/src/debug/gc-heap.h
@@ -23,8 +23,8 @@ public:
int features() const {
return SIZE_AVAILABLE | USED_AVAILABLE | GARBAGE_COLLECTED;
}
- Util::SharedCStringPtr name() const {
- return Util::SharedCStringPtr::coerce("libgc");
+ Util::shared_ptr<char> name() const {
+ return Util::share_static("libgc");
}
Heap::Stats stats() const {
Stats stats;
diff --git a/src/debug/heap.h b/src/debug/heap.h
index d07cf74a1..ef563030f 100644
--- a/src/debug/heap.h
+++ b/src/debug/heap.h
@@ -13,7 +13,7 @@
#define SEEN_INKSCAPE_DEBUG_HEAP_H
#include <cstddef>
-#include "util/shared-c-string-ptr.h"
+#include "util/share.h"
namespace Inkscape {
@@ -36,7 +36,7 @@ public:
virtual int features() const=0;
- virtual Util::SharedCStringPtr name() const=0;
+ virtual Util::shared_ptr<char> name() const=0;
virtual Stats stats() const=0;
virtual void force_collect()=0;
};
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<char> 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<Util::SharedCStringPtr, GC::Alloc<Util::SharedCStringPtr, GC::MANUAL> > TagStack;
+typedef std::vector<Util::shared_ptr<char>, GC::Alloc<Util::shared_ptr<char>, GC::MANUAL> > TagStack;
static TagStack &tag_stack() {
static TagStack stack;
return stack;
@@ -128,7 +128,7 @@ void Logger::init() {
log_stream << "<?xml version=\"1.0\"?>\n";
log_stream.flush();
_enabled = true;
- start<SimpleEvent<Event::CORE> >(Util::SharedCStringPtr::coerce("session"));
+ start<SimpleEvent<Event::CORE> >(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<char> 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<char>());
}
void Logger::_finish() {
@@ -170,7 +170,7 @@ void Logger::_finish() {
log_stream << "/>\n";
} else {
write_indent(log_stream, tag_stack().size() - 1);
- log_stream << "</" << tag_stack().back().cString() << ">\n";
+ log_stream << "</" << tag_stack().back().pointer() << ">\n";
}
log_stream.flush();
diff --git a/src/debug/simple-event.h b/src/debug/simple-event.h
index 3a3adae3c..90eed3a0e 100644
--- a/src/debug/simple-event.h
+++ b/src/debug/simple-event.h
@@ -21,17 +21,17 @@ namespace Debug {
template <Event::Category C=Event::OTHER>
class SimpleEvent : public Event {
public:
- SimpleEvent(Util::SharedCStringPtr name) : _name(name) {}
- SimpleEvent(char const *name) : _name(Util::SharedCStringPtr::copy(name)) {}
+ SimpleEvent(Util::shared_ptr<char> name) : _name(name) {}
+ SimpleEvent(char const *name) : _name(Util::share_string(name)) {}
static Category category() { return C; }
- Util::SharedCStringPtr name() const { return _name; }
+ Util::shared_ptr<char> name() const { return _name; }
unsigned propertyCount() const { return 0; }
PropertyPair property(unsigned property) const { return PropertyPair(); }
private:
- Util::SharedCStringPtr _name;
+ Util::shared_ptr<char> _name;
};
}
diff --git a/src/debug/sysv-heap.h b/src/debug/sysv-heap.h
index 2ba24b2b5..9a07a3261 100644
--- a/src/debug/sysv-heap.h
+++ b/src/debug/sysv-heap.h
@@ -23,8 +23,8 @@ public:
int features() const;
- Util::SharedCStringPtr name() const {
- return Util::SharedCStringPtr::coerce("standard malloc()");
+ Util::shared_ptr<char> name() const {
+ return Util::share_static("standard malloc()");
}
Stats stats() const;
void force_collect() {}