From f3b65ffd392579728490916ba0d0ad9cbcdcbf66 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 27 Apr 2011 23:36:19 +0000 Subject: Remove boost and glibmm dependencies from sordmm.hpp. Add C++ (sordmm.hpp) compilation test. Fix utilities only building with --test. git-svn-id: http://svn.drobilla.net/sord/trunk@92 3d64ff67-21c5-427c-a301-fe4f08042e5a --- sord/sordmm.hpp | 47 ++++++++++++++++++++++++++++------------------- 1 file changed, 28 insertions(+), 19 deletions(-) (limited to 'sord/sordmm.hpp') diff --git a/sord/sordmm.hpp b/sord/sordmm.hpp index 8c0dc10..294f38f 100644 --- a/sord/sordmm.hpp +++ b/sord/sordmm.hpp @@ -24,12 +24,11 @@ #include #include +#include #include #include #include - -#include -#include +#include #include "serd/serd.h" #include "sord/sord.h" @@ -38,6 +37,16 @@ namespace Sord { +/** Utility base class to prevent copying. */ +class Noncopyable { +protected: + Noncopyable() {} + ~Noncopyable() {} +private: + Noncopyable(const Noncopyable&); + const Noncopyable& operator=(const Noncopyable&); +}; + /** C++ wrapper for a Sord object. */ template class Wrapper { @@ -97,7 +106,7 @@ public: }; /** Sord library state. */ -class World : public boost::noncopyable, public Wrapper { +class World : public Noncopyable, public Wrapper { public: inline World() : _next_blank_id(0) @@ -374,22 +383,22 @@ struct Iter : public Wrapper { /** An RDF Model (collection of triples). */ -class Model : public boost::noncopyable, public Wrapper { +class Model : public Noncopyable, public Wrapper { public: - inline Model(World& world, const Glib::ustring& base_uri="."); + inline Model(World& world, const std::string& base_uri="."); inline ~Model(); inline const Node& base_uri() const { return _base; } - inline void load_file(const Glib::ustring& uri); + inline void load_file(const std::string& uri); - inline void load_string(const char* str, - size_t len, - const Glib::ustring& base_uri, - const std::string lang = "turtle"); + inline void load_string(const char* str, + size_t len, + const std::string& base_uri, + const std::string lang = "turtle"); inline void write_to_file_handle(FILE* fd, const char* lang); - inline void write_to_file(const Glib::ustring& uri, const char* lang); + inline void write_to_file(const std::string& uri, const char* lang); inline std::string write_to_string(const char* lang); @@ -413,7 +422,7 @@ private: /** Create an empty in-memory RDF model. */ inline -Model::Model(World& world, const Glib::ustring& base_uri) +Model::Model(World& world, const std::string& base_uri) : _world(world) , _base(world, Node::URI, base_uri) , _writer(NULL) @@ -423,10 +432,10 @@ Model::Model(World& world, const Glib::ustring& base_uri) } inline void -Model::load_string(const char* str, - size_t len, - const Glib::ustring& base_uri, - const std::string lang) +Model::load_string(const char* str, + size_t len, + const std::string& base_uri, + const std::string lang) { sord_read_string(_c_obj, (const uint8_t*)str, @@ -439,7 +448,7 @@ inline Model::~Model() } inline void -Model::load_file(const Glib::ustring& data_uri) +Model::load_file(const std::string& data_uri) { // FIXME: blank prefix sord_read_file(_c_obj, (const uint8_t*)data_uri.c_str(), NULL, @@ -458,7 +467,7 @@ Model::write_to_file_handle(FILE* fd, const char* lang) } inline void -Model::write_to_file(const Glib::ustring& uri, const char* lang) +Model::write_to_file(const std::string& uri, const char* lang) { sord_write_file(_c_obj, _world.prefixes().c_obj(), -- cgit v1.2.1