ritsuko
Helper utilities for ArtifactDB C++ code
Loading...
Searching...
No Matches
strnlen.hpp
Go to the documentation of this file.
1#ifndef RITSUKO_STRNLEN_HPP
2#define RITSUKO_STRNLEN_HPP
3
4#include "H5Cpp.h"
5
6#include <cstddef>
7
13namespace ritsuko {
14
23inline std::size_t strnlen(const char* ptr, std::size_t max) {
24 std::size_t j = 0;
25 for (; j < max && ptr[j] != '\0'; ++j) {}
26 return j;
27}
28
29}
30
31#endif
Helper functions for ArtifactDB parsing and validation.
Definition Pointer.hpp:22
std::size_t strnlen(const char *ptr, std::size_t max)
Definition strnlen.hpp:23