23 #include <drizzled/sql_string.h>
24 #include <drizzled/type/boolean.h>
25 #include <drizzled/charset.h>
30 const char* convert(
bool source,
bool ansi_display)
33 return ansi_display ?
"YES" :
"TRUE";
34 return ansi_display ?
"NO" :
"FALSE";
37 void convert(String& destination,
bool source,
bool ansi_display)
39 const char* v= convert(source, ansi_display);
40 destination.alloc(strlen(v));
41 strcpy(destination.c_ptr(), v);
42 destination.length(strlen(v));
45 bool convert(
bool &destination,
const char *source,
const size_t source_length)
47 switch (source_length)
67 if (not (system_charset_info->strcasecmp(source,
"FALSE")))
75 if (not (system_charset_info->strcasecmp(source,
"TRUE")))
83 if (not (system_charset_info->strcasecmp(source,
"YES")))
91 if (not (system_charset_info->strcasecmp(source,
"NO")))
104 bool convert(
bool &destination, String &source)
106 return convert(destination, source.c_ptr(), source.length());
TODO: Rename this file - func.h is stupid.