summaryrefslogtreecommitdiffstats
path: root/src/libs/client/Serializer.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/libs/client/Serializer.h')
-rw-r--r--src/libs/client/Serializer.h36
1 files changed, 18 insertions, 18 deletions
diff --git a/src/libs/client/Serializer.h b/src/libs/client/Serializer.h
index b2dbf000..a563dbb8 100644
--- a/src/libs/client/Serializer.h
+++ b/src/libs/client/Serializer.h
@@ -20,7 +20,8 @@
#include <map>
#include <utility>
#include <string>
-#include <redland.h>
+#include <stdexcept>
+#include <raptor.h>
#include <cassert>
#include "util/CountedPtr.h"
#include "util/Path.h"
@@ -60,52 +61,51 @@ public:
string find_file(const string& filename, const string& additional_path = "");
- void save_patch(CountedPtr<PatchModel> patch_model, const string& filename, bool recursive);
-
string load_patch(const string& filename,
const string& parent_path,
const string& name,
size_t poly,
MetadataMap initial_data,
bool existing = false);
+
+ void start_to_filename(const string& filename);
+ void start_to_string();
+
+ void serialize_patch(CountedPtr<PatchModel> patch) throw(std::logic_error);
+
+ string finish() throw(std::logic_error);
private:
// Model -> RDF
- void add_patch_to_rdf(librdf_model* rdf,
- CountedPtr<PatchModel> patch, const string& uri);
-
- void add_node_to_rdf(librdf_model* rdf,
+ void add_node_to_rdf(raptor_serializer* rdf,
CountedPtr<NodeModel> node, const string ns_prefix="");
- void add_port_to_rdf(librdf_model* rdf,
+ void add_port_to_rdf(raptor_serializer* rdf,
CountedPtr<PortModel> port, const string ns_prefix="");
- void add_connection_to_rdf(librdf_model* rdf,
+ void add_connection_to_rdf(raptor_serializer* rdf,
CountedPtr<ConnectionModel> connection, const string port_ns_prefix="");
// Triple -> RDF
- void add_resource_to_rdf(librdf_model* model,
+ void add_resource_to_rdf(raptor_serializer* rdf,
const string& subject_uri, const string& predicate_uri, const string& object_uri);
- void add_resource_to_rdf(librdf_model* model,
- librdf_node* subject, const string& predicate_uri, const string& object_uri);
+ //void add_resource_to_rdf(raptor_serializer* rdf
+ // librdf_node* subject, const string& predicate_uri, const string& object_uri);
- void add_atom_to_rdf(librdf_model* model,
+ void add_atom_to_rdf(raptor_serializer* rdf,
const string& subject_uri, const string& predicate_uri, const Atom& atom);
-
- void create();
- void destroy();
void setup_prefixes();
string expand_uri(const string& uri);
- librdf_world* _world;
- librdf_serializer* _serializer;
+ raptor_serializer* _serializer;
+ unsigned char* _string_output;
string _patch_search_path;
map<string, string> _prefixes;
CountedPtr<ModelEngineInterface> _engine;