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