<commit_before>/*
** This file is part of libyuni, a cross-platform C++ framework (http://libyuni.org).
**
** This Source Code Form is subject to the terms of the Mozilla Public License
** v.2.0. If a copy of the MPL was not distributed with this file, You can
** obtain one at http://mozilla.org/MPL/2.0/.
**
** github: https://github.com/libyuni/libyuni/
** gitlab: https://gitlab.com/libyuni/libyuni/ (mirror)
*/
#pragma once
#include "default.h"


namespace Yuni
{
namespace Validator
{
namespace Text
{


	template<Yuni::Validator::DefaultPolicy DefaultPolicy>
	inline ExceptionList<DefaultPolicy>::ExceptionList()
	{}


	template<Yuni::Validator::DefaultPolicy DefaultPolicy>
	inline ExceptionList<DefaultPolicy>::ExceptionList(const ExceptionList<DefaultPolicy>& rhs)
		:pExceptionList(rhs.pExceptionList)
	{}


	template<Yuni::Validator::DefaultPolicy DefaultPolicy>
	template<Yuni::Validator::DefaultPolicy OtherDefaultPolicy>
	inline ExceptionList<DefaultPolicy>::ExceptionList(const ExceptionList<OtherDefaultPolicy>& rhs)
		:pExceptionList(rhs.pExceptionList)
	{}


	template<Yuni::Validator::DefaultPolicy DefaultPolicy>
	inline ExceptionList<DefaultPolicy>::ExceptionList(const std::vector<String>& rhs)
		:pExceptionList(rhs)
	{}


	template<Yuni::Validator::DefaultPolicy DefaultPolicy>
	template<typename U>
	bool ExceptionList<DefaultPolicy>::validate(const U& s) const
	{
		if (!pExceptionList.empty())
		{
			const std::vector<String>::const_iterator end = pExceptionList.end();
			for (std::vector<String>::const_iterator i = pExceptionList.begin(); i != end; ++i)
			{
				if (*i == s)
					return !DefaultPolicy;
			}
		}
		return DefaultPolicy;
	}


	template<Yuni::Validator::DefaultPolicy DefaultPolicy>
	template<class U>
	inline void ExceptionList<DefaultPolicy>::exception(const U& e)
	{
		pExceptionList.push_back(e);
	}


	template<Yuni::Validator::DefaultPolicy DefaultPolicy>
	template<Yuni::Validator::DefaultPolicy OtherDefaultPolicy>
	inline ExceptionList<DefaultPolicy>& ExceptionList<DefaultPolicy>::operator = (const ExceptionList<OtherDefaultPolicy>& rhs)
	{
		pExceptionList = rhs.pExceptionList;
		return *this;
	}


	template<Yuni::Validator::DefaultPolicy DefaultPolicy>
	inline ExceptionList<DefaultPolicy>& ExceptionList<DefaultPolicy>::operator = (const std::vector<String>& rhs)
	{
		pExceptionList = rhs;
		return *this;
	}


	template<Yuni::Validator::DefaultPolicy DefaultPolicy>
	inline ExceptionList<DefaultPolicy>& ExceptionList<DefaultPolicy>::operator += (const AnyString& rhs)
	{
		pExceptionList.push_back(rhs);
		return *this;
	}


	template<Yuni::Validator::DefaultPolicy DefaultPolicy>
	template<Yuni::Validator::DefaultPolicy OtherDefaultPolicy>
	inline ExceptionList<DefaultPolicy>& ExceptionList<DefaultPolicy>::operator += (const ExceptionList<OtherDefaultPolicy>& rhs)
	{
		pExceptionList += rhs.pExceptionList;
		return *this;
	}


	template<Yuni::Validator::DefaultPolicy DefaultPolicy>
	inline ExceptionList<DefaultPolicy>& ExceptionList<DefaultPolicy>::operator += (const std::vector<String>& rhs)
	{
		pExceptionList += rhs;
		return *this;
	}


	template<Yuni::Validator::DefaultPolicy DefaultPolicy>
	inline ExceptionList<DefaultPolicy>& ExceptionList<DefaultPolicy>::operator << (const AnyString& rhs)
	{
		pExceptionList.push_back(rhs);
		return *this;
	}


	template<Yuni::Validator::DefaultPolicy DefaultPolicy>
	template<Yuni::Validator::DefaultPolicy OtherDefaultPolicy>
	inline ExceptionList<DefaultPolicy>& ExceptionList<DefaultPolicy>::operator << (const ExceptionList<OtherDefaultPolicy>& rhs)
	{
		pExceptionList += rhs.pExceptionList;
		return *this;
	}


