2012-04-15 01:31:49 +00:00
|
|
|
#ifndef SPROUT_CWCHAR_WCSLEN_HPP
|
|
|
|
#define SPROUT_CWCHAR_WCSLEN_HPP
|
|
|
|
|
|
|
|
#include <cstddef>
|
|
|
|
#include <sprout/config.hpp>
|
2012-12-21 16:02:49 +00:00
|
|
|
#include <sprout/iterator/ptr_index_iterator.hpp>
|
|
|
|
#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT
|
2013-01-03 08:01:50 +00:00
|
|
|
#include <sprout/iterator/operation.hpp>
|
2012-04-15 01:31:49 +00:00
|
|
|
|
|
|
|
namespace sprout {
|
2012-12-21 16:02:49 +00:00
|
|
|
//
|
|
|
|
// wcslen
|
|
|
|
//
|
2012-10-05 15:58:56 +00:00
|
|
|
inline SPROUT_CONSTEXPR std::size_t
|
|
|
|
wcslen(wchar_t const* s) {
|
2012-12-21 13:35:48 +00:00
|
|
|
return !*s ? 0
|
|
|
|
: 1 + sprout::wcslen(s + 1)
|
|
|
|
;
|
2012-04-15 01:31:49 +00:00
|
|
|
}
|
2012-12-21 16:02:49 +00:00
|
|
|
|
|
|
|
inline SPROUT_CONSTEXPR std::size_t
|
|
|
|
wcslen(wchar_t const* s, std::size_t n) {
|
2013-01-03 08:01:50 +00:00
|
|
|
return sprout::distance(
|
2012-12-21 16:02:49 +00:00
|
|
|
sprout::as_iterator(s),
|
|
|
|
NS_SSCRISK_CEL_OR_SPROUT::find(sprout::as_iterator(s), sprout::as_iterator(s, n), L'\0')
|
|
|
|
);
|
|
|
|
}
|
2012-04-15 01:31:49 +00:00
|
|
|
} // namespace sprout
|
|
|
|
|
|
|
|
#endif // #ifndef SPROUT_CWCHAR_WCSLEN_HPP
|