group Strings

Description

Ferite strings provide a nice clean method for encoding and storing strings, and managing binary data. The functions below provide several means of string mangement which makes twiddling 'string' variables easier.

group contents
Functions
function ferite_str_case_cmp(FeriteString,FeriteString) - Compare two strings but dont take into consideration what case the strings are
function ferite_str_case_ncmp(FeriteString,FeriteString,int) - Compare two strings upto a certain size without considering the case of the strings
function ferite_str_cat(FeriteString,FeriteString) - Concatenate the second string onto the first
function ferite_str_cmp(FeriteString,FeriteString) - Compare two strings
function ferite_str_cpy(FeriteString,FeriteString) - Copy the contents of the second string to the first string
function ferite_str_data_cat(FeriteString,void,int) - Concatenate the data onto the first string
function ferite_str_destroy(FeriteString) - Destroy the string and free all memory
function ferite_str_dup(FeriteString) - Duplicate a ferite string
function ferite_str_ncmp(FeriteString,FeriteString,int) - Compare two strings upto a certain size
function ferite_str_ncpy(FeriteString,FeriteString,int) - Copy the contents of the second string to the first string upto size character
function ferite_str_new(char,int,int) - Create a new string with exisitng data and encoding
function ferite_str_replace(FeriteString,FeriteString,FeriteString) - Replace all occurances of a string with another
function ferite_str_set(FeriteString,char,int,int) - Set the data contained within an existing string

Functions

function ferite_str_case_cmp Click to go up to the list
Compare two strings but dont take into consideration what case the strings are
Declaration:
    int ferite_str_case_cmp( FeriteString *str1, FeriteString *str2 )
Parameters:
    Parameter #1: FeriteString *str1 - The first string
    Parameter #2: FeriteString *str2 - The second string
Returns:
    1 if they match, 0 if they dont

function ferite_str_case_ncmp Click to go up to the list
Compare two strings upto a certain size without considering the case of the strings
Declaration:
    int ferite_str_case_ncmp( FeriteString *str1, FeriteString *str2, int size )
Parameters:
    Parameter #1: FeriteString *str1 - The first string
    Parameter #2: FeriteString *str2 - The second string
    Parameter #3: int size - The size upto which the strings should be compared
Returns:
    1 if they match, 0 if they dont

function ferite_str_cat Click to go up to the list
Concatenate the second string onto the first
Declaration:
    int ferite_str_cat( FeriteString *str1, FeriteString *str2 )
Parameters:
    Parameter #1: FeriteString *str1 - The first string
    Parameter #2: FeriteString *str2 - The second string

function ferite_str_cmp Click to go up to the list
Compare two strings
Declaration:
    int ferite_str_cmp( FeriteString *str1, FeriteString *str2 )
Parameters:
    Parameter #1: FeriteString *str1 - The first string
    Parameter #2: FeriteString *str2 - The second string
Returns:
    1 if they match, 0 if they dont

function ferite_str_cpy Click to go up to the list
Copy the contents of the second string to the first string
Declaration:
    int ferite_str_cpy( FeriteString *str1, FeriteString *str2 )
Parameters:
    Parameter #1: FeriteString *str1 - The first string
    Parameter #2: FeriteString *str2 - The second string
Returns:
    The amount of data copied

function ferite_str_data_cat Click to go up to the list
Concatenate the data onto the first string
Declaration:
    int ferite_str_data_cat( FeriteString *str1, void *data, int size )
Parameters:
    Parameter #1: FeriteString *str1 - The first string
    Parameter #2: void *data - The data to concatenate
    Parameter #3: int size - The length of the data to concatenate

function ferite_str_destroy Click to go up to the list
Destroy the string and free all memory
Declaration:
    void ferite_str_destroy( FeriteString *str )
Parameters:
    Parameter #1: FeriteString *str - The string to destroy

function ferite_str_dup Click to go up to the list
Duplicate a ferite string
Declaration:
    FeriteString *ferite_str_dup( FeriteString *str )
Parameters:
    Parameter #1: FeriteString *str - The string to duplicate
Returns:
    A new string

function ferite_str_ncmp Click to go up to the list
Compare two strings upto a certain size
Declaration:
    int ferite_str_ncmp( FeriteString *str1, FeriteString *str2, int size )
Parameters:
    Parameter #1: FeriteString *str1 - The first string
    Parameter #2: FeriteString *str2 - The second string
    Parameter #3: int size - The size upto which the strings should be compared
Returns:
    1 if they match, 0 if they dont

function ferite_str_ncpy Click to go up to the list
Copy the contents of the second string to the first string upto size character
Declaration:
    int ferite_str_ncpy( FeriteString *str1, FeriteString *str2, int size )
Parameters:
    Parameter #1: FeriteString *str1 - The first string
    Parameter #2: FeriteString *str2 - The second string
    Parameter #3: int size - The amount of data to copy
Returns:
    The amount of data copied

function ferite_str_new Click to go up to the list
Create a new string with exisitng data and encoding
Declaration:
    FeriteString *ferite_str_new( char *str, int length, int encoding )
Parameters:
    Parameter #1: char *str - The data to use
    Parameter #2: int length - The length of the data, if it is 0, strlen() is called on the data.
    Parameter #3: int encoding - The encoding to use, if you are not sure use FE_CHARSET_DEFAULT
Returns:
    A FeriteString containing the data

function ferite_str_replace Click to go up to the list
Replace all occurances of a string with another
Declaration:
    FeriteString *ferite_str_replace( FeriteString *str, FeriteString *what, FeriteString *with )
Parameters:
    Parameter #1: FeriteString *str - The string to scane
    Parameter #2: FeriteString *what - The string to scan for
    Parameter #3: FeriteString *with - The string to replace 'what' with
Returns:
    A new string with the replacements

function ferite_str_set Click to go up to the list
Set the data contained within an existing string
Declaration:
    void ferite_str_set( FeriteString *str, char *data, int length, int encoding )
Parameters:
    Parameter #1: FeriteString *str - The string to set
    Parameter #2: char *data - The data to use
    Parameter #3: int length - The length of the data
    Parameter #4: int encoding - The encoding of the data, for a default use FE_CHARSET_DEFAULT

Automatically generated at 12:07PM, Wednesday 25 May 2005 by feritedoc.