<commit_before>#include <iostream>
#include "bson/decoder.hpp"
#include "bson/model.hpp"
#include "std/trace.hpp"

namespace bson
{

decoder::decoder() : buffer{}
{}

void decoder:: decode(byte_type b)
{
    TRACE("(byte)");
    put(b);
}

void decoder:: decode(int32_type i)
{
    TRACE("(int32)");
    put(i & 0xFF);
    put((i >>  8) & 0xFF);
    put((i >> 16) & 0xFF);
    put((i >> 24) & 0xFF);
}

void decoder::decode(int64_type i)
{
    TRACE("(int64)");
    put(i & 0xFF);
    put((i >>  8) & 0xFF);
    put((i >> 16) & 0xFF);
    put((i >> 24) & 0xFF);
    put((i >> 32) & 0xFF);
    put((i >> 40) & 0xFF);
    put((i >> 48) & 0xFF);
    put((i >> 56) & 0xFF);
}

void decoder::decode(double_type d)
{
    TRACE("(double)");
    union{
        double_type d64;
        int64_type i64;
    } d2i;
    d2i.d64 = d;
    decode(d2i.i64);
}

void decoder::decode(boolean_type b)
{
    TRACE("(bool)");
    if(b) put('\x01');
    else  put('\x00');
}

void decoder::decode(date_type d)
{
    using namespace std::chrono;
    TRACE("(date)");
//  int64_type i = system_clock::to_time_t(d);
    int64_type i = duration_cast<milliseconds>(d.time_since_epoch()).count();
    decode(i);
}

void decoder::decode(null_type b)
{
    TRACE("(null)");
}<commit_msg>Fixed Date decoding etc.<commit_after>#include <iostream>
#include "bson/decoder.hpp"
#include "bson/model.hpp"
#include "std/trace.hpp"

namespace bson
{

decoder::decoder() : buffer{}
{}

void decoder:: decode(byte_type b)
{
    TRACE("(byte)");
    put(b);
}

void decoder:: decode(int32_type i)
{
    TRACE("(int32)");
    put(i & 0xFF);
    put((i >>  8) & 0xFF);
    put((i >> 16) & 0xFF);
    put((i >> 24) & 0xFF);
}

void decoder::decode(int64_type i)
{
    TRACE("(int64)");
    put(i & 0xFF);
    put((i >>  8) & 0xFF);
    put((i >> 16) & 0xFF);
    put((i >> 24) & 0xFF);
    put((i >> 32) & 0xFF);
    put((i >> 40) & 0xFF);
    put((i >> 48) & 0xFF);
    put((i >> 56) & 0xFF);
}

void decoder::decode(double_type d)
{
    TRACE("(double)");
    union{
        double_type d64;
        int64_type i64;
    } d2i;
    d2i.d64 = d;
    decode(d2i.i64);
}

void decoder::decode(boolean_type b)
{
    TRACE("(bool)");
    if(b) put('\x01');
    else  put('\x00');
}

void decoder::decode(date_type d)
{
    using namespace std::chrono;
    TRACE("(date)");
    int64_type i = duration_cast<milliseconds>(d.time_since_epoch()).count();
    decode(i);
}

void decoder::decode(null_type b)
{
    TRACE("(null)");
}
{'fraction_non_alphanumeric': 0.21088709677419354, 'fraction_numerical': 0.0467741935483871, 'mean_word_length': 3.1281198003327786, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 47, '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': '1162614', 'n_tokens_mistral': 1111, 'n_tokens_neox': 1013, 'n_words': 200}