mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-18 05:32:52 +00:00
97f2a2213e
* Move some code outside dbms/src folder * Fix paths
29 lines
732 B
C++
29 lines
732 B
C++
#include <Functions/FunctionFactory.h>
|
|
#include <Functions/FunctionsVisitParam.h>
|
|
#include <Functions/FunctionsStringSearch.h>
|
|
|
|
|
|
namespace DB
|
|
{
|
|
|
|
struct ExtractBool
|
|
{
|
|
using ResultType = UInt8;
|
|
|
|
static UInt8 extract(const UInt8 * begin, const UInt8 * end)
|
|
{
|
|
return begin + 4 <= end && 0 == strncmp(reinterpret_cast<const char *>(begin), "true", 4);
|
|
}
|
|
};
|
|
|
|
struct NameVisitParamExtractBool { static constexpr auto name = "visitParamExtractBool"; };
|
|
using FunctionVisitParamExtractBool = FunctionsStringSearch<ExtractParamImpl<ExtractBool>, NameVisitParamExtractBool>;
|
|
|
|
|
|
void registerFunctionVisitParamExtractBool(FunctionFactory & factory)
|
|
{
|
|
factory.registerFunction<FunctionVisitParamExtractBool>();
|
|
}
|
|
|
|
}
|