MCPcopy Create free account
hub / github.com/OpenLoco/OpenLoco / nullTerminatedView

Function nullTerminatedView

src/Utility/include/OpenLoco/Utility/String.hpp:133–143  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

131
132 template<size_t N>
133 std::string_view nullTerminatedView(const char (&src)[N])
134 {
135 for (size_t i = 0; i < N; i++)
136 {
137 if (src[i] == '\0')
138 {
139 return std::string_view(src, N);
140 }
141 }
142 return std::string_view(src, N);
143 }
144
145 constexpr std::string_view trim(std::string_view str)
146 {

Callers 1

createNewClientMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected