25 #define XPACE_RELEASE 1.1.5 27 #if defined _WIN32 && defined _DEBUG 28 #define _CRTDBG_MAP_ALLOC 37 #if !defined XPACE_EXPORT 38 # if !defined _WIN32 || defined XPACE_STATICLIB 41 # define XPACE_EXPORT __declspec(dllimport) 46 #if !defined FORCEINLINE 49 # define FORCEINLINE __forceinline 50 # elif defined __GNUC__ 51 # define FORCEINLINE inline __attribute__((always_inline)) 53 # error need to define FORCEINLINE for this compiler 56 # define FORCEINLINE inline 61 #define override // until GCC 4.7 110 #define UNSIGN(T) typename Unsigned<T>::Type 115 template<
typename intType>
struct Signed {
typedef intType
Type; };
122 #define SIGN(T) typename Signed<T>::Type 123 #define DIFF(T) typename Signed<T>::Type 140 #define CHANGE_SIGN(T) typename ChangeSign<T>::Type 152 #if defined _WIN64 || defined __LP64__ 164 template <
typename T>
183 template <
typename T>
201 template <
typename CH>
229 return (length == rhs.length) &&
230 !memcmp(data, rhs.data,
sizeof(CH) * length);
237 return !(*
this == rhs);
244 int cmp(memcmp(data, rhs.data,
sizeof(CH) * std::min(length, rhs.length)));
249 return length > rhs.length;
256 int cmp(memcmp(data, rhs.data,
sizeof(CH) * std::min(length, rhs.length)));
261 return length < rhs.length;
313 std::vector<utf8_t> toUtf8
318 const utf16_t* toUtf16
322 #if defined QSTRING_H || defined DOCUMENTATION 329 operator const QString
338 #if defined _STRING_ || defined DOCUMENTATION 342 (
const std::string& s);
346 (
const std::wstring& s);
349 std::string toStdString
354 std::wstring toStdWString
401 return !(*
this == rhs);
431 #if defined _STRING_ || defined DOCUMENTATION 439 (std::wostream& ostr,
446 #define REVEAL_STRING(s, Str) 447 #elif defined QSTRING_H 448 #define REVEAL_STRING(s, Str) const std::wstring s(reinterpret_cast<const wchar_t*>(QString(Str).utf16())) 483 const char* format = 0,
489 (
const char* format = 0,
492 #if defined _TRACE || defined DOCUMENTATION 501 template <
typename TO,
typename FROM>
505 assert(FROM(TO(from)) == from);
513 template <
typename T>
523 template <
typename T>
562 int sprintf_s(
char*,
size_t,
const char*, ...);
563 int swprintf_s(
wchar_t*,
size_t,
const wchar_t*, ...);
564 char*
strtok_s(
char*,
const char*,
char**);
565 errno_t
strncpy_s(
char*,
size_t,
const char*,
size_t);
566 errno_t
_itoa_s(
int,
char*,
size_t,
int);
567 errno_t
_itow_s(
int,
wchar_t*,
size_t,
int);
568 errno_t
_i64toa_s(int64,
char*,
size_t,
int);
569 errno_t
_i64tow_s(int64,
wchar_t*,
size_t,
int);
570 errno_t
wmemmove_s(
wchar_t*,
size_t,
const wchar_t*,
size_t);
571 #define _strdup(s) strdup(s)
Buf(T *d, size_t len=0)
constructor
Ref(const T *d=0, size_t len=0)
constructor
int sprintf_s(char *, size_t, const char *,...)
A string, Unicode UTF-16 and reference-counted.
uint const Xpace_Char8 size_t len
A low-level const data holder.
uint64 XPACE_EXPORT pow10_64(uint p)
int64 _wtoi64(const wchar_t *)
unsigned long long uint64
int64 _atoi64(const char *)
Raw Strings - just a pointer and length.
static void Msg(const char *format=0,...)
static StatusCallback defaultStatus
Default status function.
uint32 XPACE_EXPORT pow10_32(uint p)
errno_t _i64tow_s(int64, wchar_t *, size_t, int)
errno_t _itoa_s(int, char *, size_t, int)
std::function< int64(uint64 val)> StatusCallback
A status callback passed to operations that could be time-consuming.
errno_t _i64toa_s(int64, char *, size_t, int)
TO narrow_to(FROM from)
checked loss-of-precision cast
char * strtok_s(char *, const char *, char **)
errno_t _itow_s(int, wchar_t *, size_t, int)
errno_t strncpy_s(char *, size_t, const char *, size_t)
int swprintf_s(wchar_t *, size_t, const wchar_t *,...)
RawString< utf8_t > String8
size_t length
number of Ts
Trace(const char *ID, const char *format=0,...)
RawString< utf16_t > String16
errno_t wmemmove_s(wchar_t *, size_t, const wchar_t *, size_t)
uint const Xpace_Char8 * data
Xpace project main namespace
size_t length
number of Ts