<commit_before>/*
 * Copyright (c) 2016 dresden elektronik ingenieurtechnik gmbh.
 * All rights reserved.
 *
 * The software in this package is published under the terms of the BSD
 * style license a copy of which has been included with this distribution in
 * the LICENSE.txt file.
 *
 */

#include <QString>
#include <QTcpSocket>
#include <QVariantMap>
#include <QRegExp>
#include "de_web_plugin.h"
#include "de_web_plugin_private.h"
#include "json.h"

/*! Inits the schedules manager.
 */
void DeRestPluginPrivate::initSchedules()
{
    scheduleTimer = new QTimer(this);
    scheduleTimer->setSingleShot(false);
    connect(scheduleTimer, SIGNAL(timeout()),
            this, SLOT(scheduleTimerFired()));
    scheduleTimer->start(SCHEDULE_CHECK_PERIOD);
}

/*! Schedules REST API broker.
    \param req - request data
    \param rsp - response data
    \return REQ_READY_SEND
            REQ_NOT_HANDLED
 */
int DeRestPluginPrivate::handleSchedulesApi(const ApiRequest &req, ApiResponse &rsp)
{
    if (req.path[2] != "schedules")
    {
        return REQ_NOT_HANDLED;<commit_msg>Use QLatin1String in schedules API check<commit_after>/*
 * Copyright (c) 2016-2019 dresden elektronik ingenieurtechnik gmbh.
 * All rights reserved.
 *
 * The software in this package is published under the terms of the BSD
 * style license a copy of which has been included with this distribution in
 * the LICENSE.txt file.
 *
 */

#include <QString>
#include <QTcpSocket>
#include <QVariantMap>
#include <QRegExp>
#include "de_web_plugin.h"
#include "de_web_plugin_private.h"
#include "json.h"

/*! Inits the schedules manager.
 */
void DeRestPluginPrivate::initSchedules()
{
    scheduleTimer = new QTimer(this);
    scheduleTimer->setSingleShot(false);
    connect(scheduleTimer, SIGNAL(timeout()),
            this, SLOT(scheduleTimerFired()));
    scheduleTimer->start(SCHEDULE_CHECK_PERIOD);
}

/*! Schedules REST API broker.
    \param req - request data
    \param rsp - response data
    \return REQ_READY_SEND
            REQ_NOT_HANDLED
 */
int DeRestPluginPrivate::handleSchedulesApi(const ApiRequest &req, ApiResponse &rsp)
{
    if (req.path[2] != QLatin1String("schedules"))
    {
        return REQ_NOT_HANDLED;
{'fraction_non_alphanumeric': 0.1043831902394939, 'fraction_numerical': 0.0072300045187528245, 'mean_word_length': 3.9977426636568847, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7176737', 'n_tokens_mistral': 723, 'n_tokens_neox': 699, 'n_words': 194}