7#include <config-userfeedback.h>
9#include "surveytargetexpressionparser.h"
10#include "surveytargetexpression.h"
12#ifdef HAVE_SURVEY_TARGET_EXPRESSIONS
13#include "surveytargetexpressionparser_p.h"
14#include "surveytargetexpressionscanner.h"
21char* unquoteString(
const char *str)
23 const auto size = strlen(str) - 2;
26 auto out = (
char*)malloc(size + 1);
27 memset(out, 0, size + 1);
29 for (
auto it = str + 1; it < str + size + 1; ++it, ++outIt) {
53SurveyTargetExpressionParser::SurveyTargetExpressionParser()
54 : m_expression(nullptr)
58SurveyTargetExpressionParser::~SurveyTargetExpressionParser()
63bool SurveyTargetExpressionParser::parse(
const QString &s)
66 m_expression =
nullptr;
68#ifdef HAVE_SURVEY_TARGET_EXPRESSIONS
70 YY_BUFFER_STATE state;
71 if (yylex_init(&scanner))
75 state = yy_scan_string(b.
constData(), scanner);
76 if (yyparse(&m_expression, scanner)) {
78 m_expression =
nullptr;
81 yy_delete_buffer(state, scanner);
82 yylex_destroy(scanner);
87SurveyTargetExpression* SurveyTargetExpressionParser::expression()
const
Classes for integrating telemetry collection, survey targeting, and contribution encouragenemt and co...
const char * constData() const const
QByteArray toUtf8() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:19:03 by
doxygen 1.12.0 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.