libzeep

PrevUpHomeNext

Class context

zeep::xml::context

Synopsis

// In header: <zeep/xml/xpath.hpp>


class context {
public:
  // construct/copy/destruct
  context();
  context(const context &);
  context & operator=(const context &);
  ~context();

  // public member functions
  void set(const std::string &, const std::string &);
  void set(const std::string &, double);
  template<typename T, 
           std::enable_if_t< std::is_same_v< T, std::string > or std::is_same_v< T, double >, int >  = 0> 
    T get(const std::string &);
};

Description

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.

context public construct/copy/destruct

  1. context();
  2. context(const context &);
  3. context & operator=(const context &);
  4. ~context();

context public member functions

  1. void set(const std::string & name, const std::string & value);
  2. void set(const std::string & name, double value);
  3. template<typename T, 
             std::enable_if_t< std::is_same_v< T, std::string > or std::is_same_v< T, double >, int >  = 0> 
      T get(const std::string & name);

PrevUpHomeNext