lv_string.h

Functions

void *lv_memcpy(void *dst, const void *src, size_t len)

Copies a block of memory from a source address to a destination address.

备注

The function does not check for any overlapping of the source and destination memory blocks.

参数:
  • dst -- Pointer to the destination array where the content is to be copied.

  • src -- Pointer to the source of data to be copied.

  • len -- Number of bytes to copy.

返回:

Pointer to the destination array.

void lv_memset(void *dst, uint8_t v, size_t len)

Fills a block of memory with a specified value.

参数:
  • dst -- Pointer to the destination array to fill with the specified value.

  • v -- Value to be set. The value is passed as an int, but the function fills the block of memory using the unsigned char conversion of this value.

  • len -- Number of bytes to be set to the value.

void *lv_memmove(void *dst, const void *src, size_t len)

Move a block of memory from source to destination.

参数:
  • dst -- Pointer to the destination array where the content is to be copied.

  • src -- Pointer to the source of data to be copied.

  • len -- Number of bytes to copy

返回:

Pointer to the destination array.

static inline void lv_memzero(void *dst, size_t len)

Same as memset(dst, 0x00, len).

参数:
  • dst -- pointer to the destination buffer

  • len -- number of byte to set

size_t lv_strlen(const char *str)

Computes the length of the string str up to, but not including the terminating null character.

参数:

str -- Pointer to the null-terminated byte string to be examined.

返回:

The length of the string in bytes.

char *lv_strncpy(char *dst, const char *src, size_t dest_size)

Copies up to dest_size characters from the string pointed to by src to the character array pointed to by dst.

参数:
  • dst -- Pointer to the destination array where the content is to be copied.

  • src -- Pointer to the source of data to be copied.

  • dest_size -- Maximum number of characters to be copied to dst, including the null character.

返回:

A pointer to the destination array, which is dst.

char *lv_strcpy(char *dst, const char *src)

Copies the string pointed to by src, including the terminating null character, to the character array pointed to by dst.

参数:
  • dst -- Pointer to the destination array where the content is to be copied.

  • src -- Pointer to the source of data to be copied.

返回:

A pointer to the destination array, which is dst.

int32_t lv_strcmp(const char *s1, const char *s2)

This function will compare two strings without specified length.

参数:
  • s1 -- pointer to the first string

  • s2 -- pointer to the second string

返回:

the difference between the value of the first unmatching character.

char *lv_strdup(const char *src)

Duplicate a string by allocating a new one and copying the content.

参数:

src -- Pointer to the source of data to be copied.

返回:

A pointer to the new allocated string. NULL if failed.