theKernel 10.0
Loading...
Searching...
No Matches
MkKernel_String_C_API

MkKernel PACKAGE - operate on a string as struct of pointer and size … More...

+ Collaboration diagram for MkKernel_String_C_API:

Classes

struct  libmkkernel::MkStringR
 string data default format … More...
 

Functions

static void libmkkernel::MkStringLog_RT (MK_RT mkrt, MkStringR const str, MK_STRN func)
 log the string ...
 
static MkStringR libmkkernel::MkStringCreate (MK_NUM len, MK_STRN str)
 create a str from ptr and len ...
 
static MkStringR libmkkernel::MkStringCreate_1 (MK_STRN str)
 create a str from ptr use MK_NULL as end-of-string ...
 
static MkStringR libmkkernel::MkStringSlice (MkStringR strR, MK_NUM start, MK_NUM len)
 create a slice of strR start at start with max len bytes …
 
static void libmkkernel::MkStringSplit (MkStringR strR, MK_NUM *len_out, MK_STRN *str_out)
 split a str into ptr and len
 
static MkStringR libmkkernel::MkStringDup_RT (MK_RT mkrt, MkStringR const str)
 create a string as duplicate from an already existsing MkBinaryR ...
 
static MK_STRN libmkkernel::MkStringGetData (MkStringR const str)
 get ptr pointer from the string ...
 
static MK_NUM libmkkernel::MkStringGetSize (MkStringR const str)
 get len from the string ...
 
static bool libmkkernel::MkStringIsNULL (MkStringR const strR)
 check if strR is MK_NULL_STR return true or false
 

MkKernel - MkKernel_String_C_API - overload

#define MkString2ATO_NULL(...)
 
#define MkString2ATO(...)
 
#define MkString2BOL_NULL(...)
 
#define MkString2BOL(...)
 
#define MkString2BOOL_NULL(...)
 
#define MkString2BOOL(...)
 
#define MkString2DBL_NULL(...)
 
#define MkString2DBL(...)
 
#define MkString2FLT_NULL(...)
 
#define MkString2FLT(...)
 
#define MkString2HDL_NULL(...)
 
#define MkString2HDL(...)
 
#define MkString2I16_NULL(...)
 
#define MkString2I16(...)
 
#define MkString2I32_NULL(...)
 
#define MkString2I32(...)
 
#define MkString2I64_NULL(...)
 
#define MkString2I64(...)
 
#define MkString2I8_NULL(...)
 
#define MkString2I8(...)
 
#define MkString2LONG_NULL(...)
 
#define MkString2LONG(...)
 
#define MkString2U16_NULL(...)
 
#define MkString2U16(...)
 
#define MkString2U32_NULL(...)
 
#define MkString2U32(...)
 
#define MkStringDup_NULL(...)
 
#define MkStringDup(...)
 
#define MkStringLog_NULL(...)
 
#define MkStringLog(...)
 

Detailed Description

MkKernel PACKAGE - operate on a string as struct of pointer and size …

Attention
In general MkStringR is owned by the called function, to get your own copy use MkStringDup.

Macro Definition Documentation

◆ MkString2ATO

#define MkString2ATO ( ...)
Value:
MkString2ATO_RT(MK_RT_CALL __VA_ARGS__)
#define MK_RT_CALL

Definition at line 1399 of file kernel_overload_mk.h.

◆ MkString2ATO_NULL

#define MkString2ATO_NULL ( ...)
Value:
MkString2ATO_RT(MK_RT_CALL_NULL __VA_ARGS__)
#define MK_RT_CALL_NULL

Definition at line 1398 of file kernel_overload_mk.h.

◆ MkString2BOL

#define MkString2BOL ( ...)
Value:
MkString2BOL_RT(MK_RT_CALL __VA_ARGS__)

Definition at line 1401 of file kernel_overload_mk.h.

◆ MkString2BOL_NULL

#define MkString2BOL_NULL ( ...)
Value:
MkString2BOL_RT(MK_RT_CALL_NULL __VA_ARGS__)

Definition at line 1400 of file kernel_overload_mk.h.

◆ MkString2BOOL

#define MkString2BOOL ( ...)
Value:
MkString2BOOL_RT(MK_RT_CALL __VA_ARGS__)

Definition at line 1403 of file kernel_overload_mk.h.

◆ MkString2BOOL_NULL

#define MkString2BOOL_NULL ( ...)
Value:
MkString2BOOL_RT(MK_RT_CALL_NULL __VA_ARGS__)

Definition at line 1402 of file kernel_overload_mk.h.

◆ MkString2DBL

#define MkString2DBL ( ...)
Value:
MkString2DBL_RT(MK_RT_CALL __VA_ARGS__)

Definition at line 1405 of file kernel_overload_mk.h.

