Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Move INSTALL, LICENSE, README, THANKS and TODO into root directory
[xestiaab/.git] / source / common / textprocessing.cpp
index aeec7a8..2a61591 100644 (file)
@@ -26,6 +26,8 @@
 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);
@@ -43,6 +45,8 @@ void EscapeString(wxString *ReceivedString, bool StripQuotes)
 void GetEscapeString(wxTextCtrl *TextCtrl, wxString *ProcessString, bool StripQuotes)
 {
 
+       // Get an escaped string from a wxTextCtrl.
+
        *ProcessString = TextCtrl->GetValue();
        EscapeString(ProcessString, StripQuotes);
 
@@ -51,6 +55,8 @@ void GetEscapeString(wxTextCtrl *TextCtrl, wxString *ProcessString, bool StripQu
 void GetEscapeString(wxComboBox *ComboCtrl, wxString *ProcessString, bool StripQuotes)
 {
 
+       // Get an escaped string from a wxComboBox.
+
        *ProcessString = ComboCtrl->GetValue();
        EscapeString(ProcessString, StripQuotes);
 
@@ -59,6 +65,8 @@ void GetEscapeString(wxComboBox *ComboCtrl, wxString *ProcessString, bool StripQ
 void GetEscapeString(wxChoice *ChoiceCtrl, wxString *ProcessString, bool StripQuotes)
 {
 
+       // Get an escaped string from a wxChoice.
+
        *ProcessString = ChoiceCtrl->GetString(ChoiceCtrl->GetSelection());
        EscapeString(ProcessString, StripQuotes);
 
@@ -67,6 +75,8 @@ void GetEscapeString(wxChoice *ChoiceCtrl, wxString *ProcessString, bool StripQu
 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);
@@ -83,8 +93,10 @@ void CaptureString(wxString *ProcessString, bool StripQuotes)
 void ResetUnusedString(wxString *ProcessString)
 {
 
+       // Reset an unused string.
+
        ProcessString->Replace(wxT("\\\\"), wxT("\\"), TRUE);
-       ProcessString->Replace(wxT("\n"), wxT(""), TRUE);
+       ProcessString->Replace(wxT("\\n"), wxT("\n"), TRUE);
        ProcessString->Replace(wxT("\\;"), wxT(";"), TRUE);
        ProcessString->Replace(wxT("\\,"), wxT(","), TRUE);
 
@@ -93,6 +105,9 @@ void ResetUnusedString(wxString *ProcessString)
 void ConvertToHTML(wxString *ProcessString)
 {
 
+       // Convert string into text that can be used with a 
+       // wxHTMLWindow.
+
        ProcessString->Replace(wxT("&"), wxT("&"), TRUE);
        ProcessString->Replace(wxT("<"), wxT("&lt;"), TRUE);
        ProcessString->Replace(wxT(">"), wxT("&gt;"), TRUE);
@@ -101,23 +116,41 @@ void ConvertToHTML(wxString *ProcessString)
 }
 
 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;
@@ -132,6 +165,8 @@ bool MapDataExists(int *ItemIndex, std::map<int,wxString> *MapPtr){
 
 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;
@@ -144,18 +179,42 @@ bool MapDataExists(int *ItemIndex, std::map<int,int> *MapPtr){
 
 }
 
-/*
-template <typename ArgMap, typename... Args>
-void DeleteMapData(ArgMap* ArgMapPtr, Args*... ArgsList){
-
-       //DeleteMapDataProcess(ArgMapPtr);
-
-       DeleteMapData(ArgsList...);
-
-}
-*/
-/*
-void test(int* x) {
+wxString OutputText(wxString *TextInput){
+       
+       wxString OutputTextData;
+       wxString OutputLine;
+       int CharSeek = 0;
+       int LineSeek = 0;
+       int MaxLineSeek = 77;
+       
+       for (CharSeek = 0; CharSeek < TextInput->size(); CharSeek++){
+               
+               LineSeek++;
+               
+               if (LineSeek == MaxLineSeek){
+
+                       if (TextInput->substr(CharSeek, 1) != "\n"){
+                               OutputLine += TextInput->substr(CharSeek, 1);
+                       }
+                       OutputLine += "\n";
+                       OutputTextData += OutputLine;
+                       OutputLine = " ";
+                       LineSeek = 0;
+                       MaxLineSeek = 76;
+                       continue;
+                       
+               }
+               
+               OutputLine += TextInput->substr(CharSeek, 1);
+               
+       }
 
-}
-*/
\ No newline at end of file
+       if (OutputLine != " " && OutputLine != " \n"){
+       
+               OutputTextData += OutputLine;
+               
+       }
+       
+       return OutputTextData;
+       
+}
\ No newline at end of file
Xestia Software Development
Yn Maystri
© 2006 - 2019 Xestia Software Development
Software

Xestia Address Book
Xestia Calendar
Development

Xestia Gelforn
Everything else

About
News
Privacy Policy