summaryrefslogtreecommitdiff
path: root/hieroglyph/hgstring.h
blob: 3b6fe09fc9513e470dbf85114d19bfe49f125286 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/* 
 * hgstring.h
 * Copyright (C) 2005-2006 Akira TAGOH
 * 
 * Authors:
 *   Akira TAGOH  <at@gclab.org>
 * 
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 * 
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA 02111-1307, USA.
 */
#ifndef __HG_STRING_H__
#define __HG_STRING_H__

#include <hieroglyph/hgtypes.h>

G_BEGIN_DECLS


HgString *hg_string_new                  (HgMemPool      *pool,
					  gint32          n_prealloc);
guint     hg_string_length               (HgString       *string);
guint     hg_string_maxlength            (HgString       *string);
gboolean  hg_string_clear                (HgString       *string);
gboolean  hg_string_append_c             (HgString       *string,
					  gchar           c);
gboolean  hg_string_append               (HgString       *string,
					  const gchar    *str,
					  gint            length);
void      hg_string_append_printf        (HgString       *string,
					  const gchar    *format,
					  ...);
void      hg_string_append_vprintf       (HgString       *string,
					  const gchar    *format,
					  va_list         va_args);
gboolean  hg_string_insert_c             (HgString       *string,
					  gchar           c,
					  guint           index);
gboolean  hg_string_concat               (HgString       *string1,
					  HgString       *string2);
gchar     hg_string_index                (HgString       *string,
					  guint           index);
gchar    *hg_string_get_string           (HgString       *string);
gboolean  hg_string_fix_string_size      (HgString       *string);
gboolean  hg_string_compare              (const HgString *a,
					  const HgString *b);
gboolean  hg_string_ncompare             (const HgString *a,
					  const HgString *b,
					  guint           length);
gboolean  hg_string_compare_with_raw     (const HgString *a,
					  const gchar    *b,
					  gint            length);
gboolean  hg_string_compare_offset_later (const HgString *a,
					  const HgString *b,
					  guint           offset1,
					  guint           offset2);
gboolean  hg_string_ncompare_offset_later(const HgString *a,
					  const HgString *b,
					  guint           offset1,
					  guint           offset2,
					  guint           length);
HgString *hg_string_make_substring       (HgMemPool      *pool,
					  HgString       *string,
					  guint           start_index,
					  guint           end_index);
gboolean  hg_string_copy_as_substring    (HgString       *src,
					  HgString       *dest,
					  guint           start_index,
					  guint           end_index);
gboolean  hg_string_convert_from_integer (HgString       *string,
					  gint32          num,
					  guint           radix,
					  gboolean        is_lower);

/* HgObject */
HgString *hg_object_to_string(HgObject *object);

G_END_DECLS

#endif /* __HG_STRING_H__ */