◆ MkString2DBL_NULL

#define MkString2DBL_NULL ( ...)
Value:
MkString2DBL_RT(MK_RT_CALL_NULL __VA_ARGS__)

Definition at line 1404 of file kernel_overload_mk.h.

◆ MkString2FLT

#define MkString2FLT ( ...)
Value:
MkString2FLT_RT(MK_RT_CALL __VA_ARGS__)

Definition at line 1407 of file kernel_overload_mk.h.

◆ MkString2FLT_NULL

#define MkString2FLT_NULL ( ...)
Value:
MkString2FLT_RT(MK_RT_CALL_NULL __VA_ARGS__)

Definition at line 1406 of file kernel_overload_mk.h.

◆ MkString2HDL

#define MkString2HDL ( ...)
Value:
MkString2HDL_RT(MK_RT_CALL __VA_ARGS__)

Definition at line 1409 of file kernel_overload_mk.h.

◆ MkString2HDL_NULL

#define MkString2HDL_NULL ( ...)
Value:
MkString2HDL_RT(MK_RT_CALL_NULL __VA_ARGS__)

Definition at line 1408 of file kernel_overload_mk.h.

◆ MkString2I16

#define MkString2I16 ( ...)
Value:
MkString2I16_RT(MK_RT_CALL __VA_ARGS__)

Definition at line 1411 of file kernel_overload_mk.h.

◆ MkString2I16_NULL

#define MkString2I16_NULL ( ...)
Value:
MkString2I16_RT(MK_RT_CALL_NULL __VA_ARGS__)

Definition at line 1410 of file kernel_overload_mk.h.

◆ MkString2I32

#define MkString2I32 ( ...)
Value:
MkString2I32_RT(MK_RT_CALL __VA_ARGS__)

Definition at line 1413 of file kernel_overload_mk.h.

◆ MkString2I32_NULL

#define MkString2I32_NULL ( ...)
Value:
MkString2I32_RT(MK_RT_CALL_NULL __VA_ARGS__)

Definition at line 1412 of file kernel_overload_mk.h.

◆ MkString2I64

#define MkString2I64 ( ...)
Value:
MkString2I64_RT(MK_RT_CALL __VA_ARGS__)

Definition at line 1415 of file kernel_overload_mk.h.

◆ MkString2I64_NULL

#define MkString2I64_NULL ( ...)
Value:
MkString2I64_RT(MK_RT_CALL_NULL __VA_ARGS__)

Definition at line 1414 of file kernel_overload_mk.h.

◆ MkString2I8

#define MkString2I8 ( ...)
Value:
MkString2I8_RT(MK_RT_CALL __VA_ARGS__)

Definition at line 1417 of file kernel_overload_mk.h.

◆ MkString2I8_NULL

#define MkString2I8_NULL ( ...)
Value:
MkString2I8_RT(MK_RT_CALL_NULL __VA_ARGS__)

Definition at line 1416 of file kernel_overload_mk.h.

◆ MkString2LONG

#define MkString2LONG ( ...)
Value:
MkString2LONG_RT(MK_RT_CALL __VA_ARGS__)

Definition at line 1419 of file kernel_overload_mk.h.

◆ MkString2LONG_NULL

#define MkString2LONG_NULL ( ...)
Value:
MkString2LONG_RT(MK_RT_CALL_NULL __VA_ARGS__)

Definition at line 1418 of file kernel_overload_mk.h.

◆ MkString2U16

#define MkString2U16 ( ...)
Value:
MkString2U16_RT(MK_RT_CALL __VA_ARGS__)

Definition at line 1421 of file kernel_overload_mk.h.

◆ MkString2U16_NULL

#define MkString2U16_NULL ( ...)
Value:
MkString2U16_RT(MK_RT_CALL_NULL __VA_ARGS__)

Definition at line 1420 of file kernel_overload_mk.h.

◆ MkString2U32

#define MkString2U32 ( ...)
Value:
MkString2U32_RT(MK_RT_CALL __VA_ARGS__)

Definition at line 1423 of file kernel_overload_mk.h.

◆ MkString2U32_NULL

#define MkString2U32_NULL ( ...)
Value:
MkString2U32_RT(MK_RT_CALL_NULL __VA_ARGS__)

Definition at line 1422 of file kernel_overload_mk.h.

◆ MkStringDup

#define MkStringDup ( ...)
Value:
MkStringDup_RT(MK_RT_CALL __VA_ARGS__)

Definition at line 1427 of file kernel_overload_mk.h.

◆ MkStringDup_NULL

#define MkStringDup_NULL ( ...)
Value:
MkStringDup_RT(MK_RT_CALL_NULL __VA_ARGS__)

Definition at line 1426 of file kernel_overload_mk.h.

◆ MkStringLog

