Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Initial import of code already done for Xestia Address Book
[xestiaab/.git] / source / common / textprocessing.h
1 #include <iostream>
2 #include <wx/wx.h>
3 #include <map>
5 #ifndef TEXTPROCESSING_H
6 #define TEXTPROCESSING_H
8 void EscapeString(wxString *ReceivedString, bool StripQuotes);
9 void GetEscapeString(wxTextCtrl *TextCtrl, wxString *ProcessString, bool StripQuotes);
10 void GetEscapeString(wxComboBox *ComboCtrl, wxString *ProcessString, bool StripQuotes);
11 void GetEscapeString(wxChoice *ChoiceCtrl, wxString *ProcessString, bool StripQuotes);
12 void CaptureString(wxString *ProcessString, bool StripQuotes);
13 void ConvertToHTML(wxString *ProcessString);
15 void DeleteMapDataProcess(int IndexNum, std::map<int, std::string>* MapData);
16 void DeleteMapDataProcess(int IndexNum, std::map<int, wxString>* MapData);
17 void DeleteMapDataProcess(int IndexNum, std::map<int, bool>* MapData);
18 void DeleteMapDataProcess(int IndexNum, std::map<int, int>* MapData);
20 //void DeleteMapDataB() {};
22 //void DeleteMapData() {};
25 /*
26 template <typename ArgMap, typename... Args>
27 void DeleteMapData(ArgMap* ArgMapPtr, Args*... ArgsList){
29 }
30 */
34 /*
35 template<class T>
36 void test(const char* s, T t) {
37   while (*s) {
38     if (*s == '%' && *(++s) != '%') {
39       if (*s == '*') {
40         //throw std::runtime_error("Not enough parameters!");
41       } else {
42         std::cout << t;
43         test(++s);
44       }
45       return;
46     }
47     std::cout << *s++;
48   }
49   //throw std::logic_error("Too many arguments!");
50 }
54 template<class T, class U, class... Args>
55 void test(const char* s, T t, U u, Args... args) {
56   while (*s) {
57     if (*s == '%' && *(++s) != '%') {
58       if (*s == '*') {
59         int width = 0;
60 //      width = t;                // Uncommenting this would cause a failure if the parameters aren't all int's.
61         bitcopy(&width, &t);
62         std::cout << std::setw(width) << u;
63         test(s+2, args...);
64       } else {
65         std::cout << t;
66         test(++s, u, args...);
67       }
68       return;
69     }
70     std::cout << *s++;
71   }
72   //throw std::logic_error("Too many arguments!");
73 }
74 */
75 /*
78 template<typename... Args>
79 void DeleteMapData(int IndexNum, Args*... args) {
81         //DeleteMapDataProcess(IndexNum, t);
83         intSeekSelectedData = IndexNum;
84         DeleteMapDataB(args...);
86   //throw std::logic_error("Too many arguments!");
87 }
89 */
91 //void DeleteMapDataB() { };
93 template<typename MapData, typename... Args>
94 void DeleteMapDataB(MapData* mapdata, Args*... args) {
96         DeleteMapDataB(args...);
98 }
100 template<typename... Args>
101 void DeleteMapData(int IndexNum, Args*... args) {
103         //int intSeekSelectedData = 0;
105         //DeleteMapDataProcess(IndexNum, Moo);
107         //intSeekSelectedData = IndexNum;
108         DeleteMapDataB(args...);
109         
112 //void DeleteMapData<ArgMap, Args>(ArgMap* ArgMapPtr, Args*... ArgsList);
114 #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