gstring.h

Go to the documentation of this file.
00001 /* GLIB - Library of useful routines for C programming
00002  * Copyright (C) 1995-1997  Peter Mattis, Spencer Kimball and Josh MacDonald
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Lesser General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Lesser General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Lesser General Public
00015  * License along with this library; if not, write to the
00016  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00017  * Boston, MA 02111-1307, USA.
00018  */
00019 
00020 /*
00021  * Modified by the GLib Team and others 1997-2000.  See the AUTHORS
00022  * file for a list of people on the GLib Team.  See the ChangeLog
00023  * files for a list of changes.  These files are distributed with
00024  * GLib at ftp://ftp.gtk.org/pub/gtk/. 
00025  */
00026 
00027 #ifndef __G_STRING_H__
00028 #define __G_STRING_H__
00029 
00030 #include <g_types.h>
00031 
00032 G_BEGIN_DECLS
00033 
00034 typedef struct _GString         GString;
00035 typedef struct _GStringChunk    GStringChunk;
00036 
00037 struct _GString
00038 {
00039   gchar *str;
00040   gint len;
00041 };
00042 
00043 /* String Chunks
00044  */
00045 GStringChunk* g_string_chunk_new           (gint size);
00046 void          g_string_chunk_free          (GStringChunk *chunk);
00047 gchar*        g_string_chunk_insert        (GStringChunk *chunk,
00048                                             const gchar  *string);
00049 gchar*        g_string_chunk_insert_const  (GStringChunk *chunk,
00050                                             const gchar  *string);
00051 
00052 
00053 /* Strings
00054  */
00055 GString*     g_string_new               (const gchar     *init);
00056 GString*     g_string_new_len           (const gchar     *init,
00057                                          gint             len);
00058 GString*     g_string_sized_new         (guint            dfl_size);
00059 gchar*       g_string_free              (GString         *string,
00060                                          gboolean         free_segment);
00061 gboolean     g_string_equal             (const GString   *v,
00062                                          const GString   *v2);
00063 guint        g_string_hash              (const GString   *str);
00064 GString*     g_string_assign            (GString         *string,
00065                                          const gchar     *rval);
00066 GString*     g_string_truncate          (GString         *string,
00067                                          guint            len);
00068 GString*     g_string_insert_len        (GString         *string,
00069                                          gint             pos,
00070                                          const gchar     *val,
00071                                          gint             len);
00072 GString*     g_string_append            (GString         *string,
00073                                          const gchar     *val);
00074 GString*     g_string_append_len        (GString         *string,
00075                                          const gchar     *val,
00076                                          gint             len);
00077 GString*     g_string_append_c          (GString         *string,
00078                                          gchar            c);
00079 GString*     g_string_prepend           (GString         *string,
00080                                          const gchar     *val);
00081 GString*     g_string_prepend_c         (GString         *string,
00082                                          gchar            c);
00083 GString*     g_string_prepend_len       (GString         *string,
00084                                          const gchar     *val,
00085                                          gint             len);
00086 GString*     g_string_insert            (GString         *string,
00087                                          gint             pos,
00088                                          const gchar     *val);
00089 GString*     g_string_insert_c          (GString         *string,
00090                                          gint             pos,
00091                                          gchar            c);
00092 GString*     g_string_erase             (GString         *string,
00093                                          gint             pos,
00094                                          gint             len);
00095 GString*     g_string_down              (GString         *string);
00096 GString*     g_string_up                (GString         *string);
00097 void         g_string_sprintf           (GString         *string,
00098                                          const gchar     *format,
00099                                          ...) G_GNUC_PRINTF (2, 3);
00100 void         g_string_sprintfa          (GString         *string,
00101                                          const gchar     *format,
00102                                          ...) G_GNUC_PRINTF (2, 3);
00103 
00104 G_END_DECLS
00105 
00106 #endif /* __G_STRING_H__ */
00107 

Generated on Tue Jul 5 14:14:42 2011 for ROOT_528-00b_version by  doxygen 1.5.1