Str View
Loading...
Searching...
No Matches
SV_Str_view Struct Reference

A read-only view of string data in C. More...

#include <str_view.h>

Detailed Description

A read-only view of string data in C.

It is modeled after the C++ std::string_view. It consists of a pointer to char const data and a size_t field. Therefore, the exact size of this type may be platform dependent but it is small enough that one should use the provided functions and pass by copy whenever possible. Avoid accessing struct fields.

Data Fields

char const * str
 
size_t len
 

Field Documentation

◆ len

size_t SV_Str_view::len

The length, not including the NULL terminator position. However, it is possible that a view is not NULL terminated at that position.

◆ str

char const* SV_Str_view::str

The read only data to which we point.


The documentation for this struct was generated from the following file: