<commit_before>#include "CustomFileSettings.h"
#include "Settings/Exceptions/CustomFileSettingsExceptions.h"

using std::string;

using settings::domain::CustomFileSettings;
using settings::domain::FileToBackup;
using settings::exceptions::DuplicateLabelCustomFileSettingsException;

CustomFileSettings::CustomFileSettings(const string& backupFolderPath, const std::vector<FileToBackup>& filePaths, const std::string& executablePath)
    : _backupFolderPath(backupFolderPath), _filePaths(filePaths), _executablePath(executablePath)
{
    this->validateFilePaths();
}


CustomFileSettings::~CustomFileSettings()
{
}

string CustomFileSettings::getBackupFolderPath()
{
	return _backupFolderPath;
}

const std::vector<FileToBackup>& CustomFileSettings::getFilePaths() const
{
    return _filePaths;
}

string CustomFileSettings::getExecutablePath() const
{
    return _executablePath;
}

void CustomFileSettings::validateFilePaths()
{
    for (auto fileIt  = _filePaths.begin(); fileIt != _filePaths.end(); ++fileIt)
    {
        FileToBackup& file = *fileIt;

        auto duplicateIt = find_if(fileIt + 1, _filePaths.end(), [&file] (FileToBackup& f) {
                return file.getLabel() == f.getLabel();
        });

        if (duplicateIt != _filePaths.end())
        {
            throw DuplicateLabelCustomFileSettingsException(duplicateIt->getLabel());
        }
    }
}<commit_msg>maybe fix error with find_if<commit_after>#include "CustomFileSettings.h"
#include "Settings/Exceptions/CustomFileSettingsExceptions.h"

using std::string;

using settings::domain::CustomFileSettings;
using settings::domain::FileToBackup;
using settings::exceptions::DuplicateLabelCustomFileSettingsException;

CustomFileSettings::CustomFileSettings(const string& backupFolderPath, const std::vector<FileToBackup>& filePaths, const std::string& executablePath)
    : _backupFolderPath(backupFolderPath), _filePaths(filePaths), _executablePath(executablePath)
{
    this->validateFilePaths();
}


CustomFileSettings::~CustomFileSettings()
{
}

string CustomFileSettings::getBackupFolderPath()
{
	return _backupFolderPath;
}

const std::vector<FileToBackup>& CustomFileSettings::getFilePaths() const
{
    return _filePaths;
}

string CustomFileSettings::getExecutablePath() const
{
    return _executablePath;
}

void CustomFileSettings::validateFilePaths()
{
    for (auto fileIt  = _filePaths.begin(); fileIt != _filePaths.end(); ++fileIt)
    {
        FileToBackup& file = *fileIt;

        auto duplicateIt = std::find_if(fileIt + 1, _filePaths.end(), [&file] (FileToBackup& f) {
                return file.getLabel() == f.getLabel();
        });

        if (duplicateIt != _filePaths.end())
        {
            throw DuplicateLabelCustomFileSettingsException(duplicateIt->getLabel());
        }
    }
}
{'fraction_non_alphanumeric': 0.11848679514632406, 'fraction_numerical': 0.0007137758743754461, 'mean_word_length': 5.2150776053215075, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, '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': '4728427', 'n_tokens_mistral': 815, 'n_tokens_neox': 815, 'n_words': 142}