summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnder Conselvan de Oliveira <ander.deoliveira@mapbox.com>2019-04-02 15:52:16 +0300
committerAnder Conselvan de Oliveira <ander.deoliveira@mapbox.com>2019-05-16 11:12:30 +0300
commitdf96eb3c71600a44eae2d93550e75ab42f0ed615 (patch)
tree82aa4d1e07da6709b401036357d3741a8593b5e2
parent9a404ad659887fed712f1a01323ef3a653cdc5c8 (diff)
downloadqtlocation-mapboxgl-df96eb3c71600a44eae2d93550e75ab42f0ed615.tar.gz
[core] Expose dsl::compound() internally
This will be used in a follow up patch by the function to expression conversion code.
-rw-r--r--src/core-files.json1
-rw-r--r--src/mbgl/style/expression/dsl.cpp8
-rw-r--r--src/mbgl/style/expression/dsl_impl.hpp21
3 files changed, 24 insertions, 6 deletions
diff --git a/src/core-files.json b/src/core-files.json
index a52797acd7..7954e2fb88 100644
--- a/src/core-files.json
+++ b/src/core-files.json
@@ -674,6 +674,7 @@
"mbgl/style/conversion/json.hpp": "src/mbgl/style/conversion/json.hpp",
"mbgl/style/conversion/stringify.hpp": "src/mbgl/style/conversion/stringify.hpp",
"mbgl/style/custom_tile_loader.hpp": "src/mbgl/style/custom_tile_loader.hpp",
+ "mbgl/style/expression/dsl_impl.hpp": "src/mbgl/style/expression/dsl_impl.hpp",
"mbgl/style/expression/util.hpp": "src/mbgl/style/expression/util.hpp",
"mbgl/style/image_impl.hpp": "src/mbgl/style/image_impl.hpp",
"mbgl/style/layer_impl.hpp": "src/mbgl/style/layer_impl.hpp",
diff --git a/src/mbgl/style/expression/dsl.cpp b/src/mbgl/style/expression/dsl.cpp
index d1d8dea799..dd4aa7d277 100644
--- a/src/mbgl/style/expression/dsl.cpp
+++ b/src/mbgl/style/expression/dsl.cpp
@@ -1,4 +1,5 @@
#include <mbgl/style/expression/dsl.hpp>
+#include <mbgl/style/expression/dsl_impl.hpp>
#include <mbgl/style/expression/error.hpp>
#include <mbgl/style/expression/literal.hpp>
#include <mbgl/style/expression/assertion.hpp>
@@ -14,18 +15,13 @@ namespace style {
namespace expression {
namespace dsl {
-static std::unique_ptr<Expression> compound(const char* op, std::vector<std::unique_ptr<Expression>> args) {
+std::unique_ptr<Expression> compound(const char* op, std::vector<std::unique_ptr<Expression>> args) {
ParsingContext ctx;
ParseResult result = createCompoundExpression(op, std::move(args), ctx);
assert(result);
return std::move(*result);
}
-template <class... Args>
-static std::unique_ptr<Expression> compound(const char* op, Args... args) {
- return compound(op, vec(std::move(args)...));
-}
-
std::unique_ptr<Expression> error(std::string message) {
return std::make_unique<Error>(std::move(message));
}
diff --git a/src/mbgl/style/expression/dsl_impl.hpp b/src/mbgl/style/expression/dsl_impl.hpp
new file mode 100644
index 0000000000..201c60ffd8
--- /dev/null
+++ b/src/mbgl/style/expression/dsl_impl.hpp
@@ -0,0 +1,21 @@
+#pragma once
+
+#include <mbgl/style/expression/expression.hpp>
+#include <mbgl/util/color.hpp>
+
+namespace mbgl {
+namespace style {
+namespace expression {
+namespace dsl {
+
+std::unique_ptr<Expression> compound(const char* op, std::vector<std::unique_ptr<Expression>> args);
+
+template <class... Args>
+std::unique_ptr<Expression> compound(const char* op, Args... args) {
+ return compound(op, vec(std::move(args)...));
+}
+
+} // namespace dsl
+} // namespace expression
+} // namespace style
+} // namespace mbgl