libcake 0.0.1
Librairie en C
strutf16.h
Aller à la documentation de ce fichier.
1
7#ifndef __CAKE_UTF16_H__
8#define __CAKE_UTF16_H__
9
11#include "def.h"
12
13#include <stddef.h>
15
19typedef struct cake_string_utf16 {
20 ulonglong length;
21 wchar_t *characteres;
23
24#ifdef __cplusplus
25extern "C" {
26#endif
27
28
29/* ===== Initialisation ===== */
30
31void cake_create_strutf16(Cake_String_UTF16 *utf);
32Cake_String_UTF16 *cake_strutf16(const wchar_t *value);
33
34void cake_strutf16_copy(Cake_String_UTF16 *from, Cake_String_UTF16 *to);
35
36
37/* ===== Setter ===== */
38
39cake_bool cake_strutf16_set_value(Cake_String_UTF16 *utf, wchar_t *str);
40ulonglong cake_strutf16_lower(Cake_String_UTF16 *utf);
41ulonglong cake_strutf16_upper(Cake_String_UTF16 *utf);
42
43
44/* ===== Ajout ===== */
45
46cake_bool cake_strutf16_add_wchar_array(Cake_String_UTF16 *utf, const wchar_t *str);
47cake_bool cake_strutf16_add_char(Cake_String_UTF16 *utf, wchar_t c);
48cake_bool cake_strutf16_add_bytes(Cake_String_UTF16 *utf, uchar *bytes, ulonglong size);
49cake_bool cake_strutf16_insert(Cake_String_UTF16 *utf, wchar_t *str);
50
51
52/* ===== Suppression ===== */
53
54cake_bool cake_strutf16_remove(Cake_String_UTF16 *utf, wchar_t *str);
55cake_bool cake_strutf16_remove_from_index(Cake_String_UTF16 *utf, ulonglong index);
56cake_bool cake_strutf16_remove_before_index(Cake_String_UTF16 *utf, ulonglong index);
57cake_bool cake_strutf16_remove_part_from_end(Cake_String_UTF16 *utf, wchar_t delim);
58ulonglong cake_strutf16_rtrim(Cake_String_UTF16 *utf, wchar_t charactere);
59cake_bool cake_strutf16_remove_index(Cake_String_UTF16 *utf, ulonglong index);
60
61
62/* ===== Remplacement ===== */
63
64ulonglong cake_strutf16_replace_all_char(Cake_String_UTF16 *utf, wchar_t old, wchar_t replacement);
65cake_bool cake_strutf16_replace(Cake_String_UTF16 *utf, wchar_t *old, wchar_t *replacement);
66cake_bool cake_strutf16_replace_from_end(Cake_String_UTF16 *utf, wchar_t *old, wchar_t *replacement);
67
68
69/* ===== Cleaner ===== */
70
71void cake_clear_strutf16(Cake_String_UTF16 *utf);
72void cake_strutf16_empty(Cake_String_UTF16 *utf);
73void cake_free_strutf16(Cake_String_UTF16 *utf);
74
75
76/* ===== Recherches ===== */
77
78wchar_t *cake_strutf16_search(Cake_String_UTF16 *utf, const wchar_t *research);
79wchar_t *cake_strutf16_search_from_end(Cake_String_UTF16 *utf, wchar_t *research);
80wchar_t *cake_strutf16_find(Cake_String_UTF16 *utf, wchar_t research, ulonglong *index);
81wchar_t *cake_strutf16_search_from(Cake_String_UTF16 *utf, wchar_t *research, ulonglong *index);
82ulonglong cake_strutf16_number_of(Cake_String_UTF16 *utf, wchar_t charactere);
83cake_bool cake_strutf16_start_with(Cake_String_UTF16 *utf, wchar_t *str);
84
85ulonglong cake_wstr_count(const wchar_t *str);
86
87void cake_char_array_to_strutf16(const char *source, Cake_String_UTF16 *dest);
88
89#ifdef __cplusplus
90}
91#endif
92
93#endif
Fichier contenant les types utilisés fréquemment par la librairie.
char cake_bool
Type sur 8 bits, utilisé principalement comme valeur de retour des fonctions pour indiquer si une err...
Definition: def.h:126
Chaines de caractères encodées en UTF-16.
Definition: strutf16.h:19
wchar_t * characteres
Adresse de la chaîne.
Definition: strutf16.h:21
ulonglong length
Le nombre de caractères contenus dans la chaîne.
Definition: strutf16.h:20
struct cake_string_utf16 Cake_String_UTF16
Chaines de caractères encodées en UTF-16.