XDK API  3.6.0
Documentation
Data Structures | Typedefs | Functions
Serval_StringDescr.h File Reference

This module defines a string descriptor type.This interface provides type definitions, data types and functions to handle string descriptors. More...

#include <Serval_Types.h>
+ Include dependency graph for Serval_StringDescr.h:
+ This graph shows which files directly or indirectly include this file:

Data Structures

struct  StringDescr_S
 

Typedefs

typedef struct StringDescr_S StringDescr_T
 

Functions

static char StringDescr_charAt (const StringDescr_T *str_ptr, int pos)
 
static void StringDescr_clone (StringDescr_T *dest_ptr, const StringDescr_T *src_ptr)
 
static void StringDescr_cloneFrom (StringDescr_T *dest_ptr, const StringDescr_T *src_ptr, int pos)
 
static void StringDescr_cloneSegment (StringDescr_T *dest_ptr, const StringDescr_T *src_ptr, int pos, int n)
 
static bool StringDescr_compare (const StringDescr_T *str_ptr, const char *cstr)
 
static bool StringDescr_compareFrom (const StringDescr_T *str_ptr, int pos, const char *cstr)
 
static bool StringDescr_compareFromNoCase (StringDescr_T const *str_ptr, int pos, char const *cstr)
 
static bool StringDescr_compareNoCase (const StringDescr_T *str_ptr, const char *cstr)
 
bool StringDescr_compareSegment (const StringDescr_T *str_ptr, int pos, const char *cstr, int n)
 
bool StringDescr_compareSegmentNoCase (StringDescr_T const *str_ptr, int pos, char const *cstr, int n)
 
static void StringDescr_copy (const StringDescr_T *src_ptr, char *buf_ptr)
 
static void StringDescr_copyFrom (const StringDescr_T *src_ptr, char *buf_ptr, int pos)
 
static void StringDescr_copySegment (const StringDescr_T *src_ptr, char *buf_ptr, int pos, int n)
 
int StringDescr_findFirstChar (const StringDescr_T *str_ptr, int offset, char c)
 
int StringDescr_findLastChar (const StringDescr_T *str_ptr, char c)
 
static void StringDescr_get (const StringDescr_T *str_ptr, const char **start_pptr, int *len_ptr)
 
static int StringDescr_getLength (const StringDescr_T *str_ptr)
 
static bool StringDescr_isValid (const StringDescr_T *str_ptr)
 
static bool StringDescr_parseUInt (const StringDescr_T *str_ptr, uint32_t *value)
 
static void StringDescr_set (StringDescr_T *str_ptr, char const *start_ptr, int len)
 
static void StringDescr_wrap (StringDescr_T *dest_ptr, const char *cstr)
 

Typedef Documentation

typedef struct StringDescr_S StringDescr_T

This structure describes a string by a pointer to the start location and its length.

See also
struct StringDescr_S

Function Documentation

static char StringDescr_charAt ( const StringDescr_T str_ptr,
int  pos 
)
inlinestatic

This function returns the character at a specified position in the string associated with the given instance of string descriptor.

Parameters
[in]str_ptrReference to a StringDescr_T object which identifies the instance of string descriptor been used. It has to be a valid pointer.
[in]posThis will contain starting point of the string when the function returns.
Returns
Character in the given string at the desired position.
static void StringDescr_clone ( StringDescr_T dest_ptr,
const StringDescr_T src_ptr 
)
inlinestatic

This function is called to clone a String Descriptor which means that the description information of src will be cloned to dest. The content characters will not be copied.

Parameters
[out]dest_ptrReference to a StringDescr_T object which identifies the instance of destination string descriptor.
[in]src_ptrReference to a StringDescr_T object which identifies the instance of source string descriptor.
See also
StringDescr_cloneSegment()

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void StringDescr_cloneFrom ( StringDescr_T dest_ptr,
const StringDescr_T src_ptr,
int  pos 
)
inlinestatic

This function is called to clone a String Descriptor which means that the description information of src will be cloned to dest. The clone operation considers only the segment of the source String Descriptor starting at the specified position. The content characters will not be copied.

Parameters
[out]dest_ptrReference to a StringDescr_T object which identifies the instance of destination string descriptor.
[in]src_ptrReference to a StringDescr_T object which identifies the instance of source string descriptor.
[in]posThe start position of the segment of src which the clone operation should consider.

