2019-06-02 12:11:01 +00:00
|
|
|
#pragma once
|
|
|
|
|
2020-09-15 09:55:57 +00:00
|
|
|
#include <common/types.h>
|
2019-06-02 12:11:01 +00:00
|
|
|
|
|
|
|
namespace Poco::Util
|
|
|
|
{
|
|
|
|
class AbstractConfiguration;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
/// Returns true if two configurations contains the same keys and values.
|
|
|
|
bool isSameConfiguration(const Poco::Util::AbstractConfiguration & left,
|
|
|
|
const Poco::Util::AbstractConfiguration & right);
|
|
|
|
|
2021-04-02 10:17:28 +00:00
|
|
|
/// Config may have multiple keys with one name. For example:
|
|
|
|
/// <root>
|
|
|
|
/// <some_key>...</some_key>
|
|
|
|
/// <some_key>...</some_key>
|
|
|
|
/// </root>
|
|
|
|
/// Returns true if the specified subview of the two configurations contains
|
|
|
|
/// the same keys and values for each key with the given name.
|
|
|
|
bool isSameConfigurationWithMultipleKeys(const Poco::Util::AbstractConfiguration & left,
|
|
|
|
const Poco::Util::AbstractConfiguration & right,
|
|
|
|
const String & root, const String & name);
|
|
|
|
|
2021-03-12 21:17:19 +00:00
|
|
|
/// Returns true if the specified subview of the two configurations contains the same keys and values.
|
|
|
|
bool isSameConfiguration(const Poco::Util::AbstractConfiguration & left,
|
|
|
|
const Poco::Util::AbstractConfiguration & right,
|
|
|
|
const String & key);
|
|
|
|
|
2019-06-02 12:11:01 +00:00
|
|
|
/// Returns true if specified subviews of the two configurations contains the same keys and values.
|
|
|
|
bool isSameConfiguration(const Poco::Util::AbstractConfiguration & left, const String & left_key,
|
|
|
|
const Poco::Util::AbstractConfiguration & right, const String & right_key);
|
|
|
|
|
|
|
|
inline bool operator==(const Poco::Util::AbstractConfiguration & left, const Poco::Util::AbstractConfiguration & right)
|
|
|
|
{
|
|
|
|
return isSameConfiguration(left, right);
|
|
|
|
}
|
|
|
|
|
|
|
|
inline bool operator!=(const Poco::Util::AbstractConfiguration & left, const Poco::Util::AbstractConfiguration & right)
|
|
|
|
{
|
|
|
|
return !isSameConfiguration(left, right);
|
|
|
|
}
|
|
|
|
}
|