10 #ifndef INCLUDED_RTL_STRINGUTILS_HXX
11 #define INCLUDED_RTL_STRINGUTILS_HXX
25 #ifdef RTL_STRING_UNITTEST
26 #define rtl rtlunittest
32 #ifdef RTL_STRING_UNITTEST
36 #if defined LIBO_INTERNAL_ONLY
76 static_cast<unsigned char>(C) < 0x80,
77 "non-ASCII character in OUStringLiteral1");
80 #if defined _MSC_VER && _MSC_VER <= 1900 // Visual Studio 2015
81 template<
char C>
using OUStringLiteral1 = OUStringLiteral1_<C>;
82 #pragma warning(disable: 4239)
84 template<
char C>
using OUStringLiteral1 = OUStringLiteral1_<C>
const;
90 namespace libreoffice_internal
117 template<
typename T1,
typename T2 =
void >
120 static const bool ok =
false;
122 template<
typename T >
126 static const bool ok =
true;
128 template<
typename T >
132 static const bool ok =
true;
135 template<
typename T1,
typename T2 >
139 template<
typename T,
int N >
144 #ifdef RTL_STRING_UNITTEST
146 template<
typename T >
151 template<
typename T >
152 struct NonConstCharArrayDetector< const char[], T >
158 template<
typename T1,
typename T2 =
void >
161 static const bool ok =
false;
163 template< std::
size_t N,
typename T >
167 static const std::size_t length = N - 1;
168 static const bool ok =
true;
169 static bool isValid(
char const (& literal)[N])
170 {
return std::strlen(literal) == length; }
171 static char const *
toPointer(
char const (& literal)[N]) {
return literal; }
173 #if defined LIBO_INTERNAL_ONLY
174 template<
char C,
typename T>
struct ConstCharArrayDetector<
175 #if defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ <= 8 \
176 && !defined __clang__
177 OUStringLiteral1_<C>
const,
184 static const std::size_t length = 1;
185 static const bool ok =
true;
186 static bool isValid(OUStringLiteral1_<C>) {
return true; }
187 static char const * toPointer(OUStringLiteral1_<C>
const & literal)
188 {
return &literal.c; }
193 template<
typename T >
206 template<
typename T >
219 #if defined LIBO_INTERNAL_ONLY && defined _MSC_VER && _MSC_VER <= 1900
224 template<
typename T1,
typename T2 =
void >
227 static const bool ok =
false;
229 template<
typename T >
233 static const bool ok =
true;
235 template<
typename T >
239 static const bool ok =
true;
243 template<
typename T,
bool >
248 template<
typename T >
259 #endif // INCLUDED_RTL_STRINGUTILS_HXX
static bool isValid(char const (&literal)[N])
Definition: stringutils.hxx:169
#define SAL_WARN_UNUSED
Annotate classes where a compiler should warn if an instance is unused.
Definition: types.h:608
Definition: stringutils.hxx:136
static char const * toPointer(char const (&literal)[N])
Definition: stringutils.hxx:171
Definition: stringutils.hxx:116
Definition: stringutils.hxx:225
T Type
Definition: stringutils.hxx:131
T Type
Definition: stringutils.hxx:142
static const bool ok
Definition: stringutils.hxx:120
T Type
Definition: stringutils.hxx:166
Definition: stringutils.hxx:207
T Type
Definition: stringutils.hxx:125
T Type
Definition: stringutils.hxx:238
Definition: stringutils.hxx:194
T Type
Definition: stringutils.hxx:232
T Type
Definition: stringutils.hxx:251
sal_uInt16 sal_Unicode
Definition: types.h:152
Definition: stringutils.hxx:244
Definition: stringutils.hxx:159
Definition: stringutils.hxx:118
Dummy Type
Definition: stringutils.hxx:196
Definition: bootstrap.hxx:24
static const bool ok
Definition: stringutils.hxx:161
Dummy Type
Definition: stringutils.hxx:209