Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   Compound Members  

CSIBCString Class Reference

General purpose string class. More...

#include <SIBCString.h>

List of all members.

Public Methods


Detailed Description

General purpose string class.

This class is used throughout the FTK as a standard method in dealing with strings. The strings are NULL-terminated strings. It supports many methods that perform useful string operations.


Constructor & Destructor Documentation

CSIBCString::CSIBCString  
 

Default Constructor. Constructs an empty string (length zero).

CSIBCString::CSIBCString const CSIBCString &    in_pString
 

Copy Constructor. Constructs a string idential to in_pString

Parameters:
in_pString  String to duplicate. Must not be of zero length.

CSIBCString::CSIBCString const SI_Char *    in_pString
 

Constructor Constructs a string object containing the NULL-terminated character string pointer to by in_pString.

Parameters:
in_pString  Pointer to the string to use for the new string. Cannot be NULL.


Member Function Documentation

SI_UInt CSIBCString::AllocatedMemory  
 

Returns the amount of memory allocated by the string. This does not include the size of the SIBCString class, only the data contained in its character buffer. In SIBCString (but not necessarily in other classes) SIBCString::AllocatedMemory is equivalent to SIBCString::UsedMemory.

Returns:
SI_UInt Amount of memory used by this string (in bytes).

void CSIBCString::Clear  
 

Deletes the internal character buffer of the string, and sets the length to zero.

SI_Int CSIBCString::Compare const SI_Float    in_fFloat
 

Returns a value indicated the differences between this string and the string representation of in_fFloat.

Parameters:
in_lInt  The floating-pointer number whose string representation is compared with this string.
Returns:
SI_Int Integer value representing the lexicographic difference between this string and the string representation of in_fFloat. Negative indicates this string is less than that string, positive indicates this string is greater than that string, and zero indicates the strings are the same.

SI_Int CSIBCString::Compare const SI_Int    in_lInt
 

Returns a value indicated the differences between this string and the string representation of in_lInt.

Parameters:
in_lInt  The integer value whose string representation is compared with this string.
Returns:
SI_Int Integer value representing the lexicographic difference between this string and the string representation of in_lInt. Negative indicates this string is less than that string, positive indicates this string is greater than that string, and zero indicates the strings are the same.

SI_Int CSIBCString::Compare const SI_Char *    in_pString
 

Returns a value indicated the differences between this string and in_pString.

Parameters:
in_pString  The character buffer containing the NULL-terminated string to compare this string with.
Returns:
SI_Int Integer value representing the lexicographic difference between this string and in_pString. Negative indicates this string is less than in_pString, Positive indicates this string is greater than in_pString, and zero indicates the strings are the same.
There are three special cases:
  • in_pString and this string's buffer are both NULL, function returns 0
  • in_pString is NULL, and this string's buffer is not NULL, function returns 1.
  • in_pString is not NULL, and this strings's buffer is NULL, function returns -1.

SI_Int CSIBCString::Compare CSIBCString *    in_pString
 

Returns a value indicated the differences between this string and in_pString.

Parameters:
in_pString  The string to compare this string with.
Returns:
SI_Int Integer value representing the lexicographic difference between this string and in_pString. Negative indicates this string is less than in_pString, Positive indicates this string is greater than in_pString, and zero indicates the strings are the same.
There are three special cases:
  • in_pString and this string's buffer are both NULL, function returns 0
  • in_pString is NULL, and this string's buffer is not NULL, function returns 1.
  • in_pString is not NULL, and this strings's buffer is NULL, function returns -1.

SI_Error CSIBCString::Concat const SI_Float    in_fFloat
 

Concatenate in_fFloat to the end of this string, in string format.

Parameters:
in_fFloat  Floating-point number to concatenate to the end of this string.
Returns:
SI_Error Error value indicating the success or failure of this command.
    Possible returns:
  • SI_SUCCESS - The string was concatenated properly.
Example:
                SIBCString * t_pMyString = SIBCString("FTK v");
                t_pMyString->Concat(3.6f);
                printf("This is %s\n", t_pMyString.GetText());

                // output is "This is FTK v3.6"

SI_Error CSIBCString::Concat const SI_Int    in_lInt
 

Concatenate in_lInt to the end of this string, in string format.

Parameters:
in_lInt  Integer to concatenate to the end of this string.
Returns:
SI_Error Error value indicating the success or failure of this command.
    Possible returns:
  • SI_SUCCESS - The string was concatenated properly.
Example:
                SIBCString * t_pMyString = SIBCString("FTK v");
                t_pMyString->Concat(3);
                t_pMyString->Concat(".");
                t_pMyString->Concat(6);
                printf("This is %s\n", t_pMyString.GetText());

                // output is "This is FTK v3.6"

SI_Error CSIBCString::Concat const SI_Char *    in_pString
 

Concatenate in_pString to the end of this string.

