3 /// Overloaded templates for handling Mime output
7 Copyright (C) 2010-2011, 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 #ifndef __BARRY_TOOLS_MIMEDUMP_H__
23 #define __BARRY_TOOLS_MIMEDUMP_H__
25 template <class Record
>
29 static void Dump(std::ostream
&os
, const Record
&rec
)
31 os
<< rec
<< std::endl
;
34 static bool Supported() { return false; }
38 class MimeDump
<Barry::Contact
>
41 static void Dump(std::ostream
&os
, const Barry::Contact
&rec
)
43 Barry::Sync::vCard vcard
;
44 os
<< vcard
.ToVCard(rec
) << std::endl
;
47 static bool Supported() { return true; }
51 class MimeDump
<Barry::Calendar
>
54 static void Dump(std::ostream
&os
, const Barry::Calendar
&rec
)
56 Barry::Sync::vTimeConverter vtc
;
57 Barry::Sync::vCalendar
vcal(vtc
);
58 os
<< vcal
.ToVCal(rec
) << std::endl
;
61 static bool Supported() { return true; }
65 class MimeDump
<Barry::Memo
>
68 static void Dump(std::ostream
&os
, const Barry::Memo
&rec
)
70 Barry::Sync::vTimeConverter vtc
;
71 Barry::Sync::vJournal
vjournal(vtc
);
72 os
<< vjournal
.ToMemo(rec
) << std::endl
;
75 static bool Supported() { return true; }
79 class MimeDump
<Barry::Task
>
82 static void Dump(std::ostream
&os
, const Barry::Task
&rec
)
84 Barry::Sync::vTimeConverter vtc
;
85 Barry::Sync::vTodo
vtodo(vtc
);
86 os
<< vtodo
.ToTask(rec
) << std::endl
;
89 static bool Supported() { return true; }