Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Added the convert subroutine and initial unit tests. The convert subroutine is run...
[xestiaab/.git] / source / convert.cpp
1 // convert.h - Convert subroutines.
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 "convert.h"
21 ConvertResult ConvertContact(wxString InputFormat, wxString OutputFormat, 
22         wxString InputFilename, wxString OutputFilename){
24         std::vector<wxString> ValidFormats = { 
25                 wxT("vCard3"),
26                 wxT("vCard4") 
27         };
29         bool ValidImport = false;
30         bool ValidOutput = false;
32         // Check that the input format is valid.
34         for (long l = 0; l < ValidFormats.size(); l++){
35         
36                 if (InputFormat == ValidFormats[l]){
37                         ValidImport = true;
38                         break;
39                 }
40         
41         }
42         
43         if (ValidImport == false){
44         
45                 return CONVERTRESULT_INVALIDIMPORTFORMAT;
46         
47         }
49         if (InputFormat == OutputFormat){
50         
51                 return CONVERTRESULT_FORMATSSAME;
52         
53         }
54         
55         // Check that the output format is valid.
57         return CONVERTRESULT_OK;
58         
59 }
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