Mercury
Classes | Typedefs | Functions
mercury_string_object.h File Reference
#include "mercury_types.h"
Include dependency graph for mercury_string_object.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  hg_string_object
 

Typedefs

typedef struct hg_string_object hg_string_object_t
 

Functions

HG_EXPORT hg_return_t hg_string_object_init (hg_string_object_t *string)
 Initialize a string object. More...
 
HG_EXPORT hg_return_t hg_string_object_init_char (hg_string_object_t *string, char *s, hg_bool_t is_owned)
 Initialize a string object from the string pointed to by s. More...
 
HG_EXPORT hg_return_t hg_string_object_init_const_char (hg_string_object_t *string, const char *s, hg_bool_t is_owned)
 Initialize a string object from the const string pointed to by s. More...
 
HG_EXPORT hg_return_t hg_string_object_free (hg_string_object_t *string)
 Free a string object. More...
 
HG_EXPORT hg_return_t hg_string_object_dup (hg_string_object_t string, hg_string_object_t *new_string)
 Duplicate a string object. More...
 
HG_EXPORT char * hg_string_object_swap (hg_string_object_t *string, char *s)
 Exchange the content of the string structure by the content of s. More...
 

Typedef Documentation

Function Documentation

HG_EXPORT hg_return_t hg_string_object_init ( hg_string_object_t string)

Initialize a string object.

Parameters
string[OUT] pointer to string structure
Returns
HG_SUCCESS or corresponding HG error code
HG_EXPORT hg_return_t hg_string_object_init_char ( hg_string_object_t string,
char *  s,
hg_bool_t  is_owned 
)

Initialize a string object from the string pointed to by s.

Parameters
string[OUT] pointer to string structure
s[IN] pointer to string
is_owned[IN] boolean
Returns
HG_SUCCESS or corresponding HG error code
HG_EXPORT hg_return_t hg_string_object_init_const_char ( hg_string_object_t string,
const char *  s,
hg_bool_t  is_owned 
)

Initialize a string object from the const string pointed to by s.

Parameters
string[OUT] pointer to string structure
s[IN] pointer to string
is_owned[IN] boolean
Returns
HG_SUCCESS or corresponding HG error code
HG_EXPORT hg_return_t hg_string_object_free ( hg_string_object_t string)

Free a string object.

Parameters
string[IN/OUT] pointer to string structure
Returns
HG_SUCCESS or corresponding HG error code
HG_EXPORT hg_return_t hg_string_object_dup ( hg_string_object_t  string,
hg_string_object_t new_string 
)

Duplicate a string object.

Parameters
string[IN] pointer to string structure
new_string[OUT] pointer to string structure
Returns
HG_SUCCESS or corresponding HG error code
HG_EXPORT char* hg_string_object_swap ( hg_string_object_t string,
char *  s 
)

Exchange the content of the string structure by the content of s.

Parameters
string[IN/OUT] pointer to string structure
Returns
Pointer to string contained by string before the swap