	template<Yuni::Validator::DefaultPolicy DefaultPolicy>
	inline ExceptionList<DefaultPolicy>& ExceptionList<DefaultPolicy>::operator << (const std::vector<String>& rhs)
	{
		pExceptionList += rhs;
		return *this;
	}




} // namespace Text
} // namespace Validator
} // namespace Yuni<commit_msg>text validator: fixed compilation<commit_after>/*
** This file is part of libyuni, a cross-platform C++ framework (http://libyuni.org).
**
** This Source Code Form is subject to the terms of the Mozilla Public License
** v.2.0. If a copy of the MPL was not distributed with this file, You can
** obtain one at http://mozilla.org/MPL/2.0/.
**
** github: https://github.com/libyuni/libyuni/
** gitlab: https://gitlab.com/libyuni/libyuni/ (mirror)
*/
#pragma once
#include "default.h"


namespace Yuni
{
namespace Validator
{
namespace Text
{


	template<Yuni::Validator::DefaultPolicy DefaultPolicy>
	inline ExceptionList<DefaultPolicy>::ExceptionList()
	{}


	template<Yuni::Validator::DefaultPolicy DefaultPolicy>
	inline ExceptionList<DefaultPolicy>::ExceptionList(const ExceptionList<DefaultPolicy>& rhs)
		:pExceptionList(rhs.pExceptionList)
	{}


	template<Yuni::Validator::DefaultPolicy DefaultPolicy>
	template<Yuni::Validator::DefaultPolicy OtherDefaultPolicy>
	inline ExceptionList<DefaultPolicy>::ExceptionList(const ExceptionList<OtherDefaultPolicy>& rhs)
		:pExceptionList(rhs.pExceptionList)
	{}


	template<Yuni::Validator::DefaultPolicy DefaultPolicy>
	inline ExceptionList<DefaultPolicy>::ExceptionList(const std::vector<String>& rhs)
		:pExceptionList(rhs)
	{}


	template<Yuni::Validator::DefaultPolicy DefaultPolicy>
	template<typename U>
	bool ExceptionList<DefaultPolicy>::validate(const U& s) const
	{
		if (!pExceptionList.empty())
		{
			const std::vector<String>::const_iterator end = pExceptionList.end();
			for (std::vector<String>::const_iterator i = pExceptionList.begin(); i != end; ++i)
			{
				if (*i == s)
					return !DefaultPolicy;
			}
		}
		return DefaultPolicy;
	}


	template<Yuni::Validator::DefaultPolicy DefaultPolicy>
	template<class U>
	inline void ExceptionList<DefaultPolicy>::exception(const U& e)
	{
		pExceptionList.push_back(e);
	}


	template<Yuni::Validator::DefaultPolicy DefaultPolicy>
	template<Yuni::Validator::DefaultPolicy OtherDefaultPolicy>
	inline ExceptionList<DefaultPolicy>& ExceptionList<DefaultPolicy>::operator = (const ExceptionList<OtherDefaultPolicy>& rhs)
	{
		pExceptionList = rhs.pExceptionList;
		return *this;
	}


	template<Yuni::Validator::DefaultPolicy DefaultPolicy>
	inline ExceptionList<DefaultPolicy>& ExceptionList<DefaultPolicy>::operator = (const std::vector<String>& rhs)
	{
		pExceptionList = rhs;
		return *this;
	}


	template<Yuni::Validator::DefaultPolicy DefaultPolicy>
	inline ExceptionList<DefaultPolicy>& ExceptionList<DefaultPolicy>::operator += (const AnyString& rhs)
	{
		pExceptionList.push_back(rhs);
		return *this;
	}


	template<Yuni::Validator::DefaultPolicy DefaultPolicy>
	template<Yuni::Validator::DefaultPolicy OtherDefaultPolicy>
	inline ExceptionList<DefaultPolicy>& ExceptionList<DefaultPolicy>::operator += (const ExceptionList<OtherDefaultPolicy>& rhs)
	{
		pExceptionList += rhs.pExceptionList;
		return *this;
	}


	template<Yuni::Validator::DefaultPolicy DefaultPolicy>
	inline ExceptionList<DefaultPolicy>& ExceptionList<DefaultPolicy>::operator += (const std::vector<String>& rhs)
	{
		for (auto& i: rhs)
			pExceptionList.push_back(i);
		return *this;
	}


	template<Yuni::Validator::DefaultPolicy DefaultPolicy>
	inline ExceptionList<DefaultPolicy>& ExceptionList<DefaultPolicy>::operator << (const AnyString& rhs)
	{
		pExceptionList.push_back(rhs);
		return *this;
	}


	template<Yuni::Validator::DefaultPolicy DefaultPolicy>
	template<Yuni::Validator::DefaultPolicy OtherDefaultPolicy>
	inline ExceptionList<DefaultPolicy>& ExceptionList<DefaultPolicy>::operator << (const ExceptionList<OtherDefaultPolicy>& rhs)
	{
		pExceptionList += rhs.pExceptionList;
		return *this;
	}


	template<Yuni::Validator::DefaultPolicy DefaultPolicy>
	inline ExceptionList<DefaultPolicy>& ExceptionList<DefaultPolicy>::operator << (const std::vector<String>& rhs)
	{
		for (auto& i: rhs)
			pExceptionList.push_back(i);
		return *this;
	}




} // namespace Text
} // namespace Validator
} // namespace Yuni
{'fraction_non_alphanumeric': 0.12415094339622641, 'fraction_numerical': 0.0010062893081761006, 'mean_word_length': 6.7646484375, 'pattern_counts': {'":': 0, '<': 121, '<?xml version=': 0, '>': 109, 'https://': 4, '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': '399487', 'n_tokens_mistral': 2436, 'n_tokens_neox': 2291, 'n_words': 472}