diff options
| author | Dan Goodliffe <dan@randomdan.homeip.net> | 2016-08-21 01:56:34 +0100 | 
|---|---|---|
| committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2016-08-21 13:03:35 +0100 | 
| commit | 590da27415a9bec829e608580669c61090d8556c (patch) | |
| tree | 1cb5446d5baa458401cd4eda67554a94f5cfab87 | |
| parent | Split compile/link test stages so ccache can work (diff) | |
| download | icespider-590da27415a9bec829e608580669c61090d8556c.tar.bz2 icespider-590da27415a9bec829e608580669c61090d8556c.tar.xz icespider-590da27415a9bec829e608580669c61090d8556c.zip | |
Allow inclusion of user headers
| -rw-r--r-- | icespider/common/routes.ice | 7 | ||||
| -rw-r--r-- | icespider/compile/routeCompiler.cpp | 7 | ||||
| -rw-r--r-- | icespider/unittests/testRoutes.json | 1 | 
3 files changed, 12 insertions, 3 deletions
| diff --git a/icespider/common/routes.ice b/icespider/common/routes.ice index 64efae0..65e7d67 100644 --- a/icespider/common/routes.ice +++ b/icespider/common/routes.ice @@ -4,6 +4,8 @@  #include "http.ice"  module IceSpider { +	sequence<string> StringSeq; +  	class Parameter {  		string name;  		ParameterSource source = URL; @@ -28,12 +30,11 @@ module IceSpider {  	sequence<Route> Routes; -	sequence<string> Slices; -  	class RouteConfiguration {  		string name;  		Routes routes; -		Slices slices; +		StringSeq slices; +		StringSeq headers;  	};  }; diff --git a/icespider/compile/routeCompiler.cpp b/icespider/compile/routeCompiler.cpp index c190a86..65b3141 100644 --- a/icespider/compile/routeCompiler.cpp +++ b/icespider/compile/routeCompiler.cpp @@ -208,6 +208,13 @@ namespace IceSpider {  				fprintbf(output, "#include <%s>\n", slicePath.string());  			} +			if (!c->headers.empty()) { +				fprintf(output, "\n// Extra headers.\n"); +				for (const auto & h : c->headers) { +					fprintbf(output, "#include <%s>\n", h); +				} +			} +  			fprintf(output, "\n");  			fprintbf(output, "namespace %s {\n", c->name);  			fprintbf(1, output, "// Implementation classes.\n\n"); diff --git a/icespider/unittests/testRoutes.json b/icespider/unittests/testRoutes.json index 4ad8cc3..cf5d289 100644 --- a/icespider/unittests/testRoutes.json +++ b/icespider/unittests/testRoutes.json @@ -1,5 +1,6 @@  {  	"name": "common", +	"headers": [ "xsltStreamSerializer.h" ],  	"routes": [  	{  		"name": "index", | 
