Libcroco
cr-string.h
Go to the documentation of this file.
1 /* -*- Mode: C; indent-tabs-mode:nil; c-basic-offset: 8-*- */
2 
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  */
22 
23 /**
24  *@file
25  *Declaration file of the #CRString class.
26  */
27 
28 #ifndef __CR_STRING_H__
29 #define __CR_STRING_H__
30 
31 #include <glib.h>
32 #include "cr-utils.h"
33 #include "cr-parsing-location.h"
34 
35 G_BEGIN_DECLS
36 
37 typedef struct _CRString CRString ;
38 
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  */
62 } ;
63 
64 CRString * cr_string_new (void) ;
65 
66 CRString *cr_string_new_from_string (const gchar * a_string) ;
67 CRString * cr_string_new_from_gstring (GString const *a_string) ;
68 CRString *cr_string_dup (CRString const *a_this) ;
69 gchar *cr_string_dup2 (CRString const *a_this) ;
70 const gchar *cr_string_peek_raw_str (CRString const *a_this) ;
71 gint cr_string_peek_raw_str_len (CRString const *a_this) ;
72 void cr_string_destroy (CRString *a_this) ;
73 
74 G_END_DECLS
75 
76 #endif
_CRString
This is a ship implementation of string based on GString.
Definition: cr-string.h:52
cr_string_dup2
gchar * cr_string_dup2(CRString const *a_this)
Definition: cr-string.c:110
cr_string_peek_raw_str_len
gint cr_string_peek_raw_str_len(CRString const *a_this)
Returns the length of the internal raw NULL terminated string of the current instance of CRString.
Definition: cr-string.c:148
cr_string_peek_raw_str
const gchar * cr_string_peek_raw_str(CRString const *a_this)
Returns a pointer to the internal raw NULL terminated string of the current instance of CRString.
Definition: cr-string.c:131
CRString
typedefG_BEGIN_DECLS struct _CRString CRString
Definition: cr-string.h:37
cr_string_new_from_string
CRString * cr_string_new_from_string(const gchar *a_string)
Instanciate a string and initialise it to a_string.
Definition: cr-string.c:54
cr_string_new_from_gstring
CRString * cr_string_new_from_gstring(GString const *a_string)
Instanciates a CRString from an instance of GString.
Definition: cr-string.c:75
_CRParsingLocation
Definition: cr-parsing-location.h:39
cr_string_destroy
void cr_string_destroy(CRString *a_this)
Definition: cr-string.c:159
cr_string_new
CRString * cr_string_new(void)
Instanciates a CRString.
Definition: cr-string.c:33
cr-parsing-location.h
_CRString::stryng
GString * stryng
The GString where all the string operation happen.
Definition: cr-string.h:57
cr-utils.h
cr_string_dup
CRString * cr_string_dup(CRString const *a_this)
Definition: cr-string.c:94
_CRString::location
CRParsingLocation location
The parsing location storage area.
Definition: cr-string.h:61