<commit_before>#include "Packet.h"
#include <sstream>
#include <iostream>
#include <iomanip>
#include <string.h>

#include "Tools.h"

Packet::Packet()
{
    clear();
}

Packet::Packet(Poco::UInt16 _opcode, Poco::UInt16 size /*= 0*/, bool unknownLen /*= false*/, bool deleteOnSend /*= true*/)
{
    clear();
    
    if (size > 0)
        resize(size);

    opcode = _opcode;
    _unknownLen = unknownLen;
    DeleteOnSend = deleteOnSend;

    if (!_unknownLen)
        len = size;
}

Packet::~Packet()
{
    if (rawdata)
        delete [] rawdata;
}

void Packet::clear()
{
    count = 0;
    len = 0;
    opcode = 0;
    sec = 0;
    memset(digest, 0, sizeof(digest));
    rawdata = NULL;
    DeleteOnSend = true;
}
        
void Packet::operator << (std::string str)
{
    *this << (Poco::UInt16)str.length();
    for (int i = 0; i < str.length(); ++i)
        *this << (Poco::UInt8)str[i];
}
<commit_msg>Codestyle: Whitespaces<commit_after>#include "Packet.h"
#include <sstream>
#include <iostream>
#include <iomanip>
#include <string.h>

#include "Tools.h"

Packet::Packet()
{
    clear();
}

Packet::Packet(Poco::UInt16 _opcode, Poco::UInt16 size /*= 0*/, bool unknownLen /*= false*/, bool deleteOnSend /*= true*/)
{
    clear();
    
    if (size > 0)
        resize(size);

    opcode = _opcode;
    _unknownLen = unknownLen;
    DeleteOnSend = deleteOnSend;

    if (!_unknownLen)
        len = size;
}

Packet::~Packet()
{
    if (rawdata)
        delete [] rawdata;
}

void Packet::clear()
{
    count = 0;
    len = 0;
    opcode = 0;
    sec = 0;
    memset(digest, 0, sizeof(digest));
    rawdata = NULL;
    DeleteOnSend = true;
}

void Packet::operator << (std::string str)
{
    *this << (Poco::UInt16)str.length();
    for (int i = 0; i < str.length(); ++i)
        *this << (Poco::UInt8)str[i];
}

{'fraction_non_alphanumeric': 0.1768595041322314, 'fraction_numerical': 0.01652892561983471, 'mean_word_length': 2.847457627118644, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 13, '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': '1165217', 'n_tokens_mistral': 706, 'n_tokens_neox': 675, 'n_words': 155}