2023-05-23 18:02:01 +02:00
/**************************************************************************/
/* string.h */
/**************************************************************************/
/* This file is part of: */
2023-05-26 10:58:14 +02:00
/* PANDEMONIUM ENGINE */
/* https://pandemoniumengine.org */
2023-05-23 18:02:01 +02:00
/**************************************************************************/
/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */
/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
/* "Software"), to deal in the Software without restriction, including */
/* without limitation the rights to use, copy, modify, merge, publish, */
/* distribute, sublicense, and/or sell copies of the Software, and to */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions: */
/* */
/* The above copyright notice and this permission notice shall be */
/* included in all copies or substantial portions of the Software. */
/* */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
# ifndef GDNATIVE_STRING_H
# define GDNATIVE_STRING_H
# ifdef __cplusplus
extern " C " {
# endif
# include <stdint.h>
2023-05-25 21:29:02 +02:00
//#include <wchar.h>
# include <uchar.h>
2023-05-23 18:02:01 +02:00
2023-05-26 10:58:14 +02:00
typedef char32_t pandemonium_char_type ;
2023-05-23 18:02:01 +02:00
2023-05-26 10:58:14 +02:00
# define PANDEMONIUM_STRING_SIZE sizeof(void *)
# define PANDEMONIUM_CHAR_STRING_SIZE sizeof(void *)
2023-05-26 18:45:55 +02:00
# define PANDEMONIUM_CHAR_16_STRING_SIZE sizeof(char16_t)
2023-05-23 18:02:01 +02:00
2023-05-26 10:58:14 +02:00
# ifndef PANDEMONIUM_CORE_API_PANDEMONIUM_STRING_TYPE_DEFINED
# define PANDEMONIUM_CORE_API_PANDEMONIUM_STRING_TYPE_DEFINED
2023-05-23 18:02:01 +02:00
typedef struct {
2023-05-26 10:58:14 +02:00
uint8_t _dont_touch_that [ PANDEMONIUM_STRING_SIZE ] ;
} pandemonium_string ;
2023-05-23 18:02:01 +02:00
# endif
2023-05-26 10:58:14 +02:00
# ifndef PANDEMONIUM_CORE_API_PANDEMONIUM_CHAR_STRING_TYPE_DEFINED
# define PANDEMONIUM_CORE_API_PANDEMONIUM_CHAR_STRING_TYPE_DEFINED
2023-05-23 18:02:01 +02:00
typedef struct {
2023-05-26 10:58:14 +02:00
uint8_t _dont_touch_that [ PANDEMONIUM_CHAR_STRING_SIZE ] ;
} pandemonium_char_string ;
2023-05-23 18:02:01 +02:00
# endif
2023-05-26 18:45:55 +02:00
# ifndef PANDEMONIUM_CORE_API_PANDEMONIUM_CHAR_16_STRING_TYPE_DEFINED
# define PANDEMONIUM_CORE_API_PANDEMONIUM_CHAR_16_STRING_TYPE_DEFINED
typedef struct {
uint8_t _dont_touch_that [ PANDEMONIUM_CHAR_16_STRING_SIZE ] ;
} pandemonium_char_16_string ;
# endif
2023-05-23 18:02:01 +02:00
// reduce extern "C" nesting for VS2013
# ifdef __cplusplus
}
# endif
2023-05-25 21:54:24 +02:00
# include <gdn/array.h>
# include <gdn/gdnative.h>
# include <gdn/variant.h>
2023-05-23 18:02:01 +02:00
# ifdef __cplusplus
extern " C " {
# endif
2023-05-26 18:45:55 +02:00
//=== Char16String ===
2023-05-30 01:26:42 +02:00
//_FORCE_INLINE_ int size() const ;
//Error resize(int p_size) ;
2023-05-26 18:45:55 +02:00
2023-05-30 01:26:42 +02:00
//_FORCE_INLINE_ char get(int p_index) const;
//_FORCE_INLINE_ void set(int p_index, const char &p_elem);
2023-05-26 18:45:55 +02:00
2023-05-30 01:26:42 +02:00
//_FORCE_INLINE_ void operator=(const CharString &p_str);
//void operator_equals(const char *p_cstr);
//bool operator_less(const CharString &p_right) const;
2023-05-26 18:45:55 +02:00
//CharString &operator+=(char p_char);
//pandemonium_int GDAPI pandemonium_char_string_length(const pandemonium_char_string *p_cs);
//const char GDAPI *pandemonium_char_string_get_data(const pandemonium_char_string *p_cs);
//_FORCE_INLINE_ CharString() {}
2023-05-30 01:26:42 +02:00
//_FORCE_INLINE_ CharString(const CharString &p_str) ;
//_FORCE_INLINE_ CharString(const char *p_cstr);
2023-05-26 18:45:55 +02:00
//void GDAPI pandemonium_char_string_destroy(pandemonium_char_string *p_cs);
//=== CharString ===
2023-05-30 01:26:42 +02:00
//_FORCE_INLINE_ int size() const ;
2023-05-26 18:45:55 +02:00
//Error resize(int p_size) {
2023-05-30 01:26:42 +02:00
//_FORCE_INLINE_ char get(int p_index) const ;
//_FORCE_INLINE_ void set(int p_index, const char &p_elem);
2023-05-26 18:45:55 +02:00
2023-05-30 01:26:42 +02:00
//_FORCE_INLINE_ void operator=(const CharString &p_str);
2023-05-26 18:45:55 +02:00
//void operator=(const char *p_cstr);
//bool operator<(const CharString &p_right) const;
//CharString &operator+=(char p_char);
2023-05-26 10:58:14 +02:00
pandemonium_int GDAPI pandemonium_char_string_length ( const pandemonium_char_string * p_cs ) ;
const char GDAPI * pandemonium_char_string_get_data ( const pandemonium_char_string * p_cs ) ;
2023-05-26 18:45:55 +02:00
2023-05-30 01:26:42 +02:00
//_FORCE_INLINE_ CharString() ;
//_FORCE_INLINE_ CharString(const CharString &p_str);
2023-05-26 18:45:55 +02:00
//_FORCE_INLINE_ CharString(const char *p_cstr) { copy_from(p_cstr); }
2023-05-26 10:58:14 +02:00
void GDAPI pandemonium_char_string_destroy ( pandemonium_char_string * p_cs ) ;
2023-05-23 18:02:01 +02:00
2023-05-26 18:45:55 +02:00
//=== String ===
2023-05-30 01:26:42 +02:00
void GDAPI pandemonium_string_remove ( pandemonium_string * p_self , pandemonium_int p_index ) ;
2023-05-26 18:45:55 +02:00
2023-05-30 01:26:42 +02:00
void GDAPI pandemonium_string_clear ( pandemonium_string * p_self ) ;
2023-05-26 18:45:55 +02:00
2023-05-30 01:26:42 +02:00
pandemonium_char_type GDAPI pandemonium_string_get ( const pandemonium_string * p_self , pandemonium_int p_index ) ;
void GDAPI pandemonium_string_set ( pandemonium_string * p_self , pandemonium_int p_index , const pandemonium_char_type p_elem ) ;
2023-05-26 18:45:55 +02:00
2023-05-30 01:26:42 +02:00
pandemonium_int GDAPI pandemonium_string_size ( const pandemonium_string * p_self ) ;
pandemonium_int GDAPI pandemonium_string_resize ( pandemonium_string * p_self , pandemonium_int p_size ) ;
pandemonium_int GDAPI pandemonium_string_set_length ( pandemonium_string * p_self , pandemonium_int p_length ) ;
2023-05-23 18:02:01 +02:00
2023-05-26 10:58:14 +02:00
const char32_t GDAPI * pandemonium_string_operator_index ( pandemonium_string * p_self , const pandemonium_int p_idx ) ;
char32_t GDAPI pandemonium_string_operator_index_const ( const pandemonium_string * p_self , const pandemonium_int p_idx ) ;
2023-05-23 18:02:01 +02:00
2023-05-26 10:58:14 +02:00
pandemonium_bool GDAPI pandemonium_string_operator_equal ( const pandemonium_string * p_self , const pandemonium_string * p_b ) ;
pandemonium_bool GDAPI pandemonium_string_operator_less ( const pandemonium_string * p_self , const pandemonium_string * p_b ) ;
pandemonium_string GDAPI pandemonium_string_operator_plus ( const pandemonium_string * p_self , const pandemonium_string * p_b ) ;
2023-05-23 18:02:01 +02:00
2023-05-26 18:45:55 +02:00
signed char GDAPI pandemonium_string_casecmp_to ( const pandemonium_string * p_self , const pandemonium_string * p_str ) ;
signed char GDAPI pandemonium_string_nocasecmp_to ( const pandemonium_string * p_self , const pandemonium_string * p_str ) ;
signed char GDAPI pandemonium_string_naturalnocasecmp_to ( const pandemonium_string * p_self , const pandemonium_string * p_str ) ;
2023-05-30 01:26:42 +02:00
const char32_t GDAPI * pandemonium_string_get_data ( const pandemonium_string * p_self ) ;
2023-05-23 18:02:01 +02:00
2023-05-26 10:58:14 +02:00
pandemonium_int GDAPI pandemonium_string_length ( const pandemonium_string * p_self ) ;
2023-05-30 01:26:42 +02:00
pandemonium_bool GDAPI pandemonium_string_is_valid_string ( const pandemonium_string * p_self ) ;
2023-05-23 18:02:01 +02:00
2023-05-30 01:26:42 +02:00
void GDAPI pandemonium_string_print_unicode_error ( const pandemonium_string * p_self , const pandemonium_string * p_message , pandemonium_bool p_critical ) ;
2023-05-23 18:02:01 +02:00
2023-05-26 18:45:55 +02:00
pandemonium_string GDAPI pandemonium_string_substr ( const pandemonium_string * p_self , pandemonium_int p_from , pandemonium_int p_chars ) ;
2023-05-30 01:26:42 +02:00
pandemonium_string GDAPI pandemonium_string_substr_index ( const pandemonium_string * p_self , const pandemonium_int p_start_index , const pandemonium_int p_end_index ) ;
2023-05-26 10:58:14 +02:00
pandemonium_int GDAPI pandemonium_string_find ( const pandemonium_string * p_self , pandemonium_string p_what ) ;
pandemonium_int GDAPI pandemonium_string_find_from ( const pandemonium_string * p_self , pandemonium_string p_what , pandemonium_int p_from ) ;
2023-05-30 01:26:42 +02:00
pandemonium_int GDAPI pandemonium_string_findc ( const pandemonium_string * p_self , const char * p_str ) ;
pandemonium_int GDAPI pandemonium_string_findc_from ( const pandemonium_string * p_self , const char * p_str , pandemonium_int p_from ) ;
pandemonium_int GDAPI pandemonium_string_find_char ( const pandemonium_string * p_self , const pandemonium_char_type p_char ) ;
pandemonium_int GDAPI pandemonium_string_find_char_from ( const pandemonium_string * p_self , const pandemonium_char_type p_char , pandemonium_int p_from ) ;
2023-05-26 18:45:55 +02:00
pandemonium_int GDAPI pandemonium_string_find_last ( const pandemonium_string * p_self , pandemonium_string p_what ) ;
pandemonium_int GDAPI pandemonium_string_findn ( const pandemonium_string * p_self , pandemonium_string p_what ) ;
pandemonium_int GDAPI pandemonium_string_findn_from ( const pandemonium_string * p_self , pandemonium_string p_what , pandemonium_int p_from ) ;
pandemonium_int GDAPI pandemonium_string_rfind ( const pandemonium_string * p_self , pandemonium_string p_what ) ;
pandemonium_int GDAPI pandemonium_string_rfindn ( const pandemonium_string * p_self , pandemonium_string p_what ) ;
pandemonium_int GDAPI pandemonium_string_rfind_from ( const pandemonium_string * p_self , pandemonium_string p_what , pandemonium_int p_from ) ;
pandemonium_int GDAPI pandemonium_string_rfindn_from ( const pandemonium_string * p_self , pandemonium_string p_what , pandemonium_int p_from ) ;
2023-05-26 10:58:14 +02:00
pandemonium_int GDAPI pandemonium_string_findmk ( const pandemonium_string * p_self , const pandemonium_array * p_keys ) ;
pandemonium_int GDAPI pandemonium_string_findmk_from ( const pandemonium_string * p_self , const pandemonium_array * p_keys , pandemonium_int p_from ) ;
pandemonium_int GDAPI pandemonium_string_findmk_from_in_place ( const pandemonium_string * p_self , const pandemonium_array * p_keys , pandemonium_int p_from , pandemonium_int * r_key ) ;
2023-05-30 01:26:42 +02:00
pandemonium_int GDAPI pandemonium_string_find_first_difference_index ( const pandemonium_string * p_self , const pandemonium_string * p_str ) ;
2023-05-26 18:45:55 +02:00
2023-05-30 01:26:42 +02:00
pandemonium_bool GDAPI pandemonium_string_is_word_atc ( const pandemonium_string * p_self , const pandemonium_int p_index , const char * p_str ) ;
pandemonium_bool GDAPI pandemonium_string_is_word_at ( const pandemonium_string * p_self , const pandemonium_int p_index , const pandemonium_string * p_str ) ;
2023-05-26 18:45:55 +02:00
pandemonium_bool GDAPI pandemonium_string_match ( const pandemonium_string * p_self , const pandemonium_string * p_wildcard ) ;
pandemonium_bool GDAPI pandemonium_string_matchn ( const pandemonium_string * p_self , const pandemonium_string * p_wildcard ) ;
pandemonium_bool GDAPI pandemonium_string_begins_with ( const pandemonium_string * p_self , const pandemonium_string * p_string ) ;
pandemonium_bool GDAPI pandemonium_string_begins_with_char_array ( const pandemonium_string * p_self , const char * p_char_array ) ;
pandemonium_bool GDAPI pandemonium_string_ends_with ( const pandemonium_string * p_self , const pandemonium_string * p_string ) ;
2023-05-30 01:26:42 +02:00
pandemonium_bool GDAPI pandemonium_string_is_enclosed_in ( const pandemonium_string * p_self , const pandemonium_string * p_string ) ;
2023-05-26 18:45:55 +02:00
pandemonium_bool GDAPI pandemonium_string_is_subsequence_of ( const pandemonium_string * p_self , const pandemonium_string * p_string ) ;
pandemonium_bool GDAPI pandemonium_string_is_subsequence_ofi ( const pandemonium_string * p_self , const pandemonium_string * p_string ) ;
2023-05-30 01:26:42 +02:00
pandemonium_bool GDAPI pandemonium_string_is_quoted ( const pandemonium_string * p_self ) ;
2023-05-26 18:45:55 +02:00
pandemonium_array GDAPI pandemonium_string_bigrams ( const pandemonium_string * p_self ) ;
pandemonium_real GDAPI pandemonium_string_similarity ( const pandemonium_string * p_self , const pandemonium_string * p_string ) ;
2023-05-26 10:58:14 +02:00
pandemonium_string GDAPI pandemonium_string_format ( const pandemonium_string * p_self , const pandemonium_variant * p_values ) ;
pandemonium_string GDAPI pandemonium_string_format_with_custom_placeholder ( const pandemonium_string * p_self , const pandemonium_variant * p_values , const char * p_placeholder ) ;
2023-05-26 18:45:55 +02:00
pandemonium_string GDAPI pandemonium_string_replace_first ( const pandemonium_string * p_self , pandemonium_string p_key , pandemonium_string p_with ) ;
pandemonium_string GDAPI pandemonium_string_replace ( const pandemonium_string * p_self , pandemonium_string p_key , pandemonium_string p_with ) ;
//String replace(const char *p_key, const char *p_with) const;
pandemonium_string GDAPI pandemonium_string_replacen ( const pandemonium_string * p_self , pandemonium_string p_key , pandemonium_string p_with ) ;
2023-05-30 01:26:42 +02:00
pandemonium_string GDAPI pandemonium_string_newline_to_br ( const pandemonium_string * p_self ) ;
2023-05-26 18:45:55 +02:00
2023-05-30 01:26:42 +02:00
pandemonium_string GDAPI pandemonium_string_repeat ( const pandemonium_string * p_self , pandemonium_int p_count ) ;
2023-05-26 10:58:14 +02:00
pandemonium_string GDAPI pandemonium_string_insert ( const pandemonium_string * p_self , pandemonium_int p_at_pos , pandemonium_string p_string ) ;
2023-05-26 18:45:55 +02:00
pandemonium_string GDAPI pandemonium_string_pad_decimals ( const pandemonium_string * p_self , pandemonium_int p_digits ) ;
pandemonium_string GDAPI pandemonium_string_pad_zeros ( const pandemonium_string * p_self , pandemonium_int p_digits ) ;
pandemonium_string GDAPI pandemonium_string_trim_prefix ( const pandemonium_string * p_self , const pandemonium_string * p_prefix ) ;
pandemonium_string GDAPI pandemonium_string_trim_suffix ( const pandemonium_string * p_self , const pandemonium_string * p_suffix ) ;
2023-05-26 10:58:14 +02:00
pandemonium_string GDAPI pandemonium_string_lpad ( const pandemonium_string * p_self , pandemonium_int p_min_length ) ;
pandemonium_string GDAPI pandemonium_string_lpad_with_custom_character ( const pandemonium_string * p_self , pandemonium_int p_min_length , const pandemonium_string * p_character ) ;
2023-05-26 18:45:55 +02:00
pandemonium_string GDAPI pandemonium_string_rpad ( const pandemonium_string * p_self , pandemonium_int p_min_length ) ;
pandemonium_string GDAPI pandemonium_string_rpad_with_custom_character ( const pandemonium_string * p_self , pandemonium_int p_min_length , const pandemonium_string * p_character ) ;
pandemonium_string GDAPI pandemonium_string_sprintf ( const pandemonium_string * p_self , const pandemonium_array * p_values , pandemonium_bool * p_error ) ;
2023-05-30 01:26:42 +02:00
pandemonium_string GDAPI pandemonium_string_quote ( const pandemonium_string * p_self ) ;
pandemonium_string GDAPI pandemonium_string_quote_quotechar ( const pandemonium_string * p_self , pandemonium_string * p_quotechar ) ;
pandemonium_string GDAPI pandemonium_string_unquote ( const pandemonium_string * p_self ) ;
2023-05-26 18:45:55 +02:00
2023-05-26 10:58:14 +02:00
pandemonium_string GDAPI pandemonium_string_num ( double p_num ) ;
2023-05-26 18:45:55 +02:00
pandemonium_string GDAPI pandemonium_string_num_with_decimals ( double p_num , pandemonium_int p_decimals ) ;
pandemonium_string GDAPI pandemonium_string_num_scientific ( double p_num ) ;
pandemonium_string GDAPI pandemonium_string_num_real ( double p_num ) ;
2023-05-26 10:58:14 +02:00
pandemonium_string GDAPI pandemonium_string_num_int64 ( int64_t p_num , pandemonium_int p_base ) ;
pandemonium_string GDAPI pandemonium_string_num_int64_capitalized ( int64_t p_num , pandemonium_int p_base , pandemonium_bool p_capitalize_hex ) ;
pandemonium_string GDAPI pandemonium_string_num_uint64 ( uint64_t p_num , pandemonium_int p_base ) ;
pandemonium_string GDAPI pandemonium_string_num_uint64_capitalized ( uint64_t p_num , pandemonium_int p_base , pandemonium_bool p_capitalize_hex ) ;
2023-05-26 18:45:55 +02:00
pandemonium_string GDAPI pandemonium_string_chr ( wchar_t p_character ) ;
pandemonium_string GDAPI pandemonium_string_md5 ( const uint8_t * p_md5 ) ;
pandemonium_string GDAPI pandemonium_string_hex_encode_buffer ( const uint8_t * p_buffer , pandemonium_int p_len ) ;
//static String bool_num(bool p_val);
//static String bool_str(bool p_val);
pandemonium_bool GDAPI pandemonium_string_is_numeric ( const pandemonium_string * p_self ) ;
2023-05-30 01:26:42 +02:00
pandemonium_bool GDAPI pandemonium_string_is_zero ( const pandemonium_string * p_self ) ;
2023-05-26 18:45:55 +02:00
2023-05-26 10:58:14 +02:00
double GDAPI pandemonium_string_to_double ( const pandemonium_string * p_self ) ;
pandemonium_real GDAPI pandemonium_string_to_float ( const pandemonium_string * p_self ) ;
pandemonium_int GDAPI pandemonium_string_to_int ( const pandemonium_string * p_self ) ;
2023-05-30 01:26:42 +02:00
pandemonium_bool GDAPI pandemonium_string_to_bool ( const pandemonium_string * p_self ) ;
uint32_t GDAPI pandemonium_string_to_uint ( const pandemonium_string * p_self ) ;
2023-05-26 10:58:14 +02:00
2023-05-26 18:45:55 +02:00
pandemonium_int GDAPI pandemonium_string_hex_to_int ( const pandemonium_string * p_self ) ;
pandemonium_int GDAPI pandemonium_string_hex_to_int_without_prefix ( const pandemonium_string * p_self ) ;
2023-05-26 10:58:14 +02:00
int64_t GDAPI pandemonium_string_hex_to_int64 ( const pandemonium_string * p_self ) ;
int64_t GDAPI pandemonium_string_hex_to_int64_with_prefix ( const pandemonium_string * p_self ) ;
int64_t GDAPI pandemonium_string_to_int64 ( const pandemonium_string * p_self ) ;
2023-05-26 18:45:55 +02:00
pandemonium_int GDAPI pandemonium_string_char_to_int ( const char * p_what ) ;
pandemonium_int GDAPI pandemonium_string_char_to_int_with_len ( const char * p_what , pandemonium_int p_len ) ;
int64_t GDAPI pandemonium_string_wchar_to_int ( const wchar_t * p_str ) ;
int64_t GDAPI pandemonium_string_char_to_int64_with_len ( const wchar_t * p_str , int p_len ) ;
//static int64_t to_int(const CharType *p_str, int p_len = -1, bool p_clamp = false);
//static double to_float(const char *p_str);
//static double to_float(const wchar_t *p_str, const wchar_t **r_end = nullptr);
//static double to_float(const CharType *p_str, const CharType **r_end = nullptr);
double GDAPI pandemonium_string_char_to_double ( const char * p_what ) ;
2023-05-26 10:58:14 +02:00
double GDAPI pandemonium_string_unicode_char_to_double ( const wchar_t * p_str , const wchar_t * * r_end ) ;
2023-05-30 01:26:42 +02:00
double GDAPI pandemonium_string_pandemonium_char_to_double ( const pandemonium_char_type * p_str , const pandemonium_char_type * * r_end ) ;
2023-05-26 18:45:55 +02:00
//static uint32_t num_characters(int64_t p_int);
pandemonium_string GDAPI pandemonium_string_capitalize ( const pandemonium_string * p_self ) ;
pandemonium_string GDAPI pandemonium_string_camelcase_to_underscore ( const pandemonium_string * p_self ) ;
pandemonium_string GDAPI pandemonium_string_camelcase_to_underscore_lowercased ( const pandemonium_string * p_self ) ;
2023-05-26 10:58:14 +02:00
2023-05-30 01:26:42 +02:00
pandemonium_string GDAPI pandemonium_string_get_with_code_lines ( const pandemonium_string * p_self ) ;
2023-05-26 10:58:14 +02:00
pandemonium_int GDAPI pandemonium_string_get_slice_count ( const pandemonium_string * p_self , pandemonium_string p_splitter ) ;
pandemonium_string GDAPI pandemonium_string_get_slice ( const pandemonium_string * p_self , pandemonium_string p_splitter , pandemonium_int p_slice ) ;
pandemonium_string GDAPI pandemonium_string_get_slicec ( const pandemonium_string * p_self , wchar_t p_splitter , pandemonium_int p_slice ) ;
pandemonium_array GDAPI pandemonium_string_split ( const pandemonium_string * p_self , const pandemonium_string * p_splitter ) ;
pandemonium_array GDAPI pandemonium_string_split_allow_empty ( const pandemonium_string * p_self , const pandemonium_string * p_splitter ) ;
2023-05-26 18:45:55 +02:00
//Vector<String> split(const String &p_splitter, bool p_allow_empty = true, int p_maxsplit = 0) const; // p_maxsplit variant
pandemonium_pool_string_array GDAPI pandemonium_string_rsplit ( const pandemonium_string * p_self , const pandemonium_string * p_divisor , const pandemonium_bool p_allow_empty , const pandemonium_int p_maxsplit ) ;
//Vector<String> rsplit(const String &p_splitter, bool p_allow_empty = true, int p_maxsplit = 0) const; //p_allow_empty, p_maxsplit variant
pandemonium_array GDAPI pandemonium_string_split_spaces ( const pandemonium_string * p_self ) ;
2023-05-26 10:58:14 +02:00
pandemonium_array GDAPI pandemonium_string_split_floats ( const pandemonium_string * p_self , const pandemonium_string * p_splitter ) ;
pandemonium_array GDAPI pandemonium_string_split_floats_allows_empty ( const pandemonium_string * p_self , const pandemonium_string * p_splitter ) ;
pandemonium_array GDAPI pandemonium_string_split_floats_mk ( const pandemonium_string * p_self , const pandemonium_array * p_splitters ) ;
pandemonium_array GDAPI pandemonium_string_split_floats_mk_allows_empty ( const pandemonium_string * p_self , const pandemonium_array * p_splitters ) ;
pandemonium_array GDAPI pandemonium_string_split_ints ( const pandemonium_string * p_self , const pandemonium_string * p_splitter ) ;
pandemonium_array GDAPI pandemonium_string_split_ints_allows_empty ( const pandemonium_string * p_self , const pandemonium_string * p_splitter ) ;
pandemonium_array GDAPI pandemonium_string_split_ints_mk ( const pandemonium_string * p_self , const pandemonium_array * p_splitters ) ;
pandemonium_array GDAPI pandemonium_string_split_ints_mk_allows_empty ( const pandemonium_string * p_self , const pandemonium_array * p_splitters ) ;
pandemonium_string GDAPI pandemonium_string_join ( const pandemonium_string * p_self , const pandemonium_array * p_parts ) ;
2023-05-30 01:26:42 +02:00
pandemonium_char_type GDAPI pandemonium_string_char_uppercase ( pandemonium_char_type p_char ) ;
pandemonium_char_type GDAPI pandemonium_string_char_lowercase ( pandemonium_char_type p_char ) ;
2023-05-26 10:58:14 +02:00
pandemonium_string GDAPI pandemonium_string_to_upper ( const pandemonium_string * p_self ) ;
2023-05-26 18:45:55 +02:00
pandemonium_string GDAPI pandemonium_string_to_lower ( const pandemonium_string * p_self ) ;
pandemonium_int GDAPI pandemonium_string_count ( const pandemonium_string * p_self , pandemonium_string p_what , pandemonium_int p_from , pandemonium_int p_to ) ;
pandemonium_int GDAPI pandemonium_string_countn ( const pandemonium_string * p_self , pandemonium_string p_what , pandemonium_int p_from , pandemonium_int p_to ) ;
2023-05-26 10:58:14 +02:00
pandemonium_string GDAPI pandemonium_string_left ( const pandemonium_string * p_self , pandemonium_int p_pos ) ;
pandemonium_string GDAPI pandemonium_string_right ( const pandemonium_string * p_self , pandemonium_int p_pos ) ;
2023-05-30 01:26:42 +02:00
pandemonium_string GDAPI pandemonium_string_indent ( const pandemonium_string * p_self , const pandemonium_string * p_prefix ) ;
2023-05-26 18:45:55 +02:00
pandemonium_string GDAPI pandemonium_string_dedent ( const pandemonium_string * p_self ) ;
pandemonium_string GDAPI pandemonium_string_strip_edges ( const pandemonium_string * p_self , pandemonium_bool p_left , pandemonium_bool p_right ) ; // left, right variant //String strip_edges(bool left = true, bool right = true) const;
2023-05-26 10:58:14 +02:00
pandemonium_string GDAPI pandemonium_string_strip_escapes ( const pandemonium_string * p_self ) ;
2023-05-30 01:26:42 +02:00
pandemonium_string GDAPI pandemonium_string_lstrip ( const pandemonium_string * p_self , const pandemonium_string * p_chars ) ;
2023-05-26 18:45:55 +02:00
pandemonium_string GDAPI pandemonium_string_rstrip ( const pandemonium_string * p_self , const pandemonium_string * p_chars ) ;
pandemonium_string GDAPI pandemonium_string_get_extension ( const pandemonium_string * p_self ) ;
pandemonium_string GDAPI pandemonium_string_get_basename ( const pandemonium_string * p_self ) ;
pandemonium_string GDAPI pandemonium_string_plus_file ( const pandemonium_string * p_self , const pandemonium_string * p_file ) ;
2023-05-30 01:26:42 +02:00
pandemonium_char_type GDAPI pandemonium_string_unicode_at ( const pandemonium_string * p_self , pandemonium_int p_idx ) ;
pandemonium_char_type GDAPI pandemonium_string_ord_at ( const pandemonium_string * p_self , pandemonium_int p_idx ) ;
2023-05-26 10:58:14 +02:00
void GDAPI pandemonium_string_erase ( pandemonium_string * p_self , pandemonium_int p_pos , pandemonium_int p_chars ) ;
pandemonium_char_string GDAPI pandemonium_string_ascii ( const pandemonium_string * p_self ) ;
pandemonium_char_string GDAPI pandemonium_string_ascii_extended ( const pandemonium_string * p_self ) ;
pandemonium_char_string GDAPI pandemonium_string_utf8 ( const pandemonium_string * p_self ) ;
pandemonium_bool GDAPI pandemonium_string_parse_utf8 ( pandemonium_string * p_self , const char * p_utf8 ) ;
2023-05-26 18:45:55 +02:00
pandemonium_bool GDAPI pandemonium_string_parse_utf8_with_len ( pandemonium_string * p_self , const char * p_utf8 , pandemonium_int p_len ) ; // p_skip_cr variant //Error parse_utf8(const char *p_utf8, int p_len = -1, bool p_skip_cr = false); //return true on error
2023-05-26 10:58:14 +02:00
pandemonium_string GDAPI pandemonium_string_chars_to_utf8 ( const char * p_utf8 ) ;
pandemonium_string GDAPI pandemonium_string_chars_to_utf8_with_len ( const char * p_utf8 , pandemonium_int p_len ) ;
2023-05-30 01:26:42 +02:00
pandemonium_int GDAPI pandemonium_string_utf8_byte_length ( const pandemonium_string * p_self ) ;
2023-05-26 18:45:55 +02:00
//Char16String utf16() const;
//Error parse_utf16(const char16_t *p_utf16, int p_len = -1);
//static String utf16(const char16_t *p_utf16, int p_len = -1);
//int utf16_byte_length() const;
2023-05-26 10:58:14 +02:00
uint32_t GDAPI pandemonium_string_hash_chars ( const char * p_cstr ) ;
uint32_t GDAPI pandemonium_string_hash_chars_with_len ( const char * p_cstr , pandemonium_int p_len ) ;
2023-05-26 18:45:55 +02:00
uint32_t GDAPI pandemonium_string_hash_utf8_chars ( const wchar_t * p_str ) ; // rename to pandemonium_string_hash_wchars, use its name as the missin?
2023-05-26 10:58:14 +02:00
uint32_t GDAPI pandemonium_string_hash_utf8_chars_with_len ( const wchar_t * p_str , pandemonium_int p_len ) ;
2023-05-30 01:26:42 +02:00
uint32_t GDAPI pandemonium_string_hashc ( const pandemonium_char_type * p_cstr ) ;
uint32_t GDAPI pandemonium_string_hashc_with_len ( const pandemonium_char_type * p_cstr , pandemonium_int p_len ) ;
2023-05-26 18:45:55 +02:00
uint32_t GDAPI pandemonium_string_hash ( const pandemonium_string * p_self ) ;
uint64_t GDAPI pandemonium_string_hash64 ( const pandemonium_string * p_self ) ;
2023-05-26 10:58:14 +02:00
pandemonium_string GDAPI pandemonium_string_md5_text ( const pandemonium_string * p_self ) ;
2023-05-30 01:26:42 +02:00
pandemonium_string GDAPI pandemonium_string_sha1_text ( const pandemonium_string * p_self ) ;
2023-05-26 10:58:14 +02:00
pandemonium_pool_byte_array GDAPI pandemonium_string_sha256_buffer ( const pandemonium_string * p_self ) ;
2023-05-26 18:45:55 +02:00
pandemonium_pool_byte_array GDAPI pandemonium_string_md5_buffer ( const pandemonium_string * p_self ) ;
//Vector<uint8_t> sha1_buffer() const;
2023-05-26 10:58:14 +02:00
pandemonium_string GDAPI pandemonium_string_sha256_text ( const pandemonium_string * p_self ) ;
pandemonium_bool pandemonium_string_empty ( const pandemonium_string * p_self ) ;
2023-05-30 01:26:42 +02:00
pandemonium_bool GDAPI pandemonium_string_containsc ( const pandemonium_string * p_self , const char * p_str ) ;
pandemonium_bool GDAPI pandemonium_string_contains ( const pandemonium_string * p_self , const pandemonium_string * p_str ) ;
2023-05-23 18:02:01 +02:00
// path functions
2023-05-26 18:45:55 +02:00
2023-05-26 10:58:14 +02:00
pandemonium_bool GDAPI pandemonium_string_is_abs_path ( const pandemonium_string * p_self ) ;
pandemonium_bool GDAPI pandemonium_string_is_rel_path ( const pandemonium_string * p_self ) ;
pandemonium_bool GDAPI pandemonium_string_is_resource_file ( const pandemonium_string * p_self ) ;
pandemonium_string GDAPI pandemonium_string_path_to ( const pandemonium_string * p_self , const pandemonium_string * p_path ) ;
pandemonium_string GDAPI pandemonium_string_path_to_file ( const pandemonium_string * p_self , const pandemonium_string * p_path ) ;
2023-05-26 18:45:55 +02:00
pandemonium_string GDAPI pandemonium_string_get_base_dir ( const pandemonium_string * p_self ) ;
pandemonium_string GDAPI pandemonium_string_get_file ( const pandemonium_string * p_self ) ;
pandemonium_string GDAPI pandemonium_string_humanize_size ( uint64_t p_size ) ;
2023-05-26 10:58:14 +02:00
pandemonium_string GDAPI pandemonium_string_simplify_path ( const pandemonium_string * p_self ) ;
2023-05-30 01:26:42 +02:00
pandemonium_bool GDAPI pandemonium_string_is_network_share_path ( const pandemonium_string * p_self ) ;
pandemonium_string GDAPI pandemonium_string_append_pathc ( const pandemonium_string * p_self , const char * p_path ) ;
pandemonium_string GDAPI pandemonium_string_append_path ( const pandemonium_string * p_self , const pandemonium_string * p_path ) ;
pandemonium_string GDAPI pandemonium_string_path_clean_end_slash ( const pandemonium_string * p_self ) ;
pandemonium_string GDAPI pandemonium_string_path_ensure_end_slash ( const pandemonium_string * p_self ) ;
pandemonium_string GDAPI pandemonium_string_path_get_prev_dir ( const pandemonium_string * p_self ) ;
2023-05-26 10:58:14 +02:00
2023-05-26 18:45:55 +02:00
pandemonium_string GDAPI pandemonium_string_xml_escape ( const pandemonium_string * p_self ) ;
pandemonium_string GDAPI pandemonium_string_xml_escape_with_quotes ( const pandemonium_string * p_self ) ;
pandemonium_string GDAPI pandemonium_string_xml_unescape ( const pandemonium_string * p_self ) ;
pandemonium_string GDAPI pandemonium_string_http_escape ( const pandemonium_string * p_self ) ;
pandemonium_string GDAPI pandemonium_string_http_unescape ( const pandemonium_string * p_self ) ;
2023-05-30 01:26:42 +02:00
pandemonium_string GDAPI pandemonium_string_uri_encode ( const pandemonium_string * p_self ) ;
pandemonium_string GDAPI pandemonium_string_uri_decode ( const pandemonium_string * p_self ) ;
2023-05-26 10:58:14 +02:00
pandemonium_string GDAPI pandemonium_string_c_escape ( const pandemonium_string * p_self ) ;
pandemonium_string GDAPI pandemonium_string_c_escape_multiline ( const pandemonium_string * p_self ) ;
pandemonium_string GDAPI pandemonium_string_c_unescape ( const pandemonium_string * p_self ) ;
pandemonium_string GDAPI pandemonium_string_json_escape ( const pandemonium_string * p_self ) ;
pandemonium_string GDAPI pandemonium_string_word_wrap ( const pandemonium_string * p_self , pandemonium_int p_chars_per_line ) ;
2023-05-26 18:45:55 +02:00
//Error parse_url(String &r_scheme, String &r_host, int &r_port, String &r_path) const;
2023-05-26 10:58:14 +02:00
pandemonium_string GDAPI pandemonium_string_percent_decode ( const pandemonium_string * p_self ) ;
pandemonium_string GDAPI pandemonium_string_percent_encode ( const pandemonium_string * p_self ) ;
2023-05-30 01:26:42 +02:00
pandemonium_string GDAPI pandemonium_string_property_name_encode ( const pandemonium_string * p_self ) ;
2023-05-26 18:45:55 +02:00
// node functions
2023-05-30 01:26:42 +02:00
pandemonium_string GDAPI pandemonium_string_get_invalid_node_name_characters ( ) ;
pandemonium_string GDAPI pandemonium_string_validate_node_name ( const pandemonium_string * p_self ) ;
pandemonium_string GDAPI pandemonium_string_validate_identifier ( const pandemonium_string * p_self ) ;
2023-05-26 18:45:55 +02:00
pandemonium_bool GDAPI pandemonium_string_is_valid_identifier ( const pandemonium_string * p_self ) ;
pandemonium_bool GDAPI pandemonium_string_is_valid_integer ( const pandemonium_string * p_self ) ;
2023-05-26 10:58:14 +02:00
pandemonium_bool GDAPI pandemonium_string_is_valid_float ( const pandemonium_string * p_self ) ;
pandemonium_bool GDAPI pandemonium_string_is_valid_hex_number ( const pandemonium_string * p_self , pandemonium_bool p_with_prefix ) ;
pandemonium_bool GDAPI pandemonium_string_is_valid_html_color ( const pandemonium_string * p_self ) ;
pandemonium_bool GDAPI pandemonium_string_is_valid_ip_address ( const pandemonium_string * p_self ) ;
2023-05-30 01:26:42 +02:00
pandemonium_bool GDAPI pandemonium_string_is_valid_filename ( const pandemonium_string * p_self ) ;
pandemonium_bool GDAPI pandemonium_string_is_valid_bool ( const pandemonium_string * p_self ) ;
pandemonium_bool GDAPI pandemonium_string_is_valid_unsigned_integer ( const pandemonium_string * p_self ) ;
2023-05-26 10:58:14 +02:00
2023-05-26 18:45:55 +02:00
//Vector<uint8_t> to_ascii_buffer() const;
//Vector<uint8_t> to_utf8_buffer() const;
//Vector<uint8_t> to_utf16_buffer() const;
//Vector<uint8_t> to_utf32_buffer() const;
void GDAPI pandemonium_string_new ( pandemonium_string * r_dest ) ;
void GDAPI pandemonium_string_new_copy ( pandemonium_string * r_dest , const pandemonium_string * p_src ) ;
void GDAPI pandemonium_string_new_with_wide_string ( pandemonium_string * r_dest , const wchar_t * p_contents , const int p_size ) ;
//String(const char *p_str);
//String(const wchar_t *p_str);
//String(const CharType *p_str);
//String(const char *p_str, int p_clip_to_len);
//String(const CharType *p_str, int p_clip_to_len);
2023-05-26 10:58:14 +02:00
void GDAPI pandemonium_string_destroy ( pandemonium_string * p_self ) ;
2023-05-23 18:02:01 +02:00
# ifdef __cplusplus
}
# endif
# endif // GDNATIVE_STRING_H