8 if (destination == source || num == 0) {
16 FW_ASSERT(source + source_len <= destination || destination + num <= source);
18 char* returned = strncpy(destination, source, num);
19 destination[num - 1] =
'\0';
26 for (length = 0; length < buffer_size; length++) {
27 if (source[length] ==
'\0') {
36 const CHAR* sub_string,
42 if ((source_size > 0) && (0 == sub_size)) {
47 if (source_size < sub_size) {
55 source_index < (source_size - sub_size + 1) &&
56 source_index <
static_cast<FwSizeType>(std::numeric_limits<FwSignedSizeType>::max());
59 for (
FwSizeType sub_index = 0; sub_index < sub_size; sub_index++) {
61 FW_ASSERT((source_index + sub_index) < source_size);
63 if (source_string[source_index + sub_index] != sub_string[sub_index]) {
65 }
else if (sub_index == (sub_size - 1)) {
PlatformSignedSizeType FwSignedSizeType
PlatformSizeType FwSizeType
FwSizeType string_length(const CHAR *source, FwSizeType buffer_size)
get the length of the source string
char * string_copy(char *destination, const char *source, FwSizeType num)
copy string with null-termination guaranteed
FwSignedSizeType substring_find(const CHAR *source_string, FwSizeType source_size, const CHAR *sub_string, FwSizeType sub_size)
find the first occurrence of a substring