desktop: added Evolution3.6 support to EvoSources.cc
[barry.git] / desktop / src / blistevo.cc
blobbf9832b946dd779f25e40d6d81589327e396781c
1 ///
2 /// \file blistevo.cc
3 /// Command line test tool for EvoSources
4 ///
6 /*
7 Copyright (C) 2011-2012, Net Direct Inc. (http://www.netdirect.ca/)
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU General Public License in the COPYING file at the
19 root directory of this project for more details.
22 #include "EvoSources.h"
23 #include <iostream>
24 #include "i18n.h"
26 using namespace std;
28 void DumpItems(const EvoSources::List &list)
30 EvoSources::List::const_iterator i;
31 for( i = list.begin(); i != list.end(); ++i ) {
32 cout << " "
33 << i->m_GroupName << ", "
34 << i->m_SourceName << ", "
35 << i->m_SourcePath << endl;
39 int main()
41 setlocale(LC_ALL, "");
42 INIT_I18N();
44 const char *separator = "\n-----------------------------------------\n";
46 EvoSources es;
47 cout << "\n" << _C("Addressbook:") << separator;
48 DumpItems(es.GetAddressBook());
49 cout << "\n" << _C("Events:") << separator;
50 DumpItems(es.GetEvents());
51 cout << "\n" << _C("Tasks:") << separator;
52 DumpItems(es.GetTasks());
53 cout << "\n" << _C("Memos:") << separator;
54 DumpItems(es.GetMemos());
56 cout << "Defaultable: " << (es.IsDefaultable() ? "Yes" : "No") << endl;
57 if( es.GetErrorMsg().size() ) {
58 cout << "Error during detect: " << es.GetErrorMsg() << endl;