<commit_before>#include "stdafx.h"
#include "AppSettings.h"

namespace servers {
	static std::shared_ptr<jira::server> load(const settings::Section& section, const std::string& prefix)
	{
		auto name = section.getString(prefix + "name");
		auto login = section.getString(prefix + "login");
		auto password = section.getBinary(prefix + "password");
		auto url = section.getString(prefix + "url");
		auto jql = section.getString(prefix + "query");
		auto fields = section.getString(prefix + "fields");

		return std::make_shared<jira::server>(name, login, password, url, jira::search_def{jql, fields}, jira::server::stored);
	}

	static void store(const jira::server* server, settings::Section& section, const std::string& prefix)
	{
		if (!server->name().empty())
			section.setString(prefix + "name", server->name());
		section.setString(prefix + "login", server->login());
		section.setBinary(prefix + "password", server->password());
		section.setString(prefix + "url", server->url());

		auto& view = server->view();
		if (!view.jql().empty())
			section.setString(prefix + "query", view.jql());
		if (!view.columns().empty())
			section.setString(prefix + "fields", view.columnsDescr());
	}

	static std::vector<std::shared_ptr<jira::server>> load(const settings::Section& section)
	{
		auto size = section.getUInt32("Items");

		std::vector<std::shared_ptr<jira::server>> servers;
		servers.reserve(size);<commit_msg>Removing optional server properties, if not set.<commit_after>#include "stdafx.h"
#include "AppSettings.h"

namespace servers {
	static std::shared_ptr<jira::server> load(const settings::Section& section, const std::string& prefix)
	{
		auto name = section.getString(prefix + "name");
		auto login = section.getString(prefix + "login");
		auto password = section.getBinary(prefix + "password");
		auto url = section.getString(prefix + "url");
		auto jql = section.getString(prefix + "query");
		auto fields = section.getString(prefix + "fields");

		return std::make_shared<jira::server>(name, login, password, url, jira::search_def{jql, fields}, jira::server::stored);
	}

	static void store(const jira::server* server, settings::Section& section, const std::string& prefix)
	{
		if (!server->name().empty())
			section.setString(prefix + "name", server->name());
		else
			section.unset(prefix + "name");

		section.setString(prefix + "login", server->login());
		section.setBinary(prefix + "password", server->password());
		section.setString(prefix + "url", server->url());

		auto& view = server->view();
		if (!view.jql().empty())
			section.setString(prefix + "query", view.jql());
		else
			section.unset(prefix + "query");

		if (!view.columns().empty())
			section.setString(prefix + "fields", view.columnsDescr());
		else
			section.unset(prefix + "field");
	}

	static std::vector<std::shared_ptr<jira::server>> load(const settings::Section& section)
	{
		auto size = section.getUInt32("Items");

		std::vector<std::shared_ptr<jira::server>> servers;
		servers.reserve(size);
{'fraction_non_alphanumeric': 0.17912927883017613, 'fraction_numerical': 0.0013293452974410102, 'mean_word_length': 5.688888888888889, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 27, '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': '2988441', 'n_tokens_mistral': 1001, 'n_tokens_neox': 933, 'n_words': 202}