strfunc.h
1
#ifndef RAPIDJSON_INTERNAL_STRFUNC_H_
2
#define RAPIDJSON_INTERNAL_STRFUNC_H_
3
4
namespace
rapidjson
{
5
namespace
internal {
6
7
//! Custom strlen() which works on different character types.
8
/*! \tparam Ch Character type (e.g. char, wchar_t, short)
9
\param s Null-terminated input string.
10
\return Number of characters in the string.
11
\note This has the same semantics as strlen(), the return value is not number of Unicode codepoints.
12
*/
13
template
<
typename
Ch>
14
inline
SizeType
StrLen(
const
Ch* s) {
15
const
Ch* p = s;
16
while
(*p) ++p;
17
return
SizeType
(p - s);
18
}
19
20
}
// namespace internal
21
}
// namespace rapidjson
22
23
#endif // RAPIDJSON_INTERNAL_STRFUNC_H_
rapidjson::SizeType
unsigned SizeType
Use 32-bit array/string indices even for 64-bit platform, instead of using size_t.
Definition:
rapidjson.h:133
rapidjson
main RapidJSON namespace
Definition:
allocators.h:6
include
rapidjson
internal
strfunc.h