nfx-stringutils 1.2.0
Cross-platform C++ string utilities library with validation and manipulation functions
Loading...
Searching...
No Matches
Splitter.h File Reference

Zero-allocation string splitting utilities for high-performance string processing. More...

#include <cstddef>
#include <iterator>
#include <string_view>
#include "nfx/detail/string/Splitter.inl"
Include dependency graph for Splitter.h:

Go to the source code of this file.

Classes

class  nfx::string::Splitter
 Zero-allocation string splitting iterator for performance-critical paths. More...
class  nfx::string::Splitter::Iterator
 Forward iterator for string segments. More...

Functions

template<typename String>
Splitter nfx::string::splitView (String &&str, char delimiter) noexcept
 Templated factory function for zero-copy string splitting.

Detailed Description

Zero-allocation string splitting utilities for high-performance string processing.

Provides efficient string_view-based splitting without heap allocations, perfect for performance-critical paths and CSV parsing applications

Definition in file Splitter.h.

Function Documentation

◆ splitView()

template<typename String>
Splitter nfx::string::splitView ( String && str,
char delimiter )
inlinenodiscardnoexcept

Templated factory function for zero-copy string splitting.

Creates a Splitter for efficient iteration over string segments without heap allocations. Accepts any string-like type that can be converted to std::string_view.

Template Parameters
StringAny type convertible to std::string_view (std::string, const char*, etc.)
Parameters
strString to split
delimiterCharacter to split on
Returns
Splitter object for range-based iteration
Note
This function is marked [[nodiscard]] - the return value should not be ignored