# Class context

- Defined in File xpath.hpp

## Class Documentation

class context

  The context class, containing named variables to use in XPaths.

  XPath’s can contain variables. And variables can contain all kinds of data like strings, numbers and even node_sets. If you want to use variables, you can define a context, add your variables to it and then pass it on in the xpath::evaluate method.

  Public Functions

  context()

    constructor

  context(const context &ctxt) = default

    Constructor to create a new scope.

  inline context(context &&ctxt) noexcept

    move constructor

  inline context &operator=(context ctxt)

    assignment operator

  void set(const std::string &name, std::string value)

    Store a new variable in this context with name name and value value.

  void set(const std::string &name, double value)

    Store a new variable in this context with name name and value value.

  template<typename T>
  T get(std::string name)

    Get a variable stored in this context or further up the scopes.