void EscapeString(wxString *ReceivedString, bool StripQuotes)
{
+ // Escape a string that contains escapable characters.
+
ReceivedString->Replace(wxT("\\"), wxT("\\\\"), TRUE);
ReceivedString->Replace(wxT(","), wxT("\\,"), TRUE);
ReceivedString->Replace(wxT(";"), wxT("\\;"), TRUE);
void GetEscapeString(wxTextCtrl *TextCtrl, wxString *ProcessString, bool StripQuotes)
{
+ // Get an escaped string from a wxTextCtrl.
+
*ProcessString = TextCtrl->GetValue();
EscapeString(ProcessString, StripQuotes);
void GetEscapeString(wxComboBox *ComboCtrl, wxString *ProcessString, bool StripQuotes)
{
+ // Get an escaped string from a wxComboBox.
+
*ProcessString = ComboCtrl->GetValue();
EscapeString(ProcessString, StripQuotes);
void GetEscapeString(wxChoice *ChoiceCtrl, wxString *ProcessString, bool StripQuotes)
{
+ // Get an escaped string from a wxChoice.
+
*ProcessString = ChoiceCtrl->GetString(ChoiceCtrl->GetSelection());
EscapeString(ProcessString, StripQuotes);
void CaptureString(wxString *ProcessString, bool StripQuotes)
{
+ // Capture a string for processing.
+
ProcessString->Replace(wxT("\\n"), wxT("\n"), TRUE);
ProcessString->Replace(wxT("\\;"), wxT(";"), TRUE);
ProcessString->Replace(wxT("\\,"), wxT(","), TRUE);
void ResetUnusedString(wxString *ProcessString)
{
+ // Reset an unused string.
+
ProcessString->Replace(wxT("\\\\"), wxT("\\"), TRUE);
ProcessString->Replace(wxT("\n"), wxT(""), TRUE);
ProcessString->Replace(wxT("\\;"), wxT(";"), TRUE);
void ConvertToHTML(wxString *ProcessString)
{
+ // Convert string into text that can be used with a
+ // wxHTMLWindow.
+
ProcessString->Replace(wxT("&"), wxT("&"), TRUE);
ProcessString->Replace(wxT("<"), wxT("<"), TRUE);
ProcessString->Replace(wxT(">"), wxT(">"), TRUE);
}
void DeleteMapDataProcess(int IndexNum, std::map<int, std::string>* MapData){
+
+ // Delete map data (for map<int,string>).
+
MapData->erase(IndexNum);
+
}
void DeleteMapDataProcess(int IndexNum, std::map<int, wxString>* MapData){
+
+ // Delete map data (for map<int,wxString>).
+
MapData->erase(IndexNum);
+
}
void DeleteMapDataProcess(int IndexNum, std::map<int, int>* MapData){
+
+ // Delete map data (for map<int,int>).
+
MapData->erase(IndexNum);
+
}
void DeleteMapDataProcess(int IndexNum, std::map<int, bool>* MapData){
+
+ // Delete map data (for map<int,bool>).
+
MapData->erase(IndexNum);
+
}
bool MapDataExists(int *ItemIndex, std::map<int,wxString> *MapPtr){
+ // Check if map data exists (for map<int,wxString>).
+
if (MapPtr->find(*ItemIndex) == MapPtr->end()){
return FALSE;
bool MapDataExists(int *ItemIndex, std::map<int,int> *MapPtr){
+ // Check if map data exists (for map<int,int>).
+
if (MapPtr->find(*ItemIndex) == MapPtr->end()){
return FALSE;