Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

utils_string Class Reference

A static-only class for utils for string management and conversion. More...

#include <utils_string.h>

List of all members.


Static Public Methods

void  string_to_arrayint (wxString input_string, wxChar delimiter, wxArrayInt *output_arrayint, bool ignore_trailing_delimiter)
  Converts a wxString to a wxArrayInt, based on the delimiter.

wxString  arrayint_to_string (wxArrayInt &input_arrayint, wxChar delimiter)
  Coverts a wxArrayInt to a wxString, separated by the delimiter.

void  string_to_arraystring (wxString input_string, wxChar delimiter, wxArrayString *output_arraystring, bool ignore_trailing_delimiter)
  Converts a wxString to a wxArrayString, based on the delimiter.

wxString  arraystring_to_string (wxArrayString &input_arraystring, wxChar delimiter)
  Coverts a wxArrayString to a wxString, separated by the delimiter.

void  string_array_to_arraystring (int array_size, const wxString input_string_array[], wxArrayString *output_arraystring)
  Converts a wxString[] array to a wxArrayString.

void  arraystring_to_string_array (const wxArrayString &input_arraystring, wxString output_string_array[])
  Converts a wxArrayString to a wxString[] array.

wxString  color_to_hex_string (wxColor input_color)
  Takes a wxColor type and converts it to a string like 'ffffff',.

wxColor  hex_string_to_color (wxString input_string)
  Takes a string of a hex color, and converts it to a wxColor,.

bool  is_valid_hex_color_string (wxString input_string)
  Checks to see whether the string is a valid hex color string.

wxString  remove_illegal_characters (const wxString &input_string, const wxString &legal_characters)
  Removes any characters from a string that aren't in the list of legal characters.

wxString  remove_trailing_dir_separator (const wxString &input_directory)
  Removes a trailing dir separator from a directory string, if there was one.

void  helper_arraystring_to_string_array (const wxArrayString &input_arraystring, wxString **choices)
  Helper function for arraystring_to_string_array.


Detailed Description

A static-only class for utils for string management and conversion.

Member Function Documentation

wxString utils_string::arrayint_to_string wxArrayInt &    input_arrayint,
wxChar    delimiter
[static]
 

Coverts a wxArrayInt to a wxString, separated by the delimiter.

Parameters:
input_arraystring  The wxArrayString to be converted.
delimiter  The single character delimiter to put between each items.
Returns :
A string of the array items, each separated by the delimiter.
wxString utils_string::arraystring_to_string wxArrayString &    input_arraystring,
wxChar    delimiter
[static]
 

Coverts a wxArrayString to a wxString, separated by the delimiter.

Parameters:
input_arraystring  The wxArrayString to be converted.
delimiter  The single character delimiter to put between each items.
Returns :
A string of the array items, each separated by the delimiter.
wxString utils_string::color_to_hex_string wxColor    input_color [static]
 

Takes a wxColor type and converts it to a string like 'ffffff',.

Parameters:
input_color  The wxColor object to convert.
Returns :
A hex color string, including a preceeding # .
wxColor utils_string::hex_string_to_color wxString    input_string [static]
 

Takes a string of a hex color, and converts it to a wxColor,.

Parameters:
input_string  A hex color string, including a preceeding # .
Returns :
The wxColor object to convert
bool utils_string::is_valid_hex_color_string wxString    input_string [static]
 

Checks to see whether the string is a valid hex color string.

Valid means of the form 'ffffff', ( with a preceeding # ).

Parameters:
input_string  A hex color string, including a preceeding # .
Returns :
TRUE if the hex color string is valid.
wxString utils_string::remove_illegal_characters const wxString &    input_string,
const wxString &    legal_characters
[static]
 

Removes any characters from a string that aren't in the list of legal characters.

Parameters:
input_string  An input string that should be stripped.
legal_characters  A list of legal characters allowed in the string. For example "ABCDEFGHI1234567_-".
Returns :
The string with the illegal characters removed.
wxString utils_string::remove_trailing_dir_separator const wxString &    input_directory [static]
 

Removes a trailing dir separator from a directory string, if there was one.

Needed since top-level directories returned from a wxDirDialog have a trailing dir separator. Such as in a '/' on Linus and 'C:\' on MSW.

Parameters:
input_directory  An input directory string that should be stripped.
Returns :
The directory string with the trainling dir separator removed.
void utils_string::string_array_to_arraystring int    array_size,
const wxString    input_string_array[],
wxArrayString *    output_arraystring
[static]
 

Converts a wxString[] array to a wxArrayString.

Parameters:
array_size  The size of the wxString[] array.
input_stringarray  The wxString[] to be converted.
output_arraystring  wxArrayString to hold the output.
void utils_string::string_to_arrayint wxString    input_string,
wxChar    delimiter,
wxArrayInt *    output_arrayint,
bool    ignore_trailing_delimiter
[static]
 

Converts a wxString to a wxArrayInt, based on the delimiter.

Parameters:
input_string  A string of the array items, each separated by the delimiter.
delimiter  The single character delimiter that is between each item.
output_arrayint  The wxArrayInt to place the converted string's values.
ignore_trailing_delimiter  TRUE if a trailing delimiter should be ignored. This prevents an empty element at the end of an array if there was a delimiter at end of the string.
void utils_string::string_to_arraystring wxString    input_string,
wxChar    delimiter,
wxArrayString *    output_arraystring,
bool    ignore_trailing_delimiter
[static]
 

Converts a wxString to a wxArrayString, based on the delimiter.

Parameters:
input_string  A string of the array items, each separated by the delimiter.
delimiter  The single character delimiter that is between each item.
output_arraystring  The wxArrayString to place the converted string's values.
ignore_trailing_delimiter  TRUE if a trailing delimiter should be ignored. This prevents an empty element at the end of an array if there was a delimiter at end of the string.