1 /* -*- Mode: C; indent-tabs-mode:nil; c-basic-offset: 8-*- */
3 /*
4 * This file is part of The Croco Library
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of version 2.1 of the GNU Lesser General Public
8 * License as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
18 * USA
19 *
20 * See COPYRIGHTS file for copyright information.
21 */
23 /**
24 *@file
25 *Declaration file of the #CRString class.
26 */
28 #ifndef __CR_STRING_H__
29 #define __CR_STRING_H__
31 #include <glib.h>
32 #include "cr-utils.h"
33 #include "cr-parsing-location.h"
35 G_BEGIN_DECLS
37 typedef struct _CRString CRString ;
39 /**
40 *This is a ship implementation of string based on GString.
41 *Actually, the aim of CRString is to store the parsing location
42 *(line,column,byte offset) at which a given string has been parsed
43 *in the input CSS.
44 *So this class has a gstring field of type GString that users can
45 *freely manipulate, and also a CRParginLocation type where the
46 *parsing location is store. If you don't want to deal with parsing
47 *location stuffs, then use GString instead. If we were in C++ for example,
48 *CRString would just inherit GString and just add accessors to
49 *the CRParsingLocation data ... but we are not and we still have
50 *to provide the parsing location information.
51 */
52 struct _CRString {
53 /**
54 *The GString where all the string
55 *operation happen.
56 */
57 GString *stryng ;
58 /**
59 *The parsing location storage area.
60 */
61 CRParsingLocation location ;
62 } ;
64 CRString * cr_string_new (void) ;
66 CRString *cr_string_new_from_string (const gchar * a_string) ;
67 CRString * cr_string_new_from_gstring (GString *a_string) ;
68 CRString *cr_string_dup (CRString *a_this) ;
69 gchar *cr_string_dup2 (CRString *a_this) ;
70 const gchar *cr_string_peek_raw_str (CRString *a_this) ;
71 gint cr_string_peek_raw_str_len (CRString *a_this) ;
72 void cr_string_destroy (CRString *a_this) ;
74 G_END_DECLS
76 #endif