Query DSL¶
Namespace: dftracer::utils::utilities::common::query
-
struct AndNode¶
left and right.
-
struct ArrayNode¶
An array of literal values (used by in/not-in).
Public Members
-
std::vector<LiteralNode> elements¶
-
std::vector<LiteralNode> elements¶
-
struct CompareNode¶
field op value (e.g., cat == “POSIX”).
-
struct FieldNode¶
A field reference (e.g., “cat”, “args.level”).
Public Members
-
std::string path¶
Dotted path into JSON.
-
std::string path¶
-
struct InNode¶
field in [values] (e.g., cat in [“POSIX”, “STDIO”]).
-
struct NotInNode¶
field not in [values].
-
struct OrNode¶
left or right.
-
class Query¶
Owns a parsed query AST and provides evaluation.
Public Functions
-
bool evaluate(const json::JsonValue &event) const¶
Evaluate against a JSON event. Missing fields → false.
-
bool evaluate(const ValueMap &fields) const¶
Evaluate against a typed key-value map. Missing fields → false.
-
inline const std::string &source() const¶
Original query source string.
-
std::string to_string() const¶
Serialize AST back to query DSL string.
-
inline const dftracer::utils::StringViewSet &fields() const¶
Fields referenced by this query, precomputed at construction.
-
inline bool references(std::string_view field) const¶
Public Static Functions
-
static dftracer::utils::expected<Query, QueryError> from_string(std::string_view input)¶
Parse a query DSL string. Returns error on invalid syntax.
-
bool evaluate(const json::JsonValue &event) const¶
-
struct QueryError¶
Structured parse error with source location.
Public Functions
-
std::string format() const¶
Format as multi-line error message with source and indicator.
-
std::string format() const¶
-
class QueryParseError : public std::runtime_error¶
Exception wrapping a QueryError.
-
struct Token¶