+ Here is the call graph for this function:

static void StringDescr_cloneSegment ( StringDescr_T dest_ptr,
const StringDescr_T src_ptr,
int  pos,
int  n 
)
inlinestatic

This function is called to clone a String Descriptor which means that the description information of src will be cloned to dest. The clone operation considers only a particular segment of the source String Descriptor. The content characters will not be copied.

Parameters
[out]dest_ptrReference to a StringDescr_T object which identifies the instance of destination string descriptor.
[in]src_ptrReference to a StringDescr_T object which identifies the instance of source string descriptor.
[in]posThe start position of the segment of src which the clone operation should consider.
[in]nThe length of the segment of src which the clone operation should consider.

+ Here is the caller graph for this function:

static bool StringDescr_compare ( const StringDescr_T str_ptr,
const char *  cstr 
)
inlinestatic

This function compares a string description with a char string, and returns the result.

Parameters
[in]str_ptrReference to a StringDescr_T object which identifies the instance of string descriptor to be compared.
[in]cstrC string to be compared.
Returns
true if found equal, otherwise false.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static bool StringDescr_compareFrom ( const StringDescr_T str_ptr,
int  pos,
const char *  cstr 
)
inlinestatic

This function compares a string description with a char string at a certain position, and returns the result.

Parameters
[in]str_ptrReference to a StringDescr_T object which identifies the instance of string descriptor to be compared.
[in]posStarting position inside the string description
[in]cstrC string to be compared.
Returns
true if found equal, otherwise false.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static bool StringDescr_compareFromNoCase ( StringDescr_T const *  str_ptr,
int  pos,
char const *  cstr 
)
inlinestatic

This function compares a segment of string description with a char string starting at a certain position, ignoring case, and returns the result.

Parameters
[in]str_ptrReference to a StringDescr_T object which identifies the instance of string descriptor to be compared.
[in]posStarting position inside the string description
[in]cstrC string to be compared.
Returns
true if found equal, otherwise false.
See also
StringDescr_compareSegmentNoCase()

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static bool StringDescr_compareNoCase ( const StringDescr_T str_ptr,
const char *  cstr 
)
inlinestatic

This function compares a segment of string description with a char string starting at a certain position, ignoring case, and returns the result.

Parameters
[in]str_ptrReference to a StringDescr_T object which identifies the instance of string descriptor to be compared.
[in]cstrC string to be compared.
Returns
true if found equal, otherwise false.

+ Here is the call graph for this function:

bool StringDescr_compareSegment ( const StringDescr_T str_ptr,
int  pos,
const char *  cstr,
int  n 
)

This function compares a segment of string description with a string starting at a certain position, and returns the result.

Parameters
[in]str_ptrReference to a StringDescr_T object which identifies the instance of string descriptor to be compared.
[in]posStarting position inside the string description
[in]cstrC string to be compared.
[in]nThe number of characters which should be considered in the comparison
Returns
true if found equal, otherwise false.

+ Here is the caller graph for this function:

bool StringDescr_compareSegmentNoCase ( StringDescr_T const *  str_ptr,
int  pos,
char const *  cstr,
int  n 
)

This function compares a segment of string description with n characters of a string starting at a certain position, ignoring case, and returns the result.

Parameters
[in]str_ptrReference to a StringDescr_T object which identifies the instance of string descriptor to be compared.
[in]posStarting position inside the string description
[in]cstrC string to be compared.
[in]nthe number of character of cstr to be used for the compare
Returns
true if found equal, otherwise false.
See also
StringDescr_compareSegmentNoCase()

+ Here is the caller graph for this function:

static void StringDescr_copy ( const StringDescr_T src_ptr,
char *  buf_ptr 
)
inlinestatic

This function is called to copy the string which is described by a string descriptor into a char buffer.

Parameters
[in]src_ptrReference to a StringDescr_T object which identifies the instance of source string descriptor.
[out]buf_ptrDestination character buffer, This must be valid.

+ Here is the call graph for this function:

static void StringDescr_copyFrom ( const StringDescr_T src_ptr,
char *  buf_ptr,
int  pos 
)
inlinestatic

This function is called to copy the string which is described by a string descriptor into a char buffer from a given offset.

