Chris M e442d682cd Added rapidjson library
Added web_interface_utils.cpp/.h to common to provide string based functions for outputting JSON
Adjusted CMake to include rapidjson library and new web_interface_utils.h/cpp to common

Currently, I have code set up hackishly for testing so do not think it is final. It is merely for demonstrating what I've done and played with.
2014-07-20 15:02:06 -05:00

24 lines
646 B
C++

#ifndef RAPIDJSON_INTERNAL_STRFUNC_H_
#define RAPIDJSON_INTERNAL_STRFUNC_H_
namespace rapidjson {
namespace internal {
//! Custom strlen() which works on different character types.
/*! \tparam Ch Character type (e.g. char, wchar_t, short)
\param s Null-terminated input string.
\return Number of characters in the string.
\note This has the same semantics as strlen(), the return value is not number of Unicode codepoints.
*/
template <typename Ch>
inline SizeType StrLen(const Ch* s) {
const Ch* p = s;
while (*p) ++p;
return SizeType(p - s);
}
} // namespace internal
} // namespace rapidjson
#endif // RAPIDJSON_INTERNAL_STRFUNC_H_