Parameters:
in_pString  Pointer to a character buffer to concatenate.
Returns:
SI_Error Error value indicating the success or failure of this command.
    Possible returns:
  • SI_SUCCESS - The string was concatenated properly.

SI_Error CSIBCString::Concat CSIBCString *    in_pString
 

Concatenate in_pString to the end of this string.

Parameters:
in_pString  Pointer to the string to concatenate.
Returns:
SI_Error Error value indicating the success or failure of this command.
    Possible returns:
  • SI_SUCCESS - The string was concatenated properly.

void CSIBCString::Dump  
 

Output debugging information for this string. This includes the address of the string, the length and contents of the string buffer.

SI_Int CSIBCString::GetLength  
 

Returns the length of the string.

Returns:
SI_Int The length of the string.

SI_Char * CSIBCString::GetText  
 

Returns a character buffer with the contents of the string. This buffer should not be modified, and does not need to be freed after use. This function is generally used to output the text contained within the string.

Returns:
SI_Char Pointer to a character buffer containing the string text.
Example:
                SIBCString * t_pMyString = new SIBCString("FTK");

                // This is OK.
                printf("I think that %s is the best!\n", t_pMyString->GetText());

                // This is wrong.
                printf("I think that %s is the best!\n", t_pMyString);

SI_Error CSIBCString::LowerCase  
 

Converts all alphabetic characters contained within this string to lower-case characters.

Returns:
SI_Error Error value indicating the success or failure of this command.
    Possible returns:
  • SI_SUCCESS - The string was assigned properly.

bool CSIBCString::operator!= CSIBCString &    i_pString
 

Inequality operator. Determines whether i_pString and this string contain different text.

Parameters:
i_pString  Reference to the string to compare to.
Returns:
bool true if string contain different text, false other.

CSIBCString & CSIBCString::operator= const SI_Char *    i_pString
 

Assignment operator. Copies the value of i_pString into this string.

Parameters:
i_pString  Pointer to the character buffer containing a NULL-terminated string whose value is copied into this string.
Returns:
CSIBCString& Reference to this string.

CSIBCString & CSIBCString::operator= const CSIBCString &    i_String
 

Assignment operator. Copies the value of i_pString into this string.

Parameters:
i_pString  String whose value is copied into this string.
Returns:
CSIBCString& Reference to this string.

bool CSIBCString::operator== const SI_Char *    i_pString
 

Equality operator. Determines whether i_pString and this string contain the same text.

Parameters:
i_pString  Pointer to the character buffer containing the NULL-terminated string to compare to.
Returns:
bool true if strings contain the same text, false otherwise.

bool CSIBCString::operator== CSIBCString &    i_pString
 

Equality operator. Determines whether i_pString and this string contain the same text.

Parameters:
i_pString  Reference to the string to compare to.
Returns:
bool true if strings contain the same text, false otherwise.

SI_Error CSIBCString::SetText const SI_Float    in_fFloat
 

Assigns the string representation of in_fFloat to this string.

Parameters:
in_fFloat  Floating-point number whose string representation should be assigned to this string
Returns:
SI_Error Error value indicating the success or failure of this command.
    Possible returns:
  • SI_SUCCESS - The string was assigned properly.

SI_Error CSIBCString::SetText const SI_Int    in_lInt
 

Assigns the string representation of in_lInt to this string.

Parameters:
in_lInt  Integer whose string representation should be assigned to this string
Returns:
SI_Error Error value indicating the success or failure of this command.
    Possible returns:
  • SI_SUCCESS - The string was assigned properly.

SI_Error CSIBCString::SetText const SI_Char *    in_pString
 

Assigns the NULL-terminated string contained in the character buffer in_pString to this string.

Parameters:
in_pString  Pointer to the character buffer containing the NULL-terminated string to assign.
Returns:
SI_Error Error value indicating the success or failure of this command.
    Possible returns:
  • SI_SUCCESS - The string was assigned properly.

SI_Error CSIBCString::SetText CSIBCString *    in_pString
 

Assigns the value contained in the string in_pString to this string.

Parameters:
in_pString  String containing data to assign to this string.
Returns:
SI_Error Error value indicating the success or failure of this command.
    Possible returns:
  • SI_SUCCESS - The string was assigned properly.

SI_Error CSIBCString::UpperCase  
 

Converts all alphabetic characters contained within this string to upper-case characters.

Returns:
SI_Error Error value indicating the success or failure of this command.
    Possible returns:
  • SI_SUCCESS - The string was assigned properly.

SI_UInt CSIBCString::UsedMemory  
 

Returns the amount of memory used by the string. This does not include the size of the SIBCString class, only the data contained in its character buffer. In SIBCString (but not necessarily in other classes) SIBCString::UsedMemory is equivalent to SIBCString::AllocatedMemory.

Returns:
SI_UInt Amount of memory used by this string (in bytes).


The documentation for this class was generated from the following files: © Copyright 2001-2003 Avid Technology, Inc. All rights reserved.

© Copyright 2001-2003 Avid Technology, Inc. All rights reserved.