added more cstring find and equals functions

This commit is contained in:
herbglitch 2024-06-12 02:54:54 -06:00
parent d173f943ee
commit 4d7ba1cf4e
2 changed files with 53 additions and 3 deletions

View file

@ -87,6 +87,18 @@ uint8_t ARC_String_Equals(ARC_String *first, ARC_String *second);
*/
uint8_t ARC_String_EqualsCString(ARC_String *string, const char *cstring, uint64_t length);
/**
* @brief check if ARC_String and cstring match
*
* @note will use strlen to get the length of the cstring
*
* @param string ARC_string to check
* @param cstring cstring to check
*
* @return 1 if match, 0 if they don't match
*/
uint8_t ARC_String_EqualsCStringWithStrlen(ARC_String *string, const char *cstring);
/**
* @brief check if ARC_String and cstring match
*
@ -156,6 +168,18 @@ uint64_t ARC_String_Find(ARC_String *string, ARC_String *substring);
*/
uint64_t ARC_String_FindCString(ARC_String *string, const char *cstring, uint64_t length);
/**
* @brief takes given cstring and gives position of first matching
*
* @note will use strlen to get the length of the cstring
*
* @param string the string that will be searched
* @param cstring the cstring to find within string
*
* @return ~(uint64_t)0 on error, anything else on success
*/
uint64_t ARC_String_FindCStringWithStrlen(ARC_String *string, const char *cstring);
/**
* @brief takes a given string, and assigns index and length for position of last matching substring
*
@ -167,9 +191,9 @@ uint64_t ARC_String_FindCString(ARC_String *string, const char *cstring, uint64_
uint64_t ARC_String_FindBack(ARC_String *string, ARC_String *substring);
/**
* @brief takes a given string, and assigns index and length for position of last matching substring
* @brief takes a given cstring and give position of last matching
*
* @param string the string that will be searched
* @param string the string that will be searched
* @param cstring the cstring to find within string
* @param length the length of cstring
*
@ -177,6 +201,18 @@ uint64_t ARC_String_FindBack(ARC_String *string, ARC_String *substring);
*/
uint64_t ARC_String_FindBackCString(ARC_String *string, const char *cstring, uint64_t length);
/**
* @brief takes a given cstring and give position of last matching
*
* @note will use strlen to get the length of the cstring
*
* @param string the string that will be searched
* @param cstring the cstring to find within string
*
* @return ~(uint64_t)0 on error, anything else on success
*/
uint64_t ARC_String_FindBackCStringWithStrlen(ARC_String *string, const char *cstring);
/**
* @brief strips the ends based on a given char
*