1 <!-- ##### SECTION Title ##### --> 2 Strings 3 4 <!-- ##### SECTION Short_Description ##### --> 5 text buffers which grow automatically as text is added 6 7 <!-- ##### SECTION Long_Description ##### --> 8 <para> 9 A #GString is similar to a standard C string, except that it grows 10 automatically as text is appended or inserted. Also, it stores the 11 length of the string, so can be used for binary data with embedded 12 nul bytes. 13 </para> 14 15 <!-- ##### SECTION See_Also ##### --> 16 <para> 17 18 </para> 19 20 <!-- ##### SECTION Stability_Level ##### --> 21 22 23 <!-- ##### STRUCT GString ##### --> 24 <para> 25 The #GString struct contains the public fields of a #GString. 26 </para> 27 28 @str: points to the character data. It may move as text is added. 29 The <structfield>str</structfield> field is nul-terminated and so 30 can be used as an ordinary C string. 31 @len: contains the length of the string, not including the 32 terminating nul byte. 33 @allocated_len: the number of bytes that can be stored in the 34 string before it needs to be reallocated. May be larger than @len. 35 36 <!-- ##### FUNCTION g_string_new ##### --> 37 <para> 38 39 </para> 40 41 @init: 42 @Returns: 43 44 45 <!-- ##### FUNCTION g_string_new_len ##### --> 46 <para> 47 48 </para> 49 50 @init: 51 @len: 52 @Returns: 53 54 55 <!-- ##### FUNCTION g_string_sized_new ##### --> 56 <para> 57 58 </para> 59 60 @dfl_size: 61 @Returns: 62 63 64 <!-- ##### FUNCTION g_string_assign ##### --> 65 <para> 66 67 </para> 68 69 @string: 70 @rval: 71 @Returns: 72 73 74 <!-- ##### MACRO g_string_sprintf ##### --> 75 <para> 76 77 </para> 78 79 80 81 <!-- ##### MACRO g_string_sprintfa ##### --> 82 <para> 83 84 </para> 85 86 87 88 <!-- ##### FUNCTION g_string_vprintf ##### --> 89 <para> 90 91 </para> 92 93 @string: 94 @format: 95 @args: 96 97 98 <!-- ##### FUNCTION g_string_append_vprintf ##### --> 99 <para> 100 101 </para> 102 103 @string: 104 @format: 105 @args: 106 107 108 <!-- ##### FUNCTION g_string_printf ##### --> 109 <para> 110 111 </para> 112 113 @string: 114 @format: 115 @Varargs: 116 117 118 <!-- ##### FUNCTION g_string_append_printf ##### --> 119 <para> 120 121 </para> 122 123 @string: 124 @format: 125 @Varargs: 126 127 128 <!-- ##### FUNCTION g_string_append ##### --> 129 <para> 130 131 </para> 132 133 @string: 134 @val: 135 @Returns: 136 137 138 <!-- ##### FUNCTION g_string_append_c ##### --> 139 <para> 140 141 </para> 142 143 @string: 144 @c: 145 @Returns: 146 147 148 <!-- ##### FUNCTION g_string_append_unichar ##### --> 149 <para> 150 151 </para> 152 153 @string: 154 @wc: 155 @Returns: 156 157 158 <!-- ##### FUNCTION g_string_append_len ##### --> 159 <para> 160 161 </para> 162 163 @string: 164 @val: 165 @len: 166 @Returns: 167 168 169 <!-- ##### FUNCTION g_string_append_uri_escaped ##### --> 170 <para> 171 172 </para> 173 174 @string: 175 @unescaped: 176 @reserved_chars_allowed: 177 @allow_utf8: 178 @Returns: 179 180 181 <!-- ##### FUNCTION g_string_prepend ##### --> 182 <para> 183 184 </para> 185 186 @string: 187 @val: 188 @Returns: 189 190 191 <!-- ##### FUNCTION g_string_prepend_c ##### --> 192 <para> 193 194 </para> 195 196 @string: 197 @c: 198 @Returns: 199 200 201 <!-- ##### FUNCTION g_string_prepend_unichar ##### --> 202 <para> 203 204 </para> 205 206 @string: 207 @wc: 208 @Returns: 209 210 211 <!-- ##### FUNCTION g_string_prepend_len ##### --> 212 <para> 213 214 </para> 215 216 @string: 217 @val: 218 @len: 219 @Returns: 220 221 222 <!-- ##### FUNCTION g_string_insert ##### --> 223 <para> 224 225 </para> 226 227 @string: 228 @pos: 229 @val: 230 @Returns: 231 232 233 <!-- ##### FUNCTION g_string_insert_c ##### --> 234 <para> 235 236 </para> 237 238 @string: 239 @pos: 240 @c: 241 @Returns: 242 243 244 <!-- ##### FUNCTION g_string_insert_unichar ##### --> 245 <para> 246 247 </para> 248 249 @string: 250 @pos: 251 @wc: 252 @Returns: 253 254 255 <!-- ##### FUNCTION g_string_insert_len ##### --> 256 <para> 257 258 </para> 259 260 @string: 261 @pos: 262 @val: 263 @len: 264 @Returns: 265 266 267 <!-- ##### FUNCTION g_string_overwrite ##### --> 268 <para> 269 270 </para> 271 272 @string: 273 @pos: 274 @val: 275 @Returns: 276 277 278 <!-- ##### FUNCTION g_string_overwrite_len ##### --> 279 <para> 280 281 </para> 282 283 @string: 284 @pos: 285 @val: 286 @len: 287 @Returns: 288 289 290 <!-- ##### FUNCTION g_string_erase ##### --> 291 <para> 292 293 </para> 294 295 @string: 296 @pos: 297 @len: 298 @Returns: 299 300 301 <!-- ##### FUNCTION g_string_truncate ##### --> 302 <para> 303 304 </para> 305 306 @string: 307 @len: 308 @Returns: 309 310 311 <!-- ##### FUNCTION g_string_set_size ##### --> 312 <para> 313 314 </para> 315 316 @string: 317 @len: 318 @Returns: 319 320 321 <!-- ##### FUNCTION g_string_free ##### --> 322 <para> 323 324 </para> 325 326 @string: 327 @free_segment: 328 @Returns: 329 330 331 <!-- ##### FUNCTION g_string_up ##### --> 332 <para> 333 </para> 334 335 @string: 336 @Returns: 337 338 339 <!-- ##### FUNCTION g_string_down ##### --> 340 <para> 341 </para> 342 343 @string: 344 @Returns: 345 346 347 <!-- ##### FUNCTION g_string_hash ##### --> 348 <para> 349 350 </para> 351 352 @str: 353 @Returns: 354 355 356 <!-- ##### FUNCTION g_string_equal ##### --> 357 <para> 358 359 </para> 360 361 @v: 362 @v2: 363 @Returns: 364 365 366