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