#define MkStringLog ( ...)
Value:
MkStringLog_RT(MK_RT_CALL __VA_ARGS__)

Definition at line 1429 of file kernel_overload_mk.h.

◆ MkStringLog_NULL

#define MkStringLog_NULL ( ...)
Value:
MkStringLog_RT(MK_RT_CALL_NULL __VA_ARGS__)

Definition at line 1428 of file kernel_overload_mk.h.

Function Documentation

◆ MkStringCreate()

static MkStringR libmkkernel::MkStringCreate ( MK_NUM len,
MK_STRN str )
inlinestatic

create a str from ptr and len ...

Definition at line 1759 of file LibMkKernel_mk.h.

1759 {
1760 return (MkStringR) {(len>0?len:(str?(MK_NUM)strlen(str):0)), str};
1761}
int32_t MK_NUM
array size data-type ('num' items in array …
+ Here is the caller graph for this function:

◆ MkStringCreate_1()

static MkStringR libmkkernel::MkStringCreate_1 ( MK_STRN str)
inlinestatic

create a str from ptr use MK_NULL as end-of-string ...

Definition at line 1765 of file LibMkKernel_mk.h.

1765 {
1766 return (MkStringR) {str?(MK_NUM)strlen(str):0, str};
1767}
+ Here is the caller graph for this function:

◆ MkStringDup_RT()

static MkStringR libmkkernel::MkStringDup_RT ( MK_RT mkrt,
MkStringR const str )
inlinestatic

create a string as duplicate from an already existsing MkBinaryR ...

Definition at line 13583 of file LibMkKernel_mk.h.

13585 {
#define MK_STATIC_RT

◆ MkStringGetData()

static MK_STRN libmkkernel::MkStringGetData ( MkStringR const str)
inlinestatic

get ptr pointer from the string ...

Definition at line 1803 of file LibMkKernel_mk.h.

1803 {
1804 return str.ptr;
1805}
+ Here is the caller graph for this function:

◆ MkStringGetSize()

static MK_NUM libmkkernel::MkStringGetSize ( MkStringR const str)
inlinestatic

get len from the string ...

Definition at line 1809 of file LibMkKernel_mk.h.

1809 {
1810 return str.len;
1811}
+ Here is the caller graph for this function:

◆ MkStringIsNULL()

static bool libmkkernel::MkStringIsNULL ( MkStringR const strR)
inlinestatic

check if strR is MK_NULL_STR return true or false

See also
MK_NULL
Parameters
[in]strRthe string reference to test.
Returns
the a boolean value → true if strR is a MK_NULL_STR.

Definition at line 1820 of file LibMkKernel_mk.h.

1820 {
1821 return ((strR.ptr) && (strR.len) == MK_NULL_STR_LEN && strcmp((strR.ptr),MK_NULL_STR)==0);
1822}
#define MK_NULL_STR
the string "MK_NULL" value as MK_NULL_STR …
#define MK_NULL_STR_LEN
the integer strlen("MK_NULL") value as MK_NULL_STR_LEN …
+ Here is the caller graph for this function:

◆ MkStringLog_RT()

static void libmkkernel::MkStringLog_RT ( MK_RT mkrt,
MkStringR const str,
MK_STRN func )
inlinestatic

log the string ...

Definition at line 13590 of file LibMkKernel_mk.h.

◆ MkStringSlice()

static MkStringR libmkkernel::MkStringSlice ( MkStringR strR,
MK_NUM start,
MK_NUM len )
inlinestatic

create a slice of strR start at start with max len bytes …

Parameters
[in]strRthe string reference to operate on
[in]startthe start-index, will be strR.ptr + start
[in]lenthe size of the new slize, <0 will be to end of string
Returns
The new MkStringR

Definition at line 1778 of file LibMkKernel_mk.h.

1778 {
1779 if (len < 0) len = strR.len;
1780 if (start > strR.len) {
1781 return MkStringCreate(0,NULL);
1782 } else if ((start+len) > strR.len) {
1783 return MkStringCreate(strR.len-start,strR.ptr+start);
1784 } else {
1785 return MkStringCreate(len,strR.ptr+start);
1786 }
1787}
static MkStringR MkStringCreate(MK_NUM len, MK_STRN str)
create a str from ptr and len ...
+ Here is the caller graph for this function:

◆ MkStringSplit()

static void libmkkernel::MkStringSplit ( MkStringR strR,
MK_NUM * len_out,
MK_STRN * str_out )
inlinestatic

split a str into ptr and len

Definition at line 1791 of file LibMkKernel_mk.h.

1791 {
1792 assert(len_out != NULL);
1793 assert(str_out != NULL);
1794 *len_out = strR.len; *str_out = strR.ptr;
1795}
+ Here is the caller graph for this function: