38 lines
933 B
C++
38 lines
933 B
C++
#ifndef RSQL_PARSER_COLLECTION_CONDITION_NODE_HPP
|
|
#define RSQL_PARSER_COLLECTION_CONDITION_NODE_HPP
|
|
|
|
#include "node.hpp"
|
|
|
|
#include <map>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
namespace matador::rsql {
|
|
enum class collection_operator {
|
|
IN,
|
|
OUT
|
|
};
|
|
|
|
static const std::map<std::string, collection_operator> collection_operators = {
|
|
{ "=in=", collection_operator::IN },
|
|
{ "=out=", collection_operator::OUT }
|
|
};
|
|
|
|
|
|
class collection_condition_node final : public node {
|
|
public:
|
|
collection_condition_node(std::string field, collection_operator op, std::vector<std::string> value);
|
|
|
|
void accept(node_visitor& visitor) const override;
|
|
|
|
const std::string& field() const;
|
|
collection_operator operand() const;
|
|
const std::vector<std::string>& values() const;
|
|
|
|
private:
|
|
std::string field_;
|
|
collection_operator op_;
|
|
std::vector<std::string> value_;
|
|
};
|
|
}
|
|
#endif //RSQL_PARSER_COLLECTION_CONDITION_NODE_HPP
|