summaryrefslogtreecommitdiffstats
path: root/src/serialisation/Serialiser.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2011-10-22 05:37:30 +0000
committerDavid Robillard <d@drobilla.net>2011-10-22 05:37:30 +0000
commit1f7a9fc296605a2d58312a9133b1a4f90bdb3724 (patch)
tree7be1661057c881bf7c73c96876af564ad0f97c7b /src/serialisation/Serialiser.cpp
parent389da7d63b8e78baacf22cf52905dc5420079d71 (diff)
downloadingen-1f7a9fc296605a2d58312a9133b1a4f90bdb3724.tar.gz
ingen-1f7a9fc296605a2d58312a9133b1a4f90bdb3724.tar.bz2
ingen-1f7a9fc296605a2d58312a9133b1a4f90bdb3724.zip
Fix serialisation.
Fix Parser::relative_uri. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@3590 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/serialisation/Serialiser.cpp')
-rw-r--r--src/serialisation/Serialiser.cpp31
1 files changed, 8 insertions, 23 deletions
diff --git a/src/serialisation/Serialiser.cpp b/src/serialisation/Serialiser.cpp
index 3d528af4..8d9b490a 100644
--- a/src/serialisation/Serialiser.cpp
+++ b/src/serialisation/Serialiser.cpp
@@ -39,7 +39,6 @@
#include "raul/Atom.hpp"
#include "raul/AtomRDF.hpp"
#include "raul/Path.hpp"
-#include "raul/TableImpl.hpp"
#include "raul/log.hpp"
#include "sord/sordmm.hpp"
@@ -139,15 +138,6 @@ Serialiser::to_file(SharedPtr<const GraphObject> object,
finish();
}
-static
-std::string
-uri_to_symbol(const std::string& uri)
-{
- const std::string filename = Glib::filename_from_uri(uri);
- return Path::nameify(Glib::path_get_basename(
- filename.substr(0, filename.find_last_of('.'))));
-}
-
void
Serialiser::Impl::write_manifest(const std::string& bundle_path,
SharedPtr<const Patch> patch,
@@ -201,23 +191,16 @@ normal_bundle_uri(const std::string& uri)
void
Serialiser::write_bundle(SharedPtr<const Patch> patch,
- const std::string& uri)
+ const std::string& path)
{
- me->write_bundle(patch, uri);
+ me->write_bundle(patch, path);
}
void
Serialiser::Impl::write_bundle(SharedPtr<const Patch> patch,
- const std::string& uri)
+ const std::string& a_path)
{
- Glib::ustring path = "";
- try {
- path = Glib::filename_from_uri(uri);
- } catch (...) {
- LOG(error) << "Illegal file URI `" << uri << "'" << endl;
- return;
- }
-
+ std::string path(a_path);
if (Glib::file_test(path, Glib::FILE_TEST_EXISTS)
&& !Glib::file_test(path, Glib::FILE_TEST_IS_DIR)) {
path = Glib::path_get_dirname(path);
@@ -228,8 +211,10 @@ Serialiser::Impl::write_bundle(SharedPtr<const Patch> patch,
g_mkdir_with_parents(path.c_str(), 0744);
- const string symbol = uri_to_symbol(uri);
- const string root_file = path + symbol + ".ttl";
+ string symbol = Glib::path_get_basename(path);
+ symbol = symbol.substr(0, symbol.find("."));
+
+ const string root_file = Glib::build_filename(path, symbol + ".ttl");
start_to_filename(root_file);
const Path old_root_path = _root_path;