// textprocessing.h - Text processing subroutines header. // // (c) 2012-2015 Xestia Software Development. // // This file is part of Xestia Address Book. // // Xestia Address Book is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by the // Free Software Foundation, version 3 of the license. // // Xestia Address Book is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with Xestia Address Book. If not, see #include #include #include #ifndef TEXTPROCESSING_H #define TEXTPROCESSING_H void EscapeString(wxString *ReceivedString, bool StripQuotes); void GetEscapeString(wxTextCtrl *TextCtrl, wxString *ProcessString, bool StripQuotes); void GetEscapeString(wxComboBox *ComboCtrl, wxString *ProcessString, bool StripQuotes); void GetEscapeString(wxChoice *ChoiceCtrl, wxString *ProcessString, bool StripQuotes); void CaptureString(wxString *ProcessString, bool StripQuotes); void ResetUnusedString(wxString *ProcessString); void ConvertToHTML(wxString *ProcessString); void DeleteMapDataProcess(int IndexNum, std::map* MapData); void DeleteMapDataProcess(int IndexNum, std::map* MapData); void DeleteMapDataProcess(int IndexNum, std::map* MapData); void DeleteMapDataProcess(int IndexNum, std::map* MapData); bool MapDataExists(int *ItemIndex, std::map *MapPtr); bool MapDataExists(int *ItemIndex, std::map *MapPtr); wxString OutputText(wxString *TextInput); //void DeleteMapDataB() {}; //void DeleteMapData() {}; /* template void DeleteMapData(ArgMap* ArgMapPtr, Args*... ArgsList){ } */ /* template void test(const char* s, T t) { while (*s) { if (*s == '%' && *(++s) != '%') { if (*s == '*') { //throw std::runtime_error("Not enough parameters!"); } else { std::cout << t; test(++s); } return; } std::cout << *s++; } //throw std::logic_error("Too many arguments!"); } template void test(const char* s, T t, U u, Args... args) { while (*s) { if (*s == '%' && *(++s) != '%') { if (*s == '*') { int width = 0; // width = t; // Uncommenting this would cause a failure if the parameters aren't all int's. bitcopy(&width, &t); std::cout << std::setw(width) << u; test(s+2, args...); } else { std::cout << t; test(++s, u, args...); } return; } std::cout << *s++; } //throw std::logic_error("Too many arguments!"); } */ /* template void DeleteMapData(int IndexNum, Args*... args) { //DeleteMapDataProcess(IndexNum, t); intSeekSelectedData = IndexNum; DeleteMapDataB(args...); //throw std::logic_error("Too many arguments!"); } */ //void DeleteMapDataB() { }; template void DeleteMapDataB(MapData* mapdata, Args*... args) { DeleteMapDataB(args...); } template void DeleteMapData(int IndexNum, Args*... args) { //int intSeekSelectedData = 0; //DeleteMapDataProcess(IndexNum, Moo); //intSeekSelectedData = IndexNum; DeleteMapDataB(args...); } //void DeleteMapData(ArgMap* ArgMapPtr, Args*... ArgsList); #endif