2023-03-10 10:32:50 +00:00
|
|
|
// This file is part of noxos and licensed under the MIT open source license
|
2023-01-25 00:42:04 +00:00
|
|
|
|
2023-01-25 11:22:27 +00:00
|
|
|
#ifndef NOX_STRING_H
|
|
|
|
#define NOX_STRING_H
|
2023-01-25 00:42:04 +00:00
|
|
|
|
|
|
|
#include "stdtypes.h"
|
2023-02-12 00:26:41 +00:00
|
|
|
#include <stdarg.h>
|
2023-01-25 00:42:04 +00:00
|
|
|
|
|
|
|
typedef const char* string_t;
|
|
|
|
|
2023-02-11 17:09:35 +00:00
|
|
|
uint32_t string_length (string_t string);
|
|
|
|
bool string_compare (string_t a, string_t b);
|
2023-02-23 23:29:14 +00:00
|
|
|
uint32_t string_find_next (string_t string, char chr);
|
2023-02-26 14:06:44 +00:00
|
|
|
uint32_t string_find_last (string_t string, char chr);
|
2023-02-12 00:26:41 +00:00
|
|
|
|
|
|
|
uint64_t variadic_format_size (string_t string, va_list args);
|
|
|
|
uint64_t format_size (string_t string, ...);
|
|
|
|
void variadic_format (string_t output, string_t string, va_list args);
|
|
|
|
void format (string_t output, string_t string, ...);
|
|
|
|
|
2023-02-11 17:09:35 +00:00
|
|
|
void string_unsigned_dec_to_alpha (string_t string, uint64_t value);
|
|
|
|
void string_dec_to_alpha (string_t string, int64_t value);
|
|
|
|
void string_hex_8bit_to_alpha (string_t string, uint8_t value);
|
|
|
|
void string_hex_16bit_to_alpha (string_t string, uint16_t value);
|
|
|
|
void string_hex_32bit_to_alpha (string_t string, uint32_t value);
|
|
|
|
void string_hex_64bit_to_alpha (string_t string, uint64_t value);
|
|
|
|
void string_bin_to_alpha (string_t string, uint8_t num_bits, uint64_t value);
|
|
|
|
void string_bool_to_alpha (string_t string, bool value);
|
2023-01-25 00:42:04 +00:00
|
|
|
|
2023-03-02 21:53:01 +00:00
|
|
|
bool string_is_char_text (char chr);
|
|
|
|
bool string_is_char_number (char chr);
|
2023-03-02 15:51:20 +00:00
|
|
|
bool string_is_char_alpha (char chr);
|
2023-03-02 21:53:01 +00:00
|
|
|
bool string_is_char_uppercase (char chr);
|
|
|
|
bool string_is_char_lowercase (char chr);
|
2023-03-02 15:51:20 +00:00
|
|
|
|
2023-01-25 11:22:27 +00:00
|
|
|
#endif //NOX_STRING_H
|