14 #ifndef XSENS_NO_WCHAR 16 #if !defined(XSENS_NO_STL) && defined(__cplusplus) && defined(WIN32) 19 #endif // XSENS_NO_WCHAR 32 #define XsString_INITIALIZER XSARRAY_INITIALIZER(&g_xsStringDescriptor) 36 #define XSSTRING_INITIALIZER XsString_INITIALIZER 47 #ifndef XSENS_NO_WCHAR 50 #endif // XSENS_NO_WCHAR 62 #define XsString_copy(thisPtr, copy) XsArray_copy(copy, thisPtr) 63 #define XsString_swap(a, b) XsArray_swap(a, b) 77 struct XsStringType :
public XsArrayImpl<char, g_xsStringDescriptor, XsString>
79 inline XsStringType() : XsArrayImpl() {}
81 : XsArrayImpl(
ref, sz, flags)
94 inline XsSize reserved()
const {
return m_reserved ? m_reserved - 1 : 0; }
99 return *ptrAt(m_data,
index);
167 inline void append(
const XsStringType& other)
173 struct XsString :
public XsStringType
183 inline XsString(
const XsStringType& other) : XsStringType(other) {}
188 : XsStringType(
ref, sz + 1, flags)
191 #ifndef XSENS_NOITERATOR 194 template <
typename Iterator>
195 inline XsString(Iterator
const& beginIt, Iterator
const& endIt)
196 : XsStringType(beginIt, endIt)
207 #ifndef XSENS_NO_WCHAR 209 inline XsString(
wchar_t const*
src) : XsStringType()
223 inline XsString(std::wstring
const&
src) : XsStringType()
227 #endif // XSENS_NO_STL 232 static const char nullChar = 0;
233 if (
empty())
return (
char*)&nullChar;
234 return begin().operator->();
238 inline char const* c_str()
const 240 static const char nullChar = 0;
241 if (
empty())
return &nullChar;
242 return begin().operator->();
252 #endif // XSENS_NO_STL 258 tmp.reserve(
size() + other.size());
266 std::wstring toStdWString()
const 268 if (
empty())
return std::wstring();
275 #endif // XSENS_NO_STL 278 using XsStringType::operator==;
279 using XsStringType::operator!=;
280 #ifndef XSENS_NOITERATOR 281 using XsStringType::operator<<;
289 if (!str)
return empty();
290 return !strcmp(c_str(), str);
294 inline bool operator!=(
char const* str)
const {
return !(*
this == str); }
325 template <
typename _CharT,
typename _Traits>
327 basic_ostream<_CharT, _Traits>& o,
XsString const& xs)
329 return (o << xs.toStdString());
std::ostream & operator<<(std::ostream &o, const TFTDIDevice &d)
Print out all the information of a FTDI device in textual form.
XSTYPES_DLL_API void XsArray_insert(void *thisPtr, XsSize index, XsSize count, void const *src)
GLuint GLuint GLsizei count
This object describes how to treat the data in an array.
EIGEN_STRONG_INLINE bool empty() const
XSARRAY_STRUCT(XsString, char)
XSTYPES_DLL_API void XsString_assignWCharArray(XsString *thisPtr, const wchar_t *src)
XSTYPES_DLL_API void XsString_resize(XsString *thisPtr, XsSize count)
XSTYPES_DLL_API void XsString_assign(XsString *thisPtr, XsSize count, const char *src)
EIGEN_STRONG_INLINE iterator begin()
size_t XsSize
XsSize must be unsigned number!
XSTYPES_DLL_API void XsString_append(XsString *thisPtr, XsString const *other)
TColor operator+(const TColor &first, const TColor &second)
Pairwise addition of their corresponding RGBA members.
VALUE & operator[](const KEY &key)
Write/read via [i] operator, that creates an element if it didn't exist already.
GLubyte GLubyte GLubyte GLubyte w
XSTYPES_DLL_API XsSize XsString_copyToWCharArray(const XsString *thisPtr, wchar_t *dest, XsSize size)
EIGEN_STRONG_INLINE void setSize(size_t row, size_t col)
Changes the size of matrix, maintaining its previous content as possible and padding with zeros where...
EIGEN_STRONG_INLINE void assign(const Scalar v)
GLsizei const GLchar ** string
XSTYPES_DLL_API void XsString_erase(XsString *thisPtr, XsSize index, XsSize count)
XSTYPES_DLL_API void XsString_destruct(XsString *thisPtr)
bool operator==(const mrpt::img::TCamera &a, const mrpt::img::TCamera &b)
XSTYPES_DLL_API void XsString_construct(XsString *thisPtr)
XSTYPES_DLL_API void XsArray_reserve(void *thisPtr, XsSize count)
bool operator!=(const mrpt::img::TCamera &a, const mrpt::img::TCamera &b)
size_t m_size
Number of elements accessed with write access so far.
XSTYPES_DLL_API void XsString_assignCharArray(XsString *thisPtr, const char *src)
XsArrayDescriptor const XSTYPES_DLL_API g_xsStringDescriptor
int sprintf(char *buf, size_t bufSize, const char *format,...) noexcept MRPT_printf_format_check(3
An OS-independent version of sprintf (Notice the bufSize param, which may be ignored in some compiler...
XsDataFlags
These flags define the behaviour of data contained by Xsens data structures.