summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2018-04-15 12:09:27 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2018-04-15 12:09:27 +0100
commitda393fc67ebce5fa269615c5c967f1467dc0d5cf (patch)
treeffeaef182861b2f43c2d3a1c00927326229a55c3
parentDedupe map dumping (diff)
downloadicespider-da393fc67ebce5fa269615c5c967f1467dc0d5cf.tar.bz2
icespider-da393fc67ebce5fa269615c5c967f1467dc0d5cf.tar.xz
icespider-da393fc67ebce5fa269615c5c967f1467dc0d5cf.zip
C++17 and Ice 3.7icespider-0.4
Update all code to be C++17 with Ice 3.7 and minor interface changes in keeping with C++CG and dependencies.
-rw-r--r--.gitmodules4
-rw-r--r--Jamroot.jam15
m---------ice0
-rw-r--r--icespider/Jamfile.jam3
-rw-r--r--icespider/common/Jamfile.jam4
-rw-r--r--icespider/common/http.ice1
-rw-r--r--icespider/common/pathparts.h2
-rw-r--r--icespider/common/session.ice1
-rw-r--r--icespider/compile/Jamfile.jam21
-rw-r--r--icespider/compile/icespider.jam3
-rw-r--r--icespider/compile/main.cpp1
-rw-r--r--icespider/compile/routeCompiler.cpp75
-rw-r--r--icespider/compile/routeCompiler.h6
-rw-r--r--icespider/compile/routes.ice (renamed from icespider/common/routes.ice)1
-rw-r--r--icespider/compile/slice/Jamroot.jam22
-rw-r--r--icespider/core/core.cpp14
-rw-r--r--icespider/core/core.h10
-rw-r--r--icespider/core/ihttpRequest.cpp32
-rw-r--r--icespider/core/ihttpRequest.h30
-rw-r--r--icespider/core/irouteHandler.cpp9
-rw-r--r--icespider/core/irouteHandler.h7
-rw-r--r--icespider/core/util.h4
-rw-r--r--icespider/fcgi/cgiRequestBase.cpp4
-rw-r--r--icespider/fileSessions/fileSessions.cpp21
-rw-r--r--icespider/unittests/Jamfile.jam3
-rw-r--r--icespider/unittests/testApp.cpp13
-rw-r--r--icespider/unittests/testCompile.cpp77
-rw-r--r--icespider/unittests/testFcgi.cpp20
-rw-r--r--icespider/xslt/Jamfile.jam2
-rw-r--r--icespider/xslt/xsltStreamSerializer.cpp4
-rw-r--r--icespider/xslt/xsltStreamSerializer.h2
-rw-r--r--slice.jam12
32 files changed, 173 insertions, 250 deletions
diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 0000000..e0e648c
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,4 @@
+[submodule "ice"]
+ path = ice
+ url = https://github.com/zeroc-ice/ice
+ branch = 3.7
diff --git a/Jamroot.jam b/Jamroot.jam
index 563d34d..7f15912 100644
--- a/Jamroot.jam
+++ b/Jamroot.jam
@@ -7,13 +7,14 @@ variant coverage : debug ;
project
: requirements
- <cxxflags>"-std=c++17 -fvisibility=hidden"
- <linkflags>"-Wl,-z,defs,--warn-once,--gc-sections"
- <variant>release:<cxxflags>"-fvisibility-inlines-hidden -flto=2"
- <variant>release:<linkflags>"-flto=2"
- <variant>debug:<cxxflags>"-W -Wall -Wextra -Werror -Wwrite-strings"
- <variant>coverage:<cxxflags>"--coverage"
- <variant>coverage:<linkflags>"--coverage"
+ <define>ICE_CPP11_MAPPING
+ <cxxflags>"-std=c++17 -fvisibility-inlines-hidden -Werror -fvisibility=hidden"
+ <linkflags>"-Wl,-z,defs,--warn-once,--gc-sections"
+ <variant>release:<cxxflags>"-flto=2"
+ <variant>release:<linkflags>"-flto=2"
+ <variant>debug:<cxxflags>"-W -Wall -Wextra -Werror -Wwrite-strings"
+ <variant>coverage:<cxxflags>"--coverage"
+ <variant>coverage:<linkflags>"--coverage"
;
build-project icespider ;
diff --git a/ice b/ice
new file mode 160000
+Subproject fed3c47a56b237ca307336f1ea8eeac94185ca1
diff --git a/icespider/Jamfile.jam b/icespider/Jamfile.jam
index 02644a2..723d4f9 100644
--- a/icespider/Jamfile.jam
+++ b/icespider/Jamfile.jam
@@ -8,8 +8,7 @@ build-project xslt ;
build-project fileSessions ;
build-project testing ;
-lib Ice ;
-lib IceUtil ;
+lib Ice : : <name>Ice++11 ;
lib pthread ;
package.install install : :
diff --git a/icespider/common/Jamfile.jam b/icespider/common/Jamfile.jam
index a3acf6b..0c53482 100644
--- a/icespider/common/Jamfile.jam
+++ b/icespider/common/Jamfile.jam
@@ -5,7 +5,6 @@ cpp http-slicer :
http.ice
:
<slicer>pure
- <allow-ice>yes
;
lib icespider-common :
@@ -13,15 +12,12 @@ lib icespider-common :
http-slicer
:
<library>adhocutil
- <allow-ice>yes
<library>..//pthread
<library>..//Ice
- <library>..//IceUtil
<library>slicer
: :
<library>..//pthread
<library>..//Ice
- <library>..//IceUtil
<include>.
;
diff --git a/icespider/common/http.ice b/icespider/common/http.ice
index 1f7dcd4..a44a492 100644
--- a/icespider/common/http.ice
+++ b/icespider/common/http.ice
@@ -1,6 +1,7 @@
#ifndef ICESPIDER_HTTP_ICE
#define ICESPIDER_HTTP_ICE
+[["ice-prefix"]]
module IceSpider {
["slicer:ignore"]
local exception HttpException {
diff --git a/icespider/common/pathparts.h b/icespider/common/pathparts.h
index 0720af0..e4d97a1 100644
--- a/icespider/common/pathparts.h
+++ b/icespider/common/pathparts.h
@@ -9,6 +9,8 @@
namespace IceSpider {
class DLL_PUBLIC PathPart {
public:
+ virtual ~PathPart() = default;
+
virtual bool matches(const std::string &) const = 0;
};
typedef std::shared_ptr<PathPart> PathPartPtr;
diff --git a/icespider/common/session.ice b/icespider/common/session.ice
index 4947f9f..37c0c9b 100644
--- a/icespider/common/session.ice
+++ b/icespider/common/session.ice
@@ -1,6 +1,7 @@
#ifndef ICESPIDER_SESSION_ICE
#define ICESPIDER_SESSION_ICE
+[["ice-prefix"]]
module IceSpider {
dictionary<string, string> Variables;
diff --git a/icespider/compile/Jamfile.jam b/icespider/compile/Jamfile.jam
index 986b3c3..2021abe 100644
--- a/icespider/compile/Jamfile.jam
+++ b/icespider/compile/Jamfile.jam
@@ -4,30 +4,32 @@ lib slicer-json ;
lib boost_program_options ;
lib boost_system ;
lib boost_filesystem ;
-lib Slice ;
+lib mcpp ;
lib icespider-compile :
- [ glob-tree *.cpp : bin main.cpp ]
- ../common/routes.ice
+ routeCompiler.cpp
+ routes.ice
:
- <slicer>pure
- <allow-ice>yes
+ <slicer>yes
+# Need to disable LTO here cos of a GCC bug, this isn't
+# performance critical anyway
+ <linkflags>-fno-lto
+ <cxxflags>-fno-lto
<library>slicer
<library>adhocutil
<library>slicer-json
<library>boost_system
<library>boost_filesystem
- <library>Slice
+ <library>slice//Slice
<library>../common//icespider-common
- <implicit-dependency>../common
+ <implicit-dependency>../common//icespider-common
<library>..//Ice
- <library>..//IceUtil
<library>..//pthread
+ <library>mcpp
: :
<library>boost_system
<library>boost_filesystem
<library>../common//icespider-common
- <implicit-dependency>../common
;
exe icespider :
@@ -35,5 +37,6 @@ exe icespider :
:
<library>boost_program_options
<library>icespider-compile
+ <implicit-dependency>icespider-compile
;
diff --git a/icespider/compile/icespider.jam b/icespider/compile/icespider.jam
index 4513494..6f5266c 100644
--- a/icespider/compile/icespider.jam
+++ b/icespider/compile/icespider.jam
@@ -8,11 +8,10 @@ type.register JSON : json ;
generators.register-standard icespider.routes2cpp : JSON : CPP(icespider-routes-%) H(icespider-routes-%) ;
flags icespider.routes2cpp INCLUDES <include> ;
-flags icespider.routes2cpp ALLOWICE <allow-ice>yes : --ice ;
actions icespider.routes2cpp bind ICESPIDER
{
- icespider -I"$(INCLUDES)" $(ALLOWICE[1]) $(2) $(1[1])
+ icespider -I"$(INCLUDES)" $(2) $(1[1])
}
IMPORT $(__name__) : icespider.routes2cpp : : icespider.routes2cpp ;
diff --git a/icespider/compile/main.cpp b/icespider/compile/main.cpp
index 7be6579..3d5311f 100644
--- a/icespider/compile/main.cpp
+++ b/icespider/compile/main.cpp
@@ -14,7 +14,6 @@ main(int c, char ** v)
("input", po::value(&input), "Input .json file")
("output", po::value(&output), "Output .cpp file")
("include,I", po::value(&rc.searchPath)->composing(), "Search path")
- ("ice", po::value(&rc.allowIcePrefix)->default_value(rc.allowIcePrefix)->zero_tokens(), "Allow reserved Ice prefix in Slice identifiers")
("help,h", po::value(&showHelp)->default_value(false)->zero_tokens(), "Help")
;
po::positional_options_description pod;
diff --git a/icespider/compile/routeCompiler.cpp b/icespider/compile/routeCompiler.cpp
index e069b4f..40ce5fd 100644
--- a/icespider/compile/routeCompiler.cpp
+++ b/icespider/compile/routeCompiler.cpp
@@ -11,10 +11,10 @@
#include <Slice/CPlusPlusUtil.h>
#include <compileTimeFormatter.h>
+
namespace IceSpider {
namespace Compile {
- RouteCompiler::RouteCompiler() :
- allowIcePrefix(false)
+ RouteCompiler::RouteCompiler()
{
searchPath.push_back(boost::filesystem::current_path());
}
@@ -119,7 +119,7 @@ namespace IceSpider {
{
for (const auto & r : c->routes) {
if (r.second->operation) {
- r.second->operations[std::string()] = new Operation(*r.second->operation, {});
+ r.second->operations[std::string()] = std::make_shared<Operation>(*r.second->operation, StringMap());
}
auto ps = findParameters(r.second, u);
for (const auto & p : ps) {
@@ -130,7 +130,7 @@ namespace IceSpider {
}
}
else {
- defined = r.second->params.insert({ p.first, new Parameter(ParameterSource::URL, p.first, false, IceUtil::Optional<std::string>(), IceUtil::Optional<std::string>(), false) }).first;
+ defined = r.second->params.insert({ p.first, std::make_shared<Parameter>(ParameterSource::URL, p.first, false, Ice::optional<std::string>(), Ice::optional<std::string>(), false) }).first;
}
auto d = defined->second;
if (d->source == ParameterSource::URL) {
@@ -206,7 +206,7 @@ namespace IceSpider {
throw std::runtime_error("Preprocess failed");
}
- Slice::UnitPtr u = Slice::Unit::createUnit(false, false, allowIcePrefix, false);
+ Slice::UnitPtr u = Slice::Unit::createUnit(false, false, false, false);
uDestroy.onFailure.push_back([u]() { u->destroy(); });
int parseStatus = u->parse(realSlice.string(), cppHandle, false);
@@ -247,16 +247,6 @@ namespace IceSpider {
return boost::algorithm::replace_all_copy(os.second->serializer, ".", "::");
}
- static
- std::string
- outputSerializerName(const IceSpider::OutputSerializers::value_type & os)
- {
- std::string name("_serializer_");
- std::replace_copy_if(os.first.begin(), os.first.end(), std::back_inserter(name),
- std::not1(std::ptr_fun(isalnum)), '_');
- return name;
- }
-
AdHocFormatter(MimePair, R"C({ "%?", "%?" })C");
static
std::string
@@ -268,48 +258,20 @@ namespace IceSpider {
}
void
- RouteCompiler::defineOutputSerializers(FILE * output, RoutePtr r) const
+ RouteCompiler::registerOutputSerializers(FILE * output, RoutePtr r) const
{
for (const auto & os : r->outputSerializers) {
- fprintf(output, ",\n");
- fprintbf(4, output, "%s(",
- outputSerializerName(os));
+ fprintbf(4, output, "addRouteSerializer(%s,\n",
+ outputSerializerMime(os));
+ fprintbf(6, output, "std::make_shared<%s::IceSpiderFactory>(",
+ outputSerializerClass(os));
for (auto p = os.second->params.begin(); p != os.second->params.end(); ++p) {
if (p != os.second->params.begin()) {
fprintf(output, ", ");
}
fputs(p->c_str(), output);
}
- fprintf(output, ")");
- }
- }
-
- void
- RouteCompiler::registerOutputSerializers(FILE * output, RoutePtr r) const
- {
- for (const auto & os : r->outputSerializers) {
- fprintbf(4, output, "addRouteSerializer(%s, &%s);\n",
- outputSerializerMime(os),
- outputSerializerName(os));
- }
- }
-
- void
- RouteCompiler::releaseOutputSerializers(FILE * output, RoutePtr r) const
- {
- for (const auto & os : r->outputSerializers) {
- fprintbf(4, output, "removeRouteSerializer(%s);\n",
- outputSerializerMime(os));
- }
- }
-
- void
- RouteCompiler::declareOutputSerializers(FILE * output, RoutePtr r) const
- {
- for (const auto & os : r->outputSerializers) {
- fprintbf(3, output, "%s::IceSpiderFactory %s;\n",
- outputSerializerClass(os),
- outputSerializerName(os));
+ fprintf(output, "));\n");
}
}
@@ -382,7 +344,7 @@ namespace IceSpider {
fprintf(output, "\n");
unsigned int pn = 0;
for (const auto & p : b.second->proxies) {
- fprintbf(3, outputh, "const %sPrx prx%u;\n",
+ fprintbf(3, outputh, "const %sPrxPtr prx%u;\n",
boost::algorithm::replace_all_copy(p, ".", "::"), pn);
fprintbf(3, output, "prx%u(core->getProxy<%s>())",
pn, boost::algorithm::replace_all_copy(p, ".", "::"));
@@ -432,7 +394,6 @@ namespace IceSpider {
fprintbf(4, output, "%s(core)", b);
}
auto proxies = initializeProxies(output, r.second);
- defineOutputSerializers(output, r.second);
for (const auto & p : r.second->params) {
if (p.second->hasUserSource) {
if (p.second->source == ParameterSource::URL) {
@@ -458,7 +419,7 @@ namespace IceSpider {
if (p.second->defaultExpr) {
fprintf(output, ",\n");
fprintbf(4, output, "_pd_%s(%s)",
- p.first, p.second->defaultExpr.get());
+ p.first, *p.second->defaultExpr);
}
}
fprintf(output, "\n");
@@ -467,7 +428,6 @@ namespace IceSpider {
fprintbf(3, output, "}\n\n");
fprintbf(3, output, "~%s()\n", r.first);
fprintbf(3, output, "{\n");
- releaseOutputSerializers(output, r.second);
fprintbf(3, output, "}\n\n");
fprintbf(3, output, "void execute(IceSpider::IHttpRequest * request) const\n");
fprintbf(3, output, "{\n");
@@ -532,7 +492,6 @@ namespace IceSpider {
fprintbf(3, output, "}\n\n");
fprintbf(2, output, "private:\n");
declareProxies(output, proxies);
- declareOutputSerializers(output, r.second);
for (const auto & p : r.second->params) {
if (p.second->hasUserSource) {
if (p.second->source == ParameterSource::URL) {
@@ -573,7 +532,7 @@ namespace IceSpider {
RouteCompiler::declareProxies(FILE * output, const Proxies & proxies) const
{
for (const auto & p : proxies) {
- fprintbf(3, output, "const %sPrx prx%d;\n", boost::algorithm::replace_all_copy(p.first, ".", "::"), p.second);
+ fprintbf(3, output, "const %sPrxPtr prx%d;\n", boost::algorithm::replace_all_copy(p.first, ".", "::"), p.second);
}
}
@@ -614,7 +573,7 @@ namespace IceSpider {
for (const auto & o : r->operations) {
auto proxyName = o.second->operation.substr(0, o.second->operation.find_last_of('.'));
auto operation = o.second->operation.substr(o.second->operation.find_last_of('.') + 1);
- fprintbf(4, output, "auto _ar_%s = prx%s->begin_%s(", o.first, proxies.find(proxyName)->second, operation);
+ fprintbf(4, output, "auto _ar_%s = prx%s->%sAsync(", o.first, proxies.find(proxyName)->second, operation);
auto so = findOperation(o.second->operation, us);
for (const auto & p : so->parameters()) {
auto po = o.second->paramOverrides.find(p->name());
@@ -631,7 +590,7 @@ namespace IceSpider {
auto t = findType(r->type, us);
Slice::DataMemberList members;
if (t.second) {
- fprintbf(4, output, "%s _responseModel = new %s();\n",
+ fprintbf(4, output, "%s _responseModel = std::make_shared<%s>();\n",
Slice::typeToString(t.second),
t.second->scoped());
members = t.second->definition()->dataMembers();
@@ -650,7 +609,7 @@ namespace IceSpider {
auto proxyName = o.second->operation.substr(0, o.second->operation.find_last_of('.'));
auto operation = o.second->operation.substr(o.second->operation.find_last_of('.') + 1);
if (mi->name() == o.first) {
- fprintbf(output, "prx%s->end_%s(_ar_%s)", proxies.find(proxyName)->second, operation, o.first);
+ fprintbf(output, "_ar_%s.get()", o.first);
isOp = true;
break;
}
diff --git a/icespider/compile/routeCompiler.h b/icespider/compile/routeCompiler.h
index cfc215f..b8bb6b9 100644
--- a/icespider/compile/routeCompiler.h
+++ b/icespider/compile/routeCompiler.h
@@ -23,20 +23,17 @@ namespace IceSpider {
void compile(const boost::filesystem::path & input, const boost::filesystem::path & output) const;
std::vector<boost::filesystem::path> searchPath;
- bool allowIcePrefix;
private:
typedef std::map<std::string, int> Proxies;
+#pragma GCC visibility push(hidden)
void processConfiguration(FILE * output, FILE * outputh, const std::string & name, RouteConfigurationPtr, const Units &) const;
void processBases(FILE * output, FILE * outputh, RouteConfigurationPtr, const Units &) const;
void processBase(FILE * output, FILE * outputh, const RouteBases::value_type &, const Units &) const;
void processRoutes(FILE * output, RouteConfigurationPtr, const Units &) const;
void processRoute(FILE * output, const Routes::value_type &, const Units &) const;
- void defineOutputSerializers(FILE * output, RoutePtr) const;
void registerOutputSerializers(FILE * output, RoutePtr) const;
- void releaseOutputSerializers(FILE * output, RoutePtr) const;
- void declareOutputSerializers(FILE * output, RoutePtr) const;
Proxies initializeProxies(FILE * output, RoutePtr) const;
void declareProxies(FILE * output, const Proxies &) const;
void addSingleOperation(FILE * output, RoutePtr, Slice::OperationPtr) const;
@@ -48,6 +45,7 @@ namespace IceSpider {
typedef std::pair<Slice::StructPtr, Slice::ClassDeclPtr> Type;
static Type findType(const std::string &, const Units &);
static Type findType(const std::string &, const Slice::ContainerPtr &, const Ice::StringSeq & = Ice::StringSeq());
+#pragma GCC visibility pop
};
}
}
diff --git a/icespider/common/routes.ice b/icespider/compile/routes.ice
index 4a3d460..2c25664 100644
--- a/icespider/common/routes.ice
+++ b/icespider/compile/routes.ice
@@ -3,6 +3,7 @@
#include "http.ice"
+[["ice-prefix"]]
module IceSpider {
local sequence<string> StringSeq;
diff --git a/icespider/compile/slice/Jamroot.jam b/icespider/compile/slice/Jamroot.jam
new file mode 100644
index 0000000..46b4e3c
--- /dev/null
+++ b/icespider/compile/slice/Jamroot.jam
@@ -0,0 +1,22 @@
+project ice :
+ : requirements
+ ;
+
+path-constant ice : ../../../ice ;
+
+lib Slice :
+ $(ice)/cpp/src/Slice/Parser.cpp
+ $(ice)/cpp/src/Slice/Grammar.cpp
+ $(ice)/cpp/src/Slice/Preprocessor.cpp
+ $(ice)/cpp/src/Slice/CPlusPlusUtil.cpp
+ $(ice)/cpp/src/Slice/SliceUtil.cpp
+ $(ice)/cpp/src/Slice/FileTracker.cpp
+ $(ice)/cpp/src/Slice/Scanner.cpp
+ :
+ <cxxflags>-fPIC
+ <include>$(ice)/cpp/src
+ <link>static
+ : :
+ <include>$(ice)/cpp/src
+ ;
+
diff --git a/icespider/core/core.cpp b/icespider/core/core.cpp
index 057faa6..bbb4b05 100644
--- a/icespider/core/core.cpp
+++ b/icespider/core/core.cpp
@@ -36,7 +36,7 @@ namespace IceSpider {
pluginAdapter = communicator->createObjectAdapterWithEndpoints("plugins", "default");
for (const auto & pf : plugins) {
auto p = pf->implementation()->create(communicator, communicator->getProperties());
- pluginAdapter->add(p, communicator->stringToIdentity(pf->name));
+ pluginAdapter->add(p, Ice::stringToIdentity(pf->name));
}
pluginAdapter->activate();
}
@@ -48,15 +48,11 @@ namespace IceSpider {
auto plugins = AdHoc::PluginManager::getDefault()->getAll<PluginFactory>();
if (!plugins.empty()) {
for (const auto & pf : plugins) {
- pluginAdapter->remove(communicator->stringToIdentity(pf->name));
+ pluginAdapter->remove(Ice::stringToIdentity(pf->name));
}
pluginAdapter->deactivate();
pluginAdapter->destroy();
}
- // Terminate routes
- for (auto r : allRoutes) {
- delete r;
- }
if (communicator) communicator->destroy();
}
@@ -119,7 +115,7 @@ namespace IceSpider {
free(buf);
}
- Ice::ObjectPrx
+ Ice::ObjectPrxPtr
Core::getProxy(const char * type) const
{
char * buf = __cxxabiv1::__cxa_demangle(type, NULL, NULL, NULL);
@@ -174,9 +170,9 @@ namespace IceSpider {
const auto & routeSet = routes[pathparts.size()];
bool match = false;
for (const auto & r : routeSet) {
- if (pathparts /= r) {
+ if (pathparts /= r.get()) {
if (r->method == method) {
- return r;
+ return r.get();
}
match = true;
}
diff --git a/icespider/core/core.h b/icespider/core/core.h
index f358009..f6fbd6e 100644
--- a/icespider/core/core.h
+++ b/icespider/core/core.h
@@ -11,7 +11,7 @@
namespace IceSpider {
class DLL_PUBLIC Core {
public:
- typedef std::vector<const IRouteHandler *> AllRoutes;
+ typedef std::vector<IRouteHandlerCPtr> AllRoutes;
Core(const Ice::StringSeq & = {});
virtual ~Core();
@@ -20,12 +20,12 @@ namespace IceSpider {
void process(IHttpRequest *, const IRouteHandler * = nullptr) const;
void handleError(IHttpRequest *, const std::exception &) const;
- Ice::ObjectPrx getProxy(const char * type) const;
+ Ice::ObjectPrxPtr getProxy(const char * type) const;
template<typename Interface>
- typename Interface::ProxyType getProxy() const
+ auto getProxy() const
{
- return Interface::ProxyType::uncheckedCast(getProxy(typeid(Interface).name()));
+ return Ice::uncheckedCast<typename Interface::ProxyType>(getProxy(typeid(Interface).name()));
}
AllRoutes allRoutes;
@@ -40,7 +40,7 @@ namespace IceSpider {
class DLL_PUBLIC CoreWithDefaultRouter : public Core {
public:
- typedef std::vector<const IRouteHandler *> LengthRoutes;
+ typedef std::vector<IRouteHandlerCPtr> LengthRoutes;
typedef std::vector<LengthRoutes> Routes;
CoreWithDefaultRouter(const Ice::StringSeq & = {});
diff --git a/icespider/core/ihttpRequest.cpp b/icespider/core/ihttpRequest.cpp
index dea84e0..35eb465 100644
--- a/icespider/core/ihttpRequest.cpp
+++ b/icespider/core/ihttpRequest.cpp
@@ -46,15 +46,15 @@ namespace IceSpider {
while ((v = sscanf(accept, " %[^ /] / %[^ ;,] %n , %n", grp, type, &chars, &chars)) == 2) {
accept += chars;
chars = 0;
- auto a = new Accept();
+ auto a = std::make_shared<Accept>();
if ((v = sscanf(accept, " ; q = %f %n , %n", &pri, &chars, &chars)) == 1) {
a->q = pri;
}
if (strcmp(grp, "*")) {
- a->group = grp;
+ a->group.emplace(grp);
}
if (strcmp(type, "*")) {
- a->type = type;
+ a->type.emplace(type);
}
accept += chars;
accepts.push_back(a);
@@ -98,8 +98,8 @@ namespace IceSpider {
// Set-Cookie: value[; expires=date][; domain=domain][; path=path][; secure]
// Sat, 02 May 2009 23:38:25 GMT
void IHttpRequest::setCookie(const std::string & name, const std::string & value,
- const IceUtil::Optional<std::string> & d, const IceUtil::Optional<std::string> & p, bool s,
- IceUtil::Optional<time_t> e)
+ const Ice::optional<std::string> & d, const Ice::optional<std::string> & p, bool s,
+ Ice::optional<time_t> e)
{
std::stringstream o;
o << XWwwFormUrlEncoded::urlencode(name) <<
@@ -119,13 +119,13 @@ namespace IceSpider {
}
template <typename T>
- inline IceUtil::Optional<T> optionalLexicalCast(const IceUtil::Optional<std::string> & p)
+ inline Ice::optional<T> optionalLexicalCast(const Ice::optional<std::string> & p)
{
if (p) return wrapLexicalCast<T>(*p);
- return IceUtil::Optional<T>();
+ return Ice::optional<T>();
}
- void IHttpRequest::responseRedirect(const std::string & url, const IceUtil::Optional<std::string> & statusMsg) const
+ void IHttpRequest::responseRedirect(const std::string & url, const Ice::optional<std::string> & statusMsg) const
{
setHeader("Location", url);
response(303, (statusMsg ? *statusMsg : "Moved"));
@@ -134,24 +134,24 @@ namespace IceSpider {
#define getParams(T) \
template<> void IHttpRequest::setCookie<T>(const std::string & n, const T & v, \
- const IceUtil::Optional<std::string> & d, const IceUtil::Optional<std::string> & p, \
- bool s, IceUtil::Optional<time_t> e) { \
+ const Ice::optional<std::string> & d, const Ice::optional<std::string> & p, \
+ bool s, Ice::optional<time_t> e) { \
setCookie(n, boost::lexical_cast<std::string>(v), d, p, s, e); } \
template<> T IHttpRequest::getURLParam<T>(unsigned int idx) const { \
return wrapLexicalCast<T>(getURLParam(idx)); } \
- template<> IceUtil::Optional<T> IHttpRequest::getQueryStringParam<T>(const std::string & key) const { \
+ template<> Ice::optional<T> IHttpRequest::getQueryStringParam<T>(const std::string & key) const { \
return optionalLexicalCast<T>(getQueryStringParam(key)); } \
- template<> IceUtil::Optional<T> IHttpRequest::getCookieParam<T>(const std::string & key) const { \
+ template<> Ice::optional<T> IHttpRequest::getCookieParam<T>(const std::string & key) const { \
return optionalLexicalCast<T>(getCookieParam(key)); } \
- template<> IceUtil::Optional<T> IHttpRequest::getHeaderParam<T>(const std::string & key) const { \
+ template<> Ice::optional<T> IHttpRequest::getHeaderParam<T>(const std::string & key) const { \
return optionalLexicalCast<T>(getHeaderParam(key)); }
template<> std::string IHttpRequest::getURLParam<std::string>(unsigned int idx) const {
return getURLParam(idx); }
- template<> IceUtil::Optional<std::string> IHttpRequest::getQueryStringParam<std::string>(const std::string & key) const { \
+ template<> Ice::optional<std::string> IHttpRequest::getQueryStringParam<std::string>(const std::string & key) const { \
return getQueryStringParam(key); }
- template<> IceUtil::Optional<std::string> IHttpRequest::getCookieParam<std::string>(const std::string & key) const { \
+ template<> Ice::optional<std::string> IHttpRequest::getCookieParam<std::string>(const std::string & key) const { \
return getCookieParam(key); }
- template<> IceUtil::Optional<std::string> IHttpRequest::getHeaderParam<std::string>(const std::string & key) const { \
+ template<> Ice::optional<std::string> IHttpRequest::getHeaderParam<std::string>(const std::string & key) const { \
return getHeaderParam(key); }
getParams(bool);
diff --git a/icespider/core/ihttpRequest.h b/icespider/core/ihttpRequest.h
index b46477f..bbd83fb 100644
--- a/icespider/core/ihttpRequest.h
+++ b/icespider/core/ihttpRequest.h
@@ -5,9 +5,9 @@
#include <IceUtil/Optional.h>
#include <Ice/Current.h>
#include <visibility.h>
-#include <routes.h>
+#include <http.h>
#include <slicer/slicer.h>
-#include <IceUtil/Optional.h>
+#include <Ice/Optional.h>
#include <boost/lexical_cast.hpp>
namespace IceSpider {
@@ -15,7 +15,7 @@ namespace IceSpider {
class IRouteHandler;
typedef std::vector<std::string> PathElements;
- typedef IceUtil::Optional<std::string> OptionalString;
+ typedef Ice::optional<std::string> OptionalString;
typedef std::pair<MimeType, Slicer::SerializerPtr> ContentTypeSerializer;
class DLL_PUBLIC IHttpRequest {
@@ -47,37 +47,37 @@ namespace IceSpider {
template<typename T>
T getURLParam(unsigned int) const;
template<typename T>
- IceUtil::Optional<T> getBody() const
+ Ice::optional<T> getBody() const
{
return Slicer::DeserializeAnyWith<T>(getDeserializer());
}
template<typename T>
- IceUtil::Optional<T> getBodyParam(const IceUtil::Optional<IceSpider::StringMap> & map, const std::string & key) const
+ Ice::optional<T> getBodyParam(const Ice::optional<IceSpider::StringMap> & map, const std::string & key) const
{
if (!map) {
- return IceUtil::Optional<T>();
+ return Ice::optional<T>();
}
auto i = map->find(key);
if (i == map->end()) {
- return IceUtil::Optional<T>();
+ return Ice::optional<T>();
}
else {
return boost::lexical_cast<T>(i->second);
}
}
- void responseRedirect(const std::string & url, const IceUtil::Optional<std::string> & = IceUtil::None) const;
+ void responseRedirect(const std::string & url, const Ice::optional<std::string> & = IceUtil::None) const;
void setCookie(const std::string &, const std::string &,
- const IceUtil::Optional<std::string> & = IceUtil::None, const IceUtil::Optional<std::string> & = IceUtil::None,
- bool = false, IceUtil::Optional<time_t> = IceUtil::None);
+ const Ice::optional<std::string> & = IceUtil::None, const Ice::optional<std::string> & = IceUtil::None,
+ bool = false, Ice::optional<time_t> = IceUtil::None);
template<typename T>
- void setCookie(const std::string &, const T &, const IceUtil::Optional<std::string> & = IceUtil::None,
- const IceUtil::Optional<std::string> & = IceUtil::None, bool = false, IceUtil::Optional<time_t> = IceUtil::None);
+ void setCookie(const std::string &, const T &, const Ice::optional<std::string> & = IceUtil::None,
+ const Ice::optional<std::string> & = IceUtil::None, bool = false, Ice::optional<time_t> = IceUtil::None);
template<typename T>
- IceUtil::Optional<T> getQueryStringParam(const std::string & key) const;
+ Ice::optional<T> getQueryStringParam(const std::string & key) const;
template<typename T>
- IceUtil::Optional<T> getHeaderParam(const std::string & key) const;
+ Ice::optional<T> getHeaderParam(const std::string & key) const;
template<typename T>
- IceUtil::Optional<T> getCookieParam(const std::string & key) const;
+ Ice::optional<T> getCookieParam(const std::string & key) const;
virtual void response(short, const std::string &) const = 0;
template<typename T>
void response(const IRouteHandler * route, const T & t) const
diff --git a/icespider/core/irouteHandler.cpp b/icespider/core/irouteHandler.cpp
index 55e9f99..348ac8e 100644
--- a/icespider/core/irouteHandler.cpp
+++ b/icespider/core/irouteHandler.cpp
@@ -52,14 +52,5 @@ namespace IceSpider {
routeSerializers.erase(ct);
routeSerializers.insert({ ct, ssfp });
}
-
- void
- IRouteHandler::removeRouteSerializer(const MimeType & ct)
- {
- auto i = routeSerializers.find(ct);
- if (i != routeSerializers.end()) {
- routeSerializers.erase(i);
- }
- }
}
diff --git a/icespider/core/irouteHandler.h b/icespider/core/irouteHandler.h
index f3e271b..38bc1ed 100644
--- a/icespider/core/irouteHandler.h
+++ b/icespider/core/irouteHandler.h
@@ -5,10 +5,8 @@
#include "util.h"
#include "exceptions.h"
#include <pathparts.h>
-#include <routes.h>
#include <factory.h>
#include <visibility.h>
-#include <boost/lexical_cast.hpp>
namespace IceSpider {
class Core;
@@ -25,7 +23,7 @@ namespace IceSpider {
const HttpMethod method;
protected:
- typedef Slicer::StreamSerializerFactory * StreamSerializerFactoryPtr;
+ typedef std::shared_ptr<Slicer::StreamSerializerFactory> StreamSerializerFactoryPtr;
typedef std::map<MimeType, StreamSerializerFactoryPtr> RouteSerializers;
RouteSerializers routeSerializers;
@@ -41,8 +39,9 @@ namespace IceSpider {
}
void addRouteSerializer(const MimeType &, StreamSerializerFactoryPtr);
- void removeRouteSerializer(const MimeType &);
};
+ typedef std::shared_ptr<IRouteHandler> IRouteHandlerPtr;
+ typedef std::shared_ptr<const IRouteHandler> IRouteHandlerCPtr;
typedef AdHoc::Factory<IRouteHandler, const Core *> RouteHandlerFactory;
}
diff --git a/icespider/core/util.h b/icespider/core/util.h
index 461211d..658a1cc 100644
--- a/icespider/core/util.h
+++ b/icespider/core/util.h
@@ -4,9 +4,9 @@
#include <IceUtil/Exception.h>
#include <IceUtil/Optional.h>
-namespace IceUtil {
+namespace std::experimental::Ice {
template <typename T, typename TF>
- auto operator/(const IceUtil::Optional<T> & o, const TF & tf) -> decltype(tf())
+ auto operator/(const Ice::optional<T> & o, const TF & tf) -> decltype(tf())
{
if (o) return *o;
return tf();
diff --git a/icespider/fcgi/cgiRequestBase.cpp b/icespider/fcgi/cgiRequestBase.cpp
index 48a9daa..afeb560 100644
--- a/icespider/fcgi/cgiRequestBase.cpp
+++ b/icespider/fcgi/cgiRequestBase.cpp
@@ -186,7 +186,7 @@ namespace IceSpider {
CgiRequestBase::setQueryStringParam(const std::string & key, const OptionalString & val)
{
if (val)
- qsmap[key] = val;
+ qsmap[key] = *val;
else
qsmap.erase(key);
}
@@ -201,7 +201,7 @@ namespace IceSpider {
CgiRequestBase::setCookieParam(const std::string & key, const OptionalString & val)
{
if (val)
- cookiemap[key] = val;
+ cookiemap[key] = *val;
else
cookiemap.erase(key);
}
diff --git a/icespider/fileSessions/fileSessions.cpp b/icespider/fileSessions/fileSessions.cpp
index 1672842..7791d3c 100644
--- a/icespider/fileSessions/fileSessions.cpp
+++ b/icespider/fileSessions/fileSessions.cpp
@@ -10,7 +10,8 @@
#include <boost/filesystem/operations.hpp>
#include <boost/uuid/uuid_generators.hpp>
#include <boost/uuid/uuid_io.hpp>
-#include <Ice/Stream.h>
+#include <Ice/OutputStream.h>
+#include <Ice/InputStream.h>
#include "Ice/Initialize.h"
namespace IceSpider {
@@ -33,14 +34,14 @@ namespace IceSpider {
SessionPtr createSession(const ::Ice::Current &) override
{
- SessionPtr s = new Session();
+ auto s = std::make_shared<Session>();
s->id = boost::lexical_cast<std::string>(boost::uuids::random_generator()());
s->duration = duration;
save(s);
return s;
}
- SessionPtr getSession(const ::std::string & id, const ::Ice::Current & current) override
+ SessionPtr getSession(const ::std::string id, const ::Ice::Current & current) override
{
auto s = load(id);
if (s && isExpired(s)) {
@@ -50,12 +51,12 @@ namespace IceSpider {
return s;
}
- void updateSession(const SessionPtr & s, const ::Ice::Current &) override
+ void updateSession(const SessionPtr s, const ::Ice::Current &) override
{
save(s);
}
- void destroySession(const ::std::string & id, const ::Ice::Current &) override
+ void destroySession(const ::std::string id, const ::Ice::Current &) override
{
try {
boost::filesystem::remove(root / id);
@@ -69,9 +70,9 @@ namespace IceSpider {
void save(SessionPtr s)
{
s->lastUsed = time(NULL);
- auto buf = Ice::createOutputStream(ic);
- buf->write(s);
- auto range = buf->finished();
+ Ice::OutputStream buf(ic);
+ buf.write(s);
+ auto range = buf.finished();
AdHoc::FileUtils::FileHandle f(root / s->id, O_WRONLY | O_CREAT, S_IRUSR | S_IWUSR);
sysassert(flock(f.fh, LOCK_EX), -1);
sysassert(pwrite(f.fh, range.first, range.second - range.first, 0), -1);
@@ -87,9 +88,9 @@ namespace IceSpider {
AdHoc::FileUtils::MemMap f(path);
sysassert(flock(f.fh, LOCK_SH), -1);
auto fbuf = (Ice::Byte *)f.data;
- auto buf = Ice::createInputStream(ic, std::make_pair(fbuf, fbuf + f.getStat().st_size));
+ Ice::InputStream buf(ic, std::make_pair(fbuf, fbuf + f.getStat().st_size));
SessionPtr s;
- buf->read(s);
+ buf.read(s);
sysassert(flock(f.fh, LOCK_UN), -1);
return s;
}
diff --git a/icespider/unittests/Jamfile.jam b/icespider/unittests/Jamfile.jam
index 4dcc450..af8041c 100644
--- a/icespider/unittests/Jamfile.jam
+++ b/icespider/unittests/Jamfile.jam
@@ -30,9 +30,7 @@ path-constant me : . ;
alias testCommon : :
<define>ROOT=\"$(me)\"
<library>..//Ice
- <library>..//IceUtil
: :
- <library>..//IceUtil
<library>..//Ice
<library>boost_utf
<define>ROOT=\"$(me)\"
@@ -127,6 +125,5 @@ lib test-api :
<library>adhocutil
<library>..//pthread
<library>..//Ice
- <library>..//IceUtil
;
diff --git a/icespider/unittests/testApp.cpp b/icespider/unittests/testApp.cpp
index 9714d33..918a056 100644
--- a/icespider/unittests/testApp.cpp
+++ b/icespider/unittests/testApp.cpp
@@ -7,6 +7,7 @@
#include <exceptions.h>
#include <test-api.h>
#include <Ice/ObjectAdapter.h>
+#include <Ice/Initialize.h>
#include <boost/algorithm/string/split.hpp>
#include <boost/algorithm/string/classification.hpp>
#include <boost/algorithm/string/predicate.hpp>
@@ -139,17 +140,17 @@ class TestSerice : public TestIceSpider::TestApi {
public:
TestIceSpider::SomeModelPtr index(const Ice::Current &) override
{
- return new TestIceSpider::SomeModel("index");
+ return std::make_shared<TestIceSpider::SomeModel>("index");
}
- TestIceSpider::SomeModelPtr withParams(const std::string & s, Ice::Int i, const Ice::Current &) override
+ TestIceSpider::SomeModelPtr withParams(const std::string s, Ice::Int i, const Ice::Current &) override
{
BOOST_REQUIRE_EQUAL(s, "something");
BOOST_REQUIRE_EQUAL(i, 1234);
- return new TestIceSpider::SomeModel("withParams");
+ return std::make_shared<TestIceSpider::SomeModel>("withParams");
}
- void returnNothing(const std::string & s, const Ice::Current &) override
+ void returnNothing(const std::string s, const Ice::Current &) override
{
if (s == "error") {
throw TestIceSpider::Ex("test error");
@@ -160,7 +161,7 @@ class TestSerice : public TestIceSpider::TestApi {
BOOST_REQUIRE_EQUAL(s, "some value");
}
- void complexParam(const IceUtil::Optional<std::string> & s, const TestIceSpider::SomeModelPtr & m, const Ice::Current &) override
+ void complexParam(const Ice::optional<std::string> s, const TestIceSpider::SomeModelPtr m, const Ice::Current &) override
{
BOOST_REQUIRE(s);
BOOST_REQUIRE_EQUAL("1234", *s);
@@ -185,7 +186,7 @@ class TestApp : public CoreWithDefaultRouter {
adp(communicator->createObjectAdapterWithEndpoints("test", "default"))
{
adp->activate();
- adp->add(new TestSerice(), communicator->stringToIdentity("Test"));
+ adp->add(std::make_shared<TestSerice>(), Ice::stringToIdentity("Test"));
}
~TestApp()
diff --git a/icespider/unittests/testCompile.cpp b/icespider/unittests/testCompile.cpp
index 6fde743..7b451bf 100644
--- a/icespider/unittests/testCompile.cpp
+++ b/icespider/unittests/testCompile.cpp
@@ -7,6 +7,7 @@
#include "../compile/routeCompiler.h"
#include "../core/irouteHandler.h"
#include <boost/algorithm/string/join.hpp>
+#include <slicer/modelPartsTypes.h>
using namespace IceSpider;
@@ -25,6 +26,13 @@ class CoreFixture {
boost::filesystem::path modeDir;
};
+namespace std {
+ ostream & operator<<(ostream & s, const IceSpider::HttpMethod & m) {
+ s << Slicer::ModelPartForEnum<IceSpider::HttpMethod>::lookup(m);
+ return s;
+ }
+}
+
BOOST_FIXTURE_TEST_SUITE(cf, CoreFixture)
BOOST_AUTO_TEST_CASE( testLoadConfiguration )
@@ -40,7 +48,7 @@ BOOST_AUTO_TEST_CASE( testLoadConfiguration )
BOOST_REQUIRE_EQUAL("/", cfg->routes["index"]->path);
BOOST_REQUIRE_EQUAL(HttpMethod::GET, cfg->routes["index"]->method);
- BOOST_REQUIRE_EQUAL("TestIceSpider.TestApi.index", cfg->routes["index"]->operation);
+ BOOST_REQUIRE_EQUAL("TestIceSpider.TestApi.index", *cfg->routes["index"]->operation);
BOOST_REQUIRE_EQUAL(0, cfg->routes["index"]->params.size());
BOOST_REQUIRE_EQUAL("/view/{s}/{i}", cfg->routes["item"]->path);
@@ -72,72 +80,5 @@ BOOST_AUTO_TEST_CASE( testRouteCompile )
rc.compile(input, outputc);
}
-BOOST_AUTO_TEST_CASE( testCompile )
-{
- auto outputc = binDir / "testRoutes.cpp";
- auto outputo = binDir / "testRoutes.o";
- auto libGenDir = (rootDir / "bin" / modeDir / "slicer-yes");
-
- auto compileCommand = boost::algorithm::join<std::vector<std::string>>({
- "gcc", "-c", "-std=c++1y", "-fPIC", "-fvisibility=hidden", "-O3", "-flto", "-fvisibility-inlines-hidden",
- "-I", "/usr/include/adhocutil",
- "-I", "/usr/include/glib-2.0",
- "-I", "/usr/include/glibmm-2.4",
- "-I", "/usr/include/libxml2",
- "-I", "/usr/include/libxml++-3.0",
- "-I", "/usr/include/libxslt",
- "-I", "/usr/include/slicer",
- "-I", "/usr/lib/glib-2.0/include",
- "-I", "/usr/lib/glibmm-2.4/include",
- "-I", "/usr/lib/libxml++-3.0/include",
- "-I", rootDir.string(),
- "-I", (rootDir.parent_path() / "core").string(),
- "-I", (rootDir.parent_path() / "common").string(),
- "-I", (rootDir.parent_path() / "xslt").string(),
- "-I", (rootDir.parent_path() / "common" / "bin" / modeDir / "allow-ice-yes").string(),
- "-I", libGenDir.string(),
- "-o", outputo.string(),
- outputc.string(),
- }, " ");
- BOOST_TEST_INFO("Compile command: " << compileCommand);
- int compileResult = system(compileCommand.c_str());
- BOOST_REQUIRE_EQUAL(0, compileResult);
-}
-
-BOOST_AUTO_TEST_CASE( testLink )
-{
- auto outputo = binDir / "testRoutes.o";
- BOOST_REQUIRE(boost::filesystem::exists(outputo));
- auto outputso = binDir / "testRoutes.so";
-
- auto linkCommand = boost::algorithm::join<std::vector<std::string>>({
- "gcc", "-shared", "-Wl,--warn-once,--gc-sections,-z,lazy",
- "-o", outputso.string(),
- outputo.string(),
- }, " ");
- BOOST_TEST_INFO("Link command: " << linkCommand);
- int linkResult = system(linkCommand.c_str());
- BOOST_REQUIRE_EQUAL(0, linkResult);
-}
-
-BOOST_AUTO_TEST_CASE( testLoad )
-{
- auto outputso = binDir / "testRoutes.so";
- BOOST_REQUIRE(boost::filesystem::exists(outputso));
-
- auto lib = dlopen(outputso.c_str(), RTLD_LAZY);
- BOOST_TEST_INFO(dlerror());
- BOOST_REQUIRE(lib);
-
- BOOST_REQUIRE_EQUAL(13, AdHoc::PluginManager::getDefault()->getAll<IceSpider::RouteHandlerFactory>().size());
- // smoke test (block ensure dlclose dones't cause segfault)
- {
- auto route = AdHoc::PluginManager::getDefault()->get<IceSpider::RouteHandlerFactory>("common::index");
- BOOST_REQUIRE(route);
- }
-
- BOOST_REQUIRE_EQUAL(0, dlclose(lib));
-}
-
BOOST_AUTO_TEST_SUITE_END();
diff --git a/icespider/unittests/testFcgi.cpp b/icespider/unittests/testFcgi.cpp
index ae4f1cf..6d3d7d5 100644
--- a/icespider/unittests/testFcgi.cpp
+++ b/icespider/unittests/testFcgi.cpp
@@ -5,6 +5,24 @@
#include <definedDirs.h>
#include <cgiRequestBase.h>
#include <test-fcgi.h>
+#include <slicer/modelPartsTypes.h>
+
+using namespace std::literals;
+namespace std {
+ template<typename T>
+ ostream & operator<<(ostream & s, const Ice::optional<T> & o) {
+ if (o) s << *o;
+ return s;
+ }
+}
+
+namespace std {
+ ostream & operator<<(ostream & s, const IceSpider::HttpMethod & m) {
+ s << Slicer::ModelPartForEnum<IceSpider::HttpMethod>::lookup(m);
+ return s;
+ }
+}
+
class TestRequest : public IceSpider::CgiRequestBase {
public:
@@ -272,7 +290,7 @@ BOOST_AUTO_TEST_CASE( cookies )
BOOST_REQUIRE_EQUAL(1234, *r.IceSpider::IHttpRequest::getCookieParam<Ice::Int>("valueA"));
BOOST_REQUIRE_EQUAL("Something with spaces.", *r.IceSpider::IHttpRequest::getCookieParam<std::string>("value B"));
BOOST_REQUIRE(!r.IceSpider::IHttpRequest::getCookieParam<Ice::Int>("notAThing"));
- r.setCookie("some int.", 1234, "www.com", "/dir", true, 1476142378);
+ r.setCookie("some int.", 1234, "www.com"s, "/dir"s, true, 1476142378);
BOOST_REQUIRE_EQUAL("Set-Cookie: some+int%2e=1234; expires=Mon, 10 Oct 2016 23:32:58 GMT; domain=www.com; path=/dir; secure\r\n", r.out.str());
}
diff --git a/icespider/xslt/Jamfile.jam b/icespider/xslt/Jamfile.jam
index 97408be..eacdda4 100644
--- a/icespider/xslt/Jamfile.jam
+++ b/icespider/xslt/Jamfile.jam
@@ -2,7 +2,6 @@ lib adhocutil : : : : <include>/usr/include/adhocutil ;
lib slicer-xml : : : : <include>/usr/include/slicer ;
lib boost_system ;
lib boost_filesystem ;
-lib IceUtil ;
lib xslt ;
lib exslt ;
@@ -13,7 +12,6 @@ lib icespider-xslt :
<library>slicer-xml
<library>boost_system
<library>boost_filesystem
- <library>IceUtil
<library>xslt
<library>exslt
<library>../..//libxmlpp
diff --git a/icespider/xslt/xsltStreamSerializer.cpp b/icespider/xslt/xsltStreamSerializer.cpp
index d89adcd..5214ab3 100644
--- a/icespider/xslt/xsltStreamSerializer.cpp
+++ b/icespider/xslt/xsltStreamSerializer.cpp
@@ -29,7 +29,7 @@ namespace IceSpider {
xsltFreeStylesheet(stylesheet);
}
- XsltStreamSerializer *
+ Slicer::SerializerPtr
XsltStreamSerializer::IceSpiderFactory::create(std::ostream & strm) const
{
auto newMtime = boost::filesystem::last_write_time(stylesheetPath);
@@ -43,7 +43,7 @@ namespace IceSpider {
}
stylesheetWriteTime = newMtime;
}
- return new XsltStreamSerializer(strm, stylesheet);
+ return std::make_shared<XsltStreamSerializer>(strm, stylesheet);
}
XsltStreamSerializer::XsltStreamSerializer(std::ostream & os, xsltStylesheet * ss) :
diff --git a/icespider/xslt/xsltStreamSerializer.h b/icespider/xslt/xsltStreamSerializer.h
index b061012..eb432fb 100644
--- a/icespider/xslt/xsltStreamSerializer.h
+++ b/icespider/xslt/xsltStreamSerializer.h
@@ -14,7 +14,7 @@ namespace IceSpider {
IceSpiderFactory(const char *);
~IceSpiderFactory();
- XsltStreamSerializer * create(std::ostream &) const override;
+ Slicer::SerializerPtr create(std::ostream &) const override;
private:
const boost::filesystem::path stylesheetPath;
diff --git a/slice.jam b/slice.jam
index 434e562..d261c50 100644
--- a/slice.jam
+++ b/slice.jam
@@ -8,7 +8,6 @@ import toolset ;
type.register SLICE : ice ;
feature slicer : no yes pure ;
-feature allow-ice : no yes ;
feature ice-visibility : public hidden ;
class slice-scanner : common-scanner
@@ -29,27 +28,24 @@ generators.register-standard slice.slicer.pure : SLICE : CPP(slicer-%) : <slicer
toolset.flags slice.slice2cpp INCLUDES <include> ;
toolset.flags slice.slice2cpp DLLEXPORT <ice-visibility>public : --dll-export JAM_DLL_PUBLIC ;
-toolset.flags slice.slice2cpp ALLOWICE <allow-ice>yes : --ice ;
toolset.flags slice.slicer INCLUDES <include> ;
toolset.flags slice.slicer DLLEXPORT <ice-visibility>public : --dll-export JAM_DLL_PUBLIC ;
-toolset.flags slice.slicer ALLOWICE <allow-ice>yes : --ice ;
toolset.flags slice.slicer.pure INCLUDES <include> ;
-toolset.flags slice.slicer.pure ALLOWICE <allow-ice>yes : --ice ;
actions slice.slice2cpp
{
- slice2cpp -I"$(INCLUDES)" --checksum --output-dir $(1[1]:D) $(2) $(DLLEXPORT) $(ALLOWICE[1])
+ slice2cpp -I"$(INCLUDES)" --checksum --output-dir $(1[1]:D) $(2) $(DLLEXPORT)
}
actions slice.slicer
{
- slice2cpp -I"$(INCLUDES)" --checksum --output-dir $(1[1]:D) $(2) $(DLLEXPORT) $(ALLOWICE[1])
- slicer -I"$(INCLUDES)" $(2) $(1[2]) $(ALLOWICE[1])
+ slice2cpp -I"$(INCLUDES)" --checksum --output-dir $(1[1]:D) $(2) $(DLLEXPORT)
+ slicer -I"$(INCLUDES)" $(2) $(1[2])
}
actions slice.slicer.pure
{
- slicer -I"$(INCLUDES)" $(2) $(1[1]) $(ALLOWICE[1])
+ slicer -I"$(INCLUDES)" $(2) $(1[1])
}
IMPORT $(__name__) : slice.slice2cpp : : slice.slice2cpp ;