34 #include "../api_core.h"
38 #ifdef __cplusplus_cli
39 #pragma managed(push, on)
52 static std::vector<CL_String> split_text(
55 bool skip_empty =
true);
61 static CL_String8 wchar_to_utf8(
wchar_t value);
67 static CL_String8 unicode_to_utf8(
unsigned int value);
142 static CL_String float_to_text(
float value,
int num_decimal_places=6);
150 static CL_String8 float_to_local8(
float value,
int num_decimal_places=6);
158 static CL_String16 float_to_ucs2(
float value,
int num_decimal_places=6);
187 static CL_String double_to_text(
double value,
int num_decimal_places=6);
195 static CL_String8 double_to_local8(
double value,
int num_decimal_places=6);
203 static CL_String16 double_to_ucs2(
double value,
int num_decimal_places=6);
210 static double text_to_double(
const CL_StringRef &value);
253 static int text_to_int(
const CL_StringRef &value,
int base = 10);
261 static int local8_to_int(
const CL_StringRef8 &value,
int base = 10);
269 static int ucs2_to_int(
const CL_StringRef16 &value,
int base = 10);
276 static CL_String uint_to_text(
unsigned int value);
283 static CL_String8 uint_to_local8(
unsigned int value);
290 static CL_String16 uint_to_ucs2(
unsigned int value);
292 static unsigned int text_to_uint(
const CL_StringRef &value,
int base = 10);
294 static unsigned int local8_to_uint(
const CL_StringRef8 &value,
int base = 10);
296 static unsigned int ucs2_to_uint(
const CL_StringRef16 &value,
int base = 10);
303 static CL_String ll_to_text(
long long value);
310 static CL_String8 ll_to_local8(
long long value);
325 static long long text_to_ll(
const CL_StringRef &value,
int base = 10);
333 static long long local8_to_ll(
const CL_StringRef8 &value,
int base = 10);
341 static long long ucs2_to_ll(
const CL_StringRef16 &value,
int base = 10);
348 static CL_String ull_to_text(
unsigned long long value);
355 static CL_String8 ull_to_local8(
unsigned long long value);
362 static CL_String16 ull_to_ucs2(
unsigned long long value);
370 static unsigned long long text_to_ull(
const CL_StringRef &value,
int base = 10);
378 static unsigned long long local8_to_ull(
const CL_StringRef8 &value,
int base = 10);
386 static unsigned long long ucs2_to_ull(
const CL_StringRef16 &value,
int base = 10);
393 static CL_String bool_to_text(
bool value);
567 #ifdef __cplusplus_cli
568 static CL_String clr_to_text(
const System::String ^str)
575 return ucs2_to_utf8(clr_to_ucs2(str));
578 static System::String ^text_to_clr(
const CL_StringRef &str)
580 return ucs2_to_clr(utf8_to_ucs2(str));
588 static CL_String16 clr_to_ucs2(
const System::String ^str)
590 cli::pin_ptr<const wchar_t> chars = PtrToStringChars(str);
596 return gcnew System::String(str.
c_str());
605 static const char trailing_bytes_for_utf8[256];
607 static const unsigned char bitmask_leadbyte_for_utf8[6];
611 #ifdef __cplusplus_cli