Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Added ResetUnusedString to textprocessing.{cpp,h}
[xestiaab/.git] / source / common / textprocessing.h
1 // textprocessing.h - Text processing subroutines header.
2 //
3 // (c) 2012-2015 Xestia Software Development.
4 //
5 // This file is part of Xestia Address Book.
6 //
7 // Xestia Address Book is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License as published by the
9 // Free Software Foundation, version 3 of the license.
10 //
11 // Xestia Address Book is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
15 //
16 // You should have received a copy of the GNU General Public License along
17 // with Xestia Address Book. If not, see <http://www.gnu.org/licenses/>
19 #include <iostream>
20 #include <wx/wx.h>
21 #include <map>
23 #ifndef TEXTPROCESSING_H
24 #define TEXTPROCESSING_H
26 void EscapeString(wxString *ReceivedString, bool StripQuotes);
27 void GetEscapeString(wxTextCtrl *TextCtrl, wxString *ProcessString, bool StripQuotes);
28 void GetEscapeString(wxComboBox *ComboCtrl, wxString *ProcessString, bool StripQuotes);
29 void GetEscapeString(wxChoice *ChoiceCtrl, wxString *ProcessString, bool StripQuotes);
30 void CaptureString(wxString *ProcessString, bool StripQuotes);
31 void ResetUnusedString(wxString *ProcessString);
32 void ConvertToHTML(wxString *ProcessString);
34 void DeleteMapDataProcess(int IndexNum, std::map<int, std::string>* MapData);
35 void DeleteMapDataProcess(int IndexNum, std::map<int, wxString>* MapData);
36 void DeleteMapDataProcess(int IndexNum, std::map<int, bool>* MapData);
37 void DeleteMapDataProcess(int IndexNum, std::map<int, int>* MapData);
39 bool MapDataExists(int *ItemIndex, std::map<int,wxString> *MapPtr);
40 bool MapDataExists(int *ItemIndex, std::map<int,int> *MapPtr);
42 //void DeleteMapDataB() {};
44 //void DeleteMapData() {};
47 /*
48 template <typename ArgMap, typename... Args>
49 void DeleteMapData(ArgMap* ArgMapPtr, Args*... ArgsList){
51 }
52 */
56 /*
57 template<class T>
58 void test(const char* s, T t) {
59   while (*s) {
60     if (*s == '%' && *(++s) != '%') {
61       if (*s == '*') {
62         //throw std::runtime_error("Not enough parameters!");
63       } else {
64         std::cout << t;
65         test(++s);
66       }
67       return;
68     }
69     std::cout << *s++;
70   }
71   //throw std::logic_error("Too many arguments!");
72 }
76 template<class T, class U, class... Args>
77 void test(const char* s, T t, U u, Args... args) {
78   while (*s) {
79     if (*s == '%' && *(++s) != '%') {
80       if (*s == '*') {
81         int width = 0;
82 //      width = t;                // Uncommenting this would cause a failure if the parameters aren't all int's.
83         bitcopy(&width, &t);
84         std::cout << std::setw(width) << u;
85         test(s+2, args...);
86       } else {
87         std::cout << t;
88         test(++s, u, args...);
89       }
90       return;
91     }
92     std::cout << *s++;
93   }
94   //throw std::logic_error("Too many arguments!");
95 }
96 */
97 /*
100 template<typename... Args>
101 void DeleteMapData(int IndexNum, Args*... args) {
103         //DeleteMapDataProcess(IndexNum, t);
105         intSeekSelectedData = IndexNum;
106         DeleteMapDataB(args...);
108   //throw std::logic_error("Too many arguments!");
111 */
113 //void DeleteMapDataB() { };
115 template<typename MapData, typename... Args>
116 void DeleteMapDataB(MapData* mapdata, Args*... args) {
118         DeleteMapDataB(args...);
122 template<typename... Args>
123 void DeleteMapData(int IndexNum, Args*... args) {
125         //int intSeekSelectedData = 0;
127         //DeleteMapDataProcess(IndexNum, Moo);
129         //intSeekSelectedData = IndexNum;
130         DeleteMapDataB(args...);
131         
134 //void DeleteMapData<ArgMap, Args>(ArgMap* ArgMapPtr, Args*... ArgsList);
136 #endif 
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