Main Page | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

cr-enc-handler.h File Reference

The declaration of the CREncHandler class. More...

#include "cr-utils.h"

Go to the source code of this file.

Data Structures

struct  _CREncHandler
 This class is responsible of the the encoding conversions stuffs in libcroco. More...

Functions

CREncHandlercr_enc_handler_get_instance (enum CREncoding a_enc)
 Gets the instance of encoding handler.
enum CRStatus cr_enc_handler_resolve_enc_alias (const guchar *a_en_alias, enum CREncoding *a_enc)
 Given an encoding name (called an alias name) the function returns the matching encoding type.
void cr_enc_handler_destroy (CREncHandler *a_enc_hdlr)
enum CRStatus cr_enc_handler_convert_input (CREncHandler *a_this, const guchar *a_in, gulong *a_in_len, guchar **a_out, gulong *a_out_len)
 Converts a raw input buffer into an utf8 buffer.

Variables

typedefG_BEGIN_DECLS struct
_CREncHandler 
CREncHandler
enum CRStatus(* CREncInputFunc )(const guchar *a_in, gulong *a_in_len, guchar *a_out, gulong *a_out_len)
enum CRStatus(* CREncOutputFunc )(const guchar *a_in, gulong *a_in_len, guchar *a_out, gulong *a_out_len)
enum CRStatus(* CREncInputStrLenAsUtf8Func )(const guchar *a_in_start, const guchar *a_in_end, gulong *a_in_size)
enum CRStatus(* CREncUtf8StrLenAsOutputFunc )(const guchar *a_in_start, const guchar *a_in_end, gulong *a_in_size)


Detailed Description

The declaration of the CREncHandler class.

Definition in file cr-enc-handler.h.


Function Documentation

enum CRStatus cr_enc_handler_convert_input CREncHandler a_this,
const guchar *  a_in,
gulong *  a_in_len,
guchar **  a_out,
gulong *  a_out_len
 

Converts a raw input buffer into an utf8 buffer.

Parameters:
a_this the current instance of CREncHandler.
a_in the input buffer to convert.
a_in_len in/out parameter. The len of the input buffer to convert. After return, contains the number of bytes actually consumed.
@a_out output parameter. The converted output buffer. Must be freed by the buffer.
a_out_len output parameter. The length of the output buffer.
Returns:
CR_OK upon successfull completion, an error code otherwise.

Definition at line 142 of file cr-enc-handler.c.

References CR_BAD_PARAM_ERROR, CR_OK, and CRStatus.

Referenced by cr_input_new_from_buf().

void cr_enc_handler_destroy CREncHandler a_enc_hdlr  ) 
 

CREncHandler* cr_enc_handler_get_instance enum CREncoding  a_enc  ) 
 

Gets the instance of encoding handler.

This function implements a singleton pattern.

Parameters:
a_enc the encoding of the Handler.
Returns:
the instance of CREncHandler.

Definition at line 83 of file cr-enc-handler.c.

References CREncHandler.

Referenced by cr_input_new_from_buf().

enum CRStatus cr_enc_handler_resolve_enc_alias const guchar *  a_alias_name,
enum CREncoding a_enc
 

Given an encoding name (called an alias name) the function returns the matching encoding type.

Parameters:
a_alias_name the encoding name
a_enc output param. The returned encoding type or 0 if the alias is not supported.
Returns:
CR_OK upon successfull completion, an error code otherwise.

Definition at line 106 of file cr-enc-handler.c.

References CR_BAD_PARAM_ERROR, CRStatus, name, and CREncAlias::name.


Variable Documentation

typedefG_BEGIN_DECLS struct _CREncHandler CREncHandler
 

Definition at line 41 of file cr-enc-handler.h.

Referenced by cr_enc_handler_get_instance(), and cr_input_new_from_buf().

enum CRStatus(* CREncInputFunc)(const guchar *a_in, gulong *a_in_len, guchar *a_out, gulong *a_out_len)
 

Definition at line 43 of file cr-enc-handler.h.

enum CRStatus(* CREncInputStrLenAsUtf8Func)(const guchar *a_in_start, const guchar *a_in_end, gulong *a_in_size)
 

Definition at line 54 of file cr-enc-handler.h.

enum CRStatus(* CREncOutputFunc)(const guchar *a_in, gulong *a_in_len, guchar *a_out, gulong *a_out_len)
 

Definition at line 48 of file cr-enc-handler.h.

enum CRStatus(* CREncUtf8StrLenAsOutputFunc)(const guchar *a_in_start, const guchar *a_in_end, gulong *a_in_size)
 

Definition at line 59 of file cr-enc-handler.h.


Generated on Fri Oct 29 08:29:13 2004 for Libcroco by  doxygen 1.3.9.1