kernel/inc/utils/string.h

37 lines
1.7 KiB
C

// This file is part of noxos and licensed under the MIT open source license
#ifndef NOX_STRING_H
#define NOX_STRING_H
#include "stdtypes.h"
#include <stdarg.h>
typedef const char* string_t;
uint32_t string_length (string_t string);
bool string_compare (string_t a, string_t b);
uint32_t string_find_next (string_t string, char chr);
uint32_t string_find_last (string_t string, char chr);
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, ...);
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);
bool string_is_char_text (char chr);
bool string_is_char_number (char chr);
bool string_is_char_alpha (char chr);
bool string_is_char_uppercase (char chr);
bool string_is_char_lowercase (char chr);
#endif //NOX_STRING_H