API Reference
Classes
| Name | Description |
|---|---|
StringArr |
The StringArr struct, contains an array of strings and the variable holding the number of strings in the array. |
Functions
StringToLower
Converts an input string s in place to all lowercase.
Parameters
| Parameter | Type | Description |
|---|---|---|
s |
char * |
The input string. |
StringToUpper
Converts an input string s in place to all uppercase.
Parameters
| Parameter | Type | Description |
|---|---|---|
s |
char * |
The input string. |
IsCharInString
Checks a string for a specific character.
Returns
true if the character is present, false if not.
Parameters
| Parameter | Type | Description |
|---|---|---|
input_str |
const char * |
The input string. |
checker |
char |
The character to check. |
NumCharInString
Checks a string for a specific character and returns the number of occurences.
Returns
The number of occurences.
Parameters
| Parameter | Type | Description |
|---|---|---|
input_str |
const char * |
The input string. |
checker |
char |
The character to check. |
PutQuotesAroundString
Puts Quotes around a string and returns the new string.
Returns
The new string with quotes around it.
Parameters
| Parameter | Type | Description |
|---|---|---|
input_str |
char * |
The string to duplicate and change. |
free_input |
bool |
If true, will free the input_str for convience |
GetEnv
Looks up an environment variable with an optional fallback.
Returns
A string of the environment variable.
Parameters
| Parameter | Type | Description |
|---|---|---|
name |
char * |
The name of the environment variable to look up. |
fallback |
char * |
The fallback default if the environment variable couldn't be found. |
EveryoneExplodeNow
Creates a StringArr based on an input string and a delimiter. For example, [EveryoneExplodeNow](#everyoneexplodenow)("hello world", ' ') will return ["hello", "world"].
Returns
The StringArr
Parameters
| Parameter | Type | Description |
|---|---|---|
input_str |
char * |
The input string. |
delim |
char |
What character to break the string about from. |
EveryoneExplodeNowHandleQuotes
Creates a StringArr based on an input string and a delimiter. For example, [EveryoneExplodeNow](#everyoneexplodenow)("hello world", ' ') will return ["hello", "world"] but also handle quotes, so delim characters in quotes will not be exploded.
Returns
The StringArr
Parameters
| Parameter | Type | Description |
|---|---|---|
input_str |
char * |
The input string. |
delim |
char |
What character to break the string about from. |
quotes_char |
char |
Which quote character to ignore from. |
FreeStringArr
Free all Strings inside a StringArr and the StringArr itself.
Parameters
| Parameter | Type | Description |
|---|---|---|
string_arr |
StringArr * |
The StringArr to free. |
PrintStringArr
Pretty Print a StringArr for debugging.
Parameters
| Parameter | Type | Description |
|---|---|---|
string_arr |
StringArr * |
The StringArr to print. |
StringArr
The StringArr struct, contains an array of strings and the variable holding the number of strings in the array.
Public Attributes
| Return | Name | Description |
|---|---|---|
int |
num_strings |
The number of strings in the array. |
char ** |
strings |
The array of strings. |
num_strings
The number of strings in the array.
strings
The array of strings.