diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2016-02-11 01:32:03 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2016-02-11 01:32:03 +0000 |
commit | 8b6da058806846aaf56f9252e786cc7174e637f2 (patch) | |
tree | 009c2b11e640ce9e863b012fd3918785b235223b | |
parent | Pass config file path as a path, not a string (diff) | |
download | netfs-8b6da058806846aaf56f9252e786cc7174e637f2.tar.bz2 netfs-8b6da058806846aaf56f9252e786cc7174e637f2.tar.xz netfs-8b6da058806846aaf56f9252e786cc7174e637f2.zip |
Get config deserializer by file extension
-rw-r--r-- | netfs/daemon/daemon.cpp | 4 | ||||
-rw-r--r-- | netfs/fuse/fuseApp.cpp | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/netfs/daemon/daemon.cpp b/netfs/daemon/daemon.cpp index 4db21cb..d5af905 100644 --- a/netfs/daemon/daemon.cpp +++ b/netfs/daemon/daemon.cpp @@ -3,7 +3,6 @@ #include "daemonService.h" #include "daemonVolume.h" #include <slicer/slicer.h> -#include <xml/serializer.h> #include "modeCheck.h" #include <sys/stat.h> @@ -47,7 +46,8 @@ NetFSDaemon::start(const std::string & name, const Ice::CommunicatorPtr & ic, co NetFS::Daemon::ConfigurationPtr NetFSDaemon::ReadConfiguration(const boost::filesystem::path & path) const { - return Slicer::DeserializeAny<Slicer::XmlFileDeserializer, NetFS::Daemon::ConfigurationPtr>(path); + auto s = Slicer::FileDeserializerFactory::createNew(path.extension().string(), path); + return Slicer::DeserializeAnyWith<NetFS::Daemon::ConfigurationPtr>(s); } void diff --git a/netfs/fuse/fuseApp.cpp b/netfs/fuse/fuseApp.cpp index a7d84b5..8bd73cd 100644 --- a/netfs/fuse/fuseApp.cpp +++ b/netfs/fuse/fuseApp.cpp @@ -5,7 +5,6 @@ #include "cache.impl.h" #include <entCache.h> #include <slicer/slicer.h> -#include <xml/serializer.h> #include <uriParse.h> namespace AdHoc { @@ -63,7 +62,8 @@ NetFS::FuseApp::~FuseApp() NetFS::Client::ConfigurationPtr NetFS::FuseApp::ReadConfiguration(const boost::filesystem::path & path) const { - return Slicer::DeserializeAny<Slicer::XmlFileDeserializer, NetFS::Client::ConfigurationPtr>(path); + auto s = Slicer::FileDeserializerFactory::createNew(path.extension().string(), path); + return Slicer::DeserializeAnyWith<NetFS::Client::ConfigurationPtr>(s); } void * |