<commit_before>
/**
 * This file is part of the boostcache package.
 *
 * (c) <NAME> <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

#include "command.h"
#include "commands.h"
#include "util/log.h"

#include <boost/spirit/include/qi.hpp>
#include <boost/algorithm/string/trim.hpp>
#include <boost/algorithm/string/split.hpp>


const char *Command::REPLY_FALSE = "0\n";
const char *Command::REPLY_TRUE  = "1\n";
const char *Command::REPLY_NIL   = "(nil)\n";
const char *Command::REPLY_OK    = "+OK\n";
const char *Command::REPLY_ERROR = "-ERR\n";


namespace qi = boost::spirit::qi;

bool Command::feedAndParseCommand(const char *buffer, size_t size)
{
    m_commandString.append(buffer, size);
    LOG(debug) << "Try to read/parser command(" << m_commandString.length() << ") "
               "with " << m_numberOfArguments << " arguments, "
               "for " << this;
<commit_msg>[kernel] fix command default reply, now it like redis have (see 6fa290a)<commit_after>
/**
 * This file is part of the boostcache package.
 *
 * (c) <NAME> <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

#include "command.h"
#include "commands.h"
#include "util/log.h"

#include <boost/spirit/include/qi.hpp>
#include <boost/algorithm/string/trim.hpp>
#include <boost/algorithm/string/split.hpp>


const char *Command::REPLY_FALSE = ":0\n";
const char *Command::REPLY_TRUE  = ":1\n";
const char *Command::REPLY_NIL   = "$-1\n";
const char *Command::REPLY_OK    = "+OK\n";
const char *Command::REPLY_ERROR = "-ERR\n";


namespace qi = boost::spirit::qi;

bool Command::feedAndParseCommand(const char *buffer, size_t size)
{
    m_commandString.append(buffer, size);
    LOG(debug) << "Try to read/parser command(" << m_commandString.length() << ") "
               "with " << m_numberOfArguments << " arguments, "
               "for " << this;

{'fraction_non_alphanumeric': 0.1547207118141374, 'fraction_numerical': 0.004448838358872961, 'mean_word_length': 3.9245742092457423, 'pattern_counts': {'":': 2, '<': 39, '<?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': '6502563', 'n_tokens_mistral': 673, 'n_tokens_neox': 665, 'n_words': 181}