21 namespace expression {
33 mapbox::util::recursive_wrapper<std::vector<Value>>,
34 mapbox::util::recursive_wrapper<std::unordered_map<std::string, Value>>>;
75 template <
class T,
class Enable =
void>
82 return value.template is<T>() ? value.template get<T>() : std::optional<T>();
106 template <
typename T, std::
size_t N>
109 return type::Array(valueTypeToExpressionType<T>(), N);
115 template <
typename T>
116 struct ValueConverter<
std::vector<T>> {
118 return type::Array(valueTypeToExpressionType<T>());
131 template <
typename T>
138 template <
typename T>
143 template <
typename T>
148 template <
typename T>
150 std::vector<std::optional<T>> result;
151 result.reserve(values.size());
152 for (
const auto& value : values) {
153 result.push_back(value ? fromExpressionValue<T>(*value) : std::nullopt);
std::unique_ptr< Expression > string(std::unique_ptr< Expression >, std::unique_ptr< Expression > def=nullptr)
constexpr ValueType Value
constexpr NumberType Number
constexpr ColorType Color
constexpr CollatorType Collator
constexpr StringType String
constexpr FormattedType Formatted
variant< NullType, NumberType, BooleanType, StringType, ColorType, ObjectType, ValueType, mapbox::util::recursive_wrapper< Array >, CollatorType, FormattedType, ErrorType, ImageType > Type
constexpr ImageType Image
std::vector< std::optional< T > > fromExpressionValues(const std::vector< std::optional< Value >> &values)
std::string stringify(const Value &value)
Value toExpressionValue(const T &value)
std::string toString(const Value &value)
variant< NullValue, bool, double, std::string, Color, Collator, Formatted, Image, mapbox::util::recursive_wrapper< std::vector< Value > >, mapbox::util::recursive_wrapper< std::unordered_map< std::string, Value > >> ValueBase
type::Type typeOf(const Value &value)
std::optional< T > fromExpressionValue(const Value &value)
type::Type valueTypeToExpressionType()
mapbox::base::NullValue NullValue
mapbox::base::Value Value
mapbox::util::variant< T... > variant
static Value toExpressionValue(const mbgl::style::Position &value)
static type::Type expressionType()
static std::optional< Position > fromExpressionValue(const Value &v)
static type::Type expressionType()
static std::optional< Rotation > fromExpressionValue(const Value &v)
static Value toExpressionValue(const mbgl::style::Rotation &value)
static type::Type expressionType()
static std::optional< Value > fromExpressionValue(const Value &value)
static Value toExpressionValue(const Value &value)
static type::Type expressionType()
static Value toExpressionValue(float value)
static std::optional< float > fromExpressionValue(const Value &value)
static mbgl::Value fromExpressionValue(const Value &value)
static Value toExpressionValue(const mbgl::Value &value)
static Value toExpressionValue(const T &value)
static std::optional< T > fromExpressionValue(const Value &value)
static uint64_t maxSafeInteger()
static bool isSafeInteger(double x)
static bool isSafeInteger(int64_t x)
VARIANT_INLINE Value(T &&val)
static bool isSafeInteger(uint64_t x)