GNU Radio's DVBS2RX Package
string_view.h File Reference
#include <stdbool.h>
#include <stddef.h>
#include <string.h>
#include "cpu_features_macros.h"
Include dependency graph for string_view.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  StringView
 

Functions

static StringView view (const char *str, const size_t size)
 
static StringView str (const char *str)
 
int CpuFeatures_StringView_IndexOfChar (const StringView view, char c)
 
int CpuFeatures_StringView_IndexOf (const StringView view, const StringView sub_view)
 
bool CpuFeatures_StringView_IsEquals (const StringView a, const StringView b)
 
bool CpuFeatures_StringView_StartsWith (const StringView a, const StringView b)
 
StringView CpuFeatures_StringView_PopFront (const StringView str_view, size_t count)
 
StringView CpuFeatures_StringView_PopBack (const StringView str_view, size_t count)
 
StringView CpuFeatures_StringView_KeepFront (const StringView str_view, size_t count)
 
char CpuFeatures_StringView_Front (const StringView view)
 
char CpuFeatures_StringView_Back (const StringView view)
 
StringView CpuFeatures_StringView_TrimWhitespace (StringView view)
 
int CpuFeatures_StringView_ParsePositiveNumber (const StringView view)
 
void CpuFeatures_StringView_CopyString (const StringView src, char *dst, size_t dst_size)
 
bool CpuFeatures_StringView_HasWord (const StringView line, const char *const word, const char separator)
 
bool CpuFeatures_StringView_GetAttributeKeyValue (const StringView line, StringView *key, StringView *value)
 

Variables

static const StringView kEmptyStringView
 

Function Documentation

◆ CpuFeatures_StringView_Back()

char CpuFeatures_StringView_Back ( const StringView  view)

◆ CpuFeatures_StringView_CopyString()

void CpuFeatures_StringView_CopyString ( const StringView  src,
char *  dst,
size_t  dst_size 
)

◆ CpuFeatures_StringView_Front()

char CpuFeatures_StringView_Front ( const StringView  view)

◆ CpuFeatures_StringView_GetAttributeKeyValue()

bool CpuFeatures_StringView_GetAttributeKeyValue ( const StringView  line,
StringView key,
StringView value 
)

◆ CpuFeatures_StringView_HasWord()

bool CpuFeatures_StringView_HasWord ( const StringView  line,
const char *const  word,
const char  separator 
)

◆ CpuFeatures_StringView_IndexOf()

int CpuFeatures_StringView_IndexOf ( const StringView  view,
const StringView  sub_view 
)

◆ CpuFeatures_StringView_IndexOfChar()

int CpuFeatures_StringView_IndexOfChar ( const StringView  view,
char  c 
)

◆ CpuFeatures_StringView_IsEquals()

bool CpuFeatures_StringView_IsEquals ( const StringView  a,
const StringView  b 
)

◆ CpuFeatures_StringView_KeepFront()

StringView CpuFeatures_StringView_KeepFront ( const StringView  str_view,
size_t  count 
)

◆ CpuFeatures_StringView_ParsePositiveNumber()

int CpuFeatures_StringView_ParsePositiveNumber ( const StringView  view)

◆ CpuFeatures_StringView_PopBack()

StringView CpuFeatures_StringView_PopBack ( const StringView  str_view,
size_t  count 
)

◆ CpuFeatures_StringView_PopFront()

StringView CpuFeatures_StringView_PopFront ( const StringView  str_view,
size_t  count 
)

◆ CpuFeatures_StringView_StartsWith()

bool CpuFeatures_StringView_StartsWith ( const StringView  a,
const StringView  b 
)

◆ CpuFeatures_StringView_TrimWhitespace()

StringView CpuFeatures_StringView_TrimWhitespace ( StringView  view)

◆ str()

static StringView str ( const char *  str)
inlinestatic

References str(), and view().

Referenced by str(), and view().

◆ view()

static StringView view ( const char *  str,
const size_t  size 
)
inlinestatic

References StringView::ptr, StringView::size, str(), and view().

Referenced by str(), and view().

Variable Documentation

◆ kEmptyStringView

const StringView kEmptyStringView
static