<commit_before>#include <cstdio>
#include <string>

#include "board.hpp"
#include "config.hpp"

namespace roadagain
{

Config::Config() : use_color_(true), automatic_(false), player_(BLACK)
{
}

Config::Config(const Config& config)
{
}

Config& Config::instance()
{
    return (Config::instance_);
}

bool Config::init(int argc, char** argv)
{
    for (int i = 1; i < argc; i++){
        std::string argument(argv[i]);

        if (argument == "black"){
            player_ = BLACK;
        }
        else if (argument == "white"){
            player_ = WHITE;
        }
        else if (argument.substr(0, 11) == "--automatic"){
            if (argument == "--automatic" || argument.substr(12) == "=true"){
                automatic_ = true;
            }
            else if (argument.substr(12) == "=false"){
                automatic_ = false;
            }
            else {
                std::printf("invalid argument: %s\n", argv[i]);
                std::printf("automatic option must be 'true' or 'false'");
                return (false);
            }
        }
        else if (argument.substr(0, 11) == "--use-color"){
            if (argument == "--use-color" || argument.substr(12) == "=true"){
                use_color_ = true;
            }
            else if (argument.substr(12) == "=false"){
                use_color_ = false;
            }
            else {
                std::printf("invalid argument: %s\n", argv[i]);
                std::printf("using color option must be 'true' or 'false'");
                return (false);
            }
        }
        else {
            std::printf("invalid argument: %s\n", argv[i]);
            return (false);
        }
    }

    return (true);
}

bool Config::use_color()
{
    return (use_color_);
}

bool Config::automatic()
{
    return (automatic_);
}

BoardState player()
{
    return (player_);
}

static Config::instance_;

Config& Config::operator=(const Config& config)
{
}

}<commit_msg>Added const keywords to Config's getters<commit_after>#include <cstdio>
#include <string>

#include "board.hpp"
#include "config.hpp"

namespace roadagain
{

Config::Config() : use_color_(true), automatic_(false), player_(BLACK)
{
}

Config::Config(const Config& config)
{
}

Config& Config::instance()
{
    return (Config::instance_);
}

bool Config::init(int argc, char** argv)
{
    for (int i = 1; i < argc; i++){
        std::string argument(argv[i]);

        if (argument == "black"){
            player_ = BLACK;
        }
        else if (argument == "white"){
            player_ = WHITE;
        }
        else if (argument.substr(0, 11) == "--automatic"){
            if (argument == "--automatic" || argument.substr(12) == "=true"){
                automatic_ = true;
            }
            else if (argument.substr(12) == "=false"){
                automatic_ = false;
            }
            else {
                std::printf("invalid argument: %s\n", argv[i]);
                std::printf("automatic option must be 'true' or 'false'");
                return (false);
            }
        }
        else if (argument.substr(0, 11) == "--use-color"){
            if (argument == "--use-color" || argument.substr(12) == "=true"){
                use_color_ = true;
            }
            else if (argument.substr(12) == "=false"){
                use_color_ = false;
            }
            else {
                std::printf("invalid argument: %s\n", argv[i]);
                std::printf("using color option must be 'true' or 'false'");
                return (false);
            }
        }
        else {
            std::printf("invalid argument: %s\n", argv[i]);
            return (false);
        }
    }

    return (true);
}

bool Config::use_color() const
{
    return (use_color_);
}

bool Config::automatic() const
{
    return (automatic_);
}

BoardState Config::player() const
{
    return (player_);
}

static Config::instance_;

Config& Config::operator=(const Config& config)
{
}

}
{'fraction_non_alphanumeric': 0.15913065201099175, 'fraction_numerical': 0.007494379215588309, 'mean_word_length': 1.8661417322834646, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 7, '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': '1238311', 'n_tokens_mistral': 1228, 'n_tokens_neox': 1155, 'n_words': 284}