MapLibre Native Core
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
mbgl::style::expression::ParsingContext Class Reference

#include <parsing_context.hpp>

Public Member Functions

 ParsingContext ()
 
 ParsingContext (std::string key_)
 
 ParsingContext (type::Type expected_)
 
 ParsingContext (ParsingContext &&)=default
 
 ParsingContext (const ParsingContext &)=delete
 
ParsingContextoperator= (const ParsingContext &)=delete
 
std::string getKey () const
 
std::optional< type::TypegetExpected () const
 
const std::vector< ParsingError > & getErrors () const
 
std::string getCombinedErrors () const
 
ParseResult parseExpression (const mbgl::style::conversion::Convertible &value, const std::optional< TypeAnnotationOption > &=std::nullopt)
 
ParseResult parseLayerPropertyExpression (const mbgl::style::conversion::Convertible &value)
 
ParseResult parse (const mbgl::style::conversion::Convertible &, std::size_t, std::optional< type::Type >=std::nullopt, const std::optional< TypeAnnotationOption > &=std::nullopt)
 
ParseResult parse (const mbgl::style::conversion::Convertible &, std::size_t index, std::optional< type::Type >, const std::map< std::string, std::shared_ptr< Expression >> &)
 
std::optional< std::string > checkType (const type::Type &t)
 
std::optional< std::shared_ptr< Expression > > getBinding (const std::string &name)
 
void error (std::string message)
 
void error (std::string message, std::size_t child)
 
void error (std::string message, std::size_t child, std::size_t grandchild)
 
void appendErrors (ParsingContext &&ctx)
 
void clearErrors ()
 

Detailed Description

Definition at line 75 of file parsing_context.hpp.

Constructor & Destructor Documentation

◆ ParsingContext() [1/5]

mbgl::style::expression::ParsingContext::ParsingContext ( )
inline

Definition at line 77 of file parsing_context.hpp.

◆ ParsingContext() [2/5]

mbgl::style::expression::ParsingContext::ParsingContext ( std::string  key_)
inline

Definition at line 78 of file parsing_context.hpp.

◆ ParsingContext() [3/5]

mbgl::style::expression::ParsingContext::ParsingContext ( type::Type  expected_)
inlineexplicit

Definition at line 79 of file parsing_context.hpp.

◆ ParsingContext() [4/5]

mbgl::style::expression::ParsingContext::ParsingContext ( ParsingContext &&  )
default

◆ ParsingContext() [5/5]

mbgl::style::expression::ParsingContext::ParsingContext ( const ParsingContext )
delete

Member Function Documentation

◆ appendErrors()

void mbgl::style::expression::ParsingContext::appendErrors ( ParsingContext &&  ctx)
inline

Definition at line 143 of file parsing_context.hpp.

◆ checkType()

std::optional<std::string> mbgl::style::expression::ParsingContext::checkType ( const type::Type t)

Check whether t is a subtype of expected, collecting an error if not.

◆ clearErrors()

void mbgl::style::expression::ParsingContext::clearErrors ( )
inline

Definition at line 149 of file parsing_context.hpp.

◆ error() [1/3]

void mbgl::style::expression::ParsingContext::error ( std::string  message)
inline

Definition at line 132 of file parsing_context.hpp.

◆ error() [2/3]

void mbgl::style::expression::ParsingContext::error ( std::string  message,
std::size_t  child 
)
inline

Definition at line 134 of file parsing_context.hpp.

◆ error() [3/3]

void mbgl::style::expression::ParsingContext::error ( std::string  message,
std::size_t  child,
std::size_t  grandchild 
)
inline

Definition at line 138 of file parsing_context.hpp.

◆ getBinding()

std::optional<std::shared_ptr<Expression> > mbgl::style::expression::ParsingContext::getBinding ( const std::string &  name)
inline

Definition at line 127 of file parsing_context.hpp.

◆ getCombinedErrors()

std::string mbgl::style::expression::ParsingContext::getCombinedErrors ( ) const

◆ getErrors()

const std::vector<ParsingError>& mbgl::style::expression::ParsingContext::getErrors ( ) const
inline

Definition at line 90 of file parsing_context.hpp.

◆ getExpected()

std::optional<type::Type> mbgl::style::expression::ParsingContext::getExpected ( ) const
inline

Definition at line 89 of file parsing_context.hpp.

◆ getKey()

std::string mbgl::style::expression::ParsingContext::getKey ( ) const
inline

Definition at line 88 of file parsing_context.hpp.

◆ operator=()

ParsingContext& mbgl::style::expression::ParsingContext::operator= ( const ParsingContext )
delete

◆ parse() [1/2]

ParseResult mbgl::style::expression::ParsingContext::parse ( const mbgl::style::conversion::Convertible ,
std::size_t  index,
std::optional< type::Type ,
const std::map< std::string, std::shared_ptr< Expression >> &   
)

Parse a child expression. For use by individual Expression::parse() methods.

◆ parse() [2/2]

ParseResult mbgl::style::expression::ParsingContext::parse ( const mbgl::style::conversion::Convertible ,
std::size_t  ,
std::optional< type::Type = std::nullopt,
const std::optional< TypeAnnotationOption > &  = std::nullopt 
)

Parse a child expression. For use by individual Expression::parse() methods.

◆ parseExpression()

ParseResult mbgl::style::expression::ParsingContext::parseExpression ( const mbgl::style::conversion::Convertible value,
const std::optional< TypeAnnotationOption > &  = std::nullopt 
)

Parse the given style-spec JSON value as an expression.

◆ parseLayerPropertyExpression()

ParseResult mbgl::style::expression::ParsingContext::parseLayerPropertyExpression ( const mbgl::style::conversion::Convertible value)

Parse the given style-spec JSON value as an expression intended to be used in a layout or paint property. This entails checking additional constraints that exist in that context but not, e.g., for filters.


The documentation for this class was generated from the following file: