MCPcopy Create free account
hub / github.com/SakuraEngine/SakuraEngine / index_of

Function index_of

modules/core/core/include/OpenString/text_view.h:257–267  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

255 }
256
257 [[nodiscard]] constexpr u64 index_of(const text_view& pattern, const u64 from = 0, const u64 size = SIZE_MAX) const noexcept
258 {
259 if(pattern.is_empty())
260 return global_constant::INDEX_INVALID;
261 u64 raw_from = from; u64 raw_size = size;
262 this->get_codeunit_range(raw_from, raw_size);
263 const u64 found_raw_index = this->view_.index_of(pattern.view_, raw_from, raw_size);
264 if(found_raw_index == global_constant::INDEX_INVALID)
265 return global_constant::INDEX_INVALID;
266 return this->get_codepoint_index(found_raw_index);
267 }
268
269 [[nodiscard]] constexpr u64 index_of(const codepoint& pattern, const u64 from = 0, const u64 size = SIZE_MAX) const noexcept
270 {

Callers

nothing calls this directly

Calls 2

is_emptyMethod · 0.45
index_ofMethod · 0.45

Tested by

no test coverage detected