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
78 #if defined _MSC_VER && _MSC_VER <= 1900 && !defined __clang__
80 using OUStringLiteral1 = OUStringLiteral1_;
81 #pragma warning(disable: 4239)
83 using OUStringLiteral1 = OUStringLiteral1_
const;
89 namespace libreoffice_internal
116 template<
typename T1,
typename T2 =
void >
119 static const bool ok =
false;
121 template<
typename T >
125 static const bool ok =
true;
127 template<
typename T >
131 static const bool ok =
true;
134 template<
typename T1,
typename T2 >
138 template<
typename T,
int N >
143 #ifdef RTL_STRING_UNITTEST
145 template<
typename T >
150 template<
typename T >
151 struct NonConstCharArrayDetector< const char[], T >
157 template<
typename T1,
typename T2 =
void >
160 static const bool ok =
false;
162 template< std::
size_t N,
typename T >
166 static const std::size_t length = N - 1;
167 static const bool ok =
true;
168 static bool isValid(
char const (& literal)[N])
169 {
return std::strlen(literal) == length; }
170 static char const *
toPointer(
char const (& literal)[N]) {
return literal; }
172 #if defined LIBO_INTERNAL_ONLY
173 template<std::
size_t N,
typename T>
174 struct ConstCharArrayDetector<
sal_Unicode const [N], T> {
182 template<
typename T>
struct ConstCharArrayDetector<
183 #if defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ <= 8 \
184 && !defined __clang__
185 OUStringLiteral1_
const,
195 OUStringLiteral1_
const & literal)
196 {
return &literal.c; }
201 template<
typename T >
210 #if defined LIBO_INTERNAL_ONLY
211 template<std::
size_t N>
213 template<>
struct ExceptConstCharArrayDetector<
214 #if defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ <= 8 \
215 && !defined __clang__
216 OUStringLiteral1_
const
228 template<
typename T >
241 #if defined LIBO_INTERNAL_ONLY
243 template<std::
size_t N>
struct ExceptCharArrayDetector<
sal_Unicode const[N]> {};
244 template<>
struct ExceptCharArrayDetector<OUStringLiteral1_> {};
247 template<
typename T1,
typename T2 =
void >
250 static const bool ok =
false;
252 template<
typename T >
256 static const bool ok =
true;
258 template<
typename T >
262 static const bool ok =
true;
266 template<
typename T,
bool >
271 template<
typename T >
282 #endif // INCLUDED_RTL_STRINGUTILS_HXX
static bool isValid(char const (&literal)[N])
Definition: stringutils.hxx:168
Definition: stringutils.hxx:202
T Type
Definition: stringutils.hxx:124
#define SAL_WARN_UNUSED
Annotate classes where a compiler should warn if an instance is unused.
Definition: types.h:624
static const bool ok
Definition: stringutils.hxx:119
Definition: stringutils.hxx:267
T Type
Definition: stringutils.hxx:274
T Type
Definition: stringutils.hxx:255
Definition: stringutils.hxx:158
T Type
Definition: stringutils.hxx:130
static char const * toPointer(char const (&literal)[N])
Definition: stringutils.hxx:170
T Type
Definition: stringutils.hxx:165
Definition: stringutils.hxx:117
sal_uInt16 sal_Unicode
Definition: types.h:155
T Type
Definition: stringutils.hxx:261
#define SAL_CONSTEXPR
C++11 "constexpr" feature.
Definition: types.h:445
Definition: stringutils.hxx:135
Definition: stringutils.hxx:115
Definition: stringutils.hxx:248
T Type
Definition: stringutils.hxx:141
Dummy Type
Definition: stringutils.hxx:231
Dummy Type
Definition: stringutils.hxx:204
static const bool ok
Definition: stringutils.hxx:250
Definition: stringutils.hxx:229
static const bool ok
Definition: stringutils.hxx:160