summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--icespider/core/core.cpp18
-rw-r--r--icespider/core/core.h5
2 files changed, 5 insertions, 18 deletions
diff --git a/icespider/core/core.cpp b/icespider/core/core.cpp
index 6bf8ad3..aa1f02a 100644
--- a/icespider/core/core.cpp
+++ b/icespider/core/core.cpp
@@ -125,23 +125,9 @@ namespace IceSpider {
}
Ice::ObjectPrxPtr
- Core::getProxy(const char * type) const
+ Core::getProxy(const std::string_view type) const
{
- auto buf = demangle(type);
- char * c = buf.get();
- int off = 0;
- while (*c) {
- if (*(c + 1) == ':' && *c == ':') {
- *c = '.';
- off += 1;
- }
- else if (off) {
- *c = *(c + off);
- }
- c += 1;
- }
- auto i = communicator->propertyToProxy(buf.get());
- return i;
+ return communicator->propertyToProxy(std::string {type});
}
static bool
diff --git a/icespider/core/core.h b/icespider/core/core.h
index d60b20f..a77ce1a 100644
--- a/icespider/core/core.h
+++ b/icespider/core/core.h
@@ -2,6 +2,7 @@
#define ICESPIDER_CORE_CORE_H
#include "irouteHandler.h"
+#include "util.h"
#include <Ice/Communicator.h>
#include <c++11Helpers.h>
#include <filesystem>
@@ -22,13 +23,13 @@ namespace IceSpider {
void process(IHttpRequest *, const IRouteHandler * = nullptr) const;
void handleError(IHttpRequest *, const std::exception &) const;
- [[nodiscard]] Ice::ObjectPrxPtr getProxy(const char * type) const;
+ [[nodiscard]] Ice::ObjectPrxPtr getProxy(std::string_view type) const;
template<typename Interface>
[[nodiscard]] auto
getProxy() const
{
- return Ice::uncheckedCast<typename Interface::ProxyType>(getProxy(typeid(Interface).name()));
+ return Ice::uncheckedCast<typename Interface::ProxyType>(getProxy(TypeName<Interface>::str()));
}
AllRoutes allRoutes;