Parameters
[in]src_ptrReference to a StringDescr_T object which identifies the instance of source string descriptor.
[out]buf_ptrDestination character buffer. This must be valid.
[in]posThe position at which the copy operation shout start
See also
StringDescr_copySegment()

+ Here is the call graph for this function:

static void StringDescr_copySegment ( const StringDescr_T src_ptr,
char *  buf_ptr,
int  pos,
int  n 
)
inlinestatic

This function is called to copy a segment of the string described by a string descriptor into a char buffer.

Parameters
[in]src_ptrReference to a StringDescr_T object which identifies the instance of source string descriptor.
[out]buf_ptrDestination character buffer, This must be valid.
[in]posThe position at which the copy operation shout start
[in]nThe number of characters which should be maximally copied.

+ Here is the caller graph for this function:

int StringDescr_findFirstChar ( const StringDescr_T str_ptr,
int  offset,
char  c 
)

This function finds and returns first occurrence of a character inside a String Descriptor.

Parameters
[in]str_ptrReference to a StringDescr_T object which identifies the instance of string descriptor to be searched.
[in]offsetThe position at which the search is starting.
[in]cCharacter to look for.
Returns
Position of the character or -1 if character is not found.
int StringDescr_findLastChar ( const StringDescr_T str_ptr,
char  c 
)

This function finds and returns last occurrence of a character inside a String Descriptor.

Parameters
[in]str_ptrReference to a StringDescr_T object which identifies the instance of string descriptor to be searched.
[in]cCharacter to look for.
Returns
Position of the character or -1 if character is not found.
static void StringDescr_get ( const StringDescr_T str_ptr,
const char **  start_pptr,
int *  len_ptr 
)
inlinestatic

This function is called to fetch start and length associated with the given instance of string descriptor. The function StringDescr_set() should have been called before calling this function.

Parameters
[in]str_ptrReference to a StringDescr_T object which identifies the instance of string descriptor been used. It has to be a valid pointer.
[in]start_pptrThis will contain starting point of the string when the function returns.
[in]len_ptrThis will contain length of the string when the function returns.
static int StringDescr_getLength ( const StringDescr_T str_ptr)
inlinestatic

This function returns the total length of the entire string described by the given String Descriptor.

Parameters
[in]str_ptrReference to a StringDescr_T object which identifies the instance of string descriptor been used. It has to be a valid pointer.
Returns
Total length of the string.
static bool StringDescr_isValid ( const StringDescr_T str_ptr)
inlinestatic

This function checks the state of the string descriptor, and sees if the string descriptor is valid or not.

Parameters
[in]str_ptrReference to a StringDescr_T object which identifies the instance of string descriptor to be checked. It has to be a valid pointer.
Returns
true if string descriptor is valid false if it is not.
static bool StringDescr_parseUInt ( const StringDescr_T str_ptr,
uint32_t *  value 
)
inlinestatic

This function parses the given string descriptor for an unsigned integer. It does not handle leading or trailing characters and will produce an error if those are found.

Parameters
[in]str_ptrReference to a StringDescr_T object which identifies the instance of string descriptor to be compared.
[out]valuethe parsed value
Returns
true if parsing went ok, false otherwise
Since
1.4
static void StringDescr_set ( StringDescr_T str_ptr,
char const *  start_ptr,
int  len 
)
inlinestatic

This function is called to initialize and prepare a instance of string descriptor. This function must be called before a string descriptor is used.

Parameters
[in]str_ptrReference to a StringDescr_T object which identifies the instance of string descriptor to be used. It has to be a valid pointer.
[in]start_ptrThis gives starting point of the string.
[in]lenThis gives length of the string.

+ Here is the caller graph for this function:

static void StringDescr_wrap ( StringDescr_T dest_ptr,
const char *  cstr 
)
inlinestatic

This function is called to record the description information (i.e. start address and length) of the given string in the given String Descriptor. The content characters will not be copied.

Parameters
[in]dest_ptrReference to a StringDescr_T object which identifies the instance of destination string descriptor.
[in]cstrThe string which should be described by the String Descriptor.

All rights reserved. The use is subject to the XDK SDK EULA by Bosch Connected Devices and Solutions GmbH.
This documentation file has been automatically generated on Thu Mar 14 2019 19:12:46 by doxygen 1.8.8