mimedump.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef __BARRY_TOOLS_MIMEDUMP_H__
00023 #define __BARRY_TOOLS_MIMEDUMP_H__
00024
00025 template <class Record>
00026 class MimeDump
00027 {
00028 public:
00029 static void Dump(std::ostream &os, const Record &rec)
00030 {
00031 os << rec << std::endl;
00032 }
00033
00034 static bool Supported() { return false; }
00035 };
00036
00037 template <>
00038 class MimeDump<Barry::Contact>
00039 {
00040 public:
00041 static void Dump(std::ostream &os, const Barry::Contact &rec)
00042 {
00043 Barry::Sync::vCard vcard;
00044 os << vcard.ToVCard(rec) << std::endl;
00045 }
00046
00047 static bool Supported() { return true; }
00048 };
00049
00050 template <>
00051 class MimeDump<Barry::Calendar>
00052 {
00053 public:
00054 static void Dump(std::ostream &os, const Barry::Calendar &rec)
00055 {
00056 Barry::Sync::vTimeConverter vtc;
00057 Barry::Sync::vCalendar vcal(vtc);
00058 os << vcal.ToVCal(rec) << std::endl;
00059 }
00060
00061 static bool Supported() { return true; }
00062 };
00063
00064 template <>
00065 class MimeDump<Barry::Memo>
00066 {
00067 public:
00068 static void Dump(std::ostream &os, const Barry::Memo &rec)
00069 {
00070 Barry::Sync::vJournal vjournal;
00071 os << vjournal.ToMemo(rec) << std::endl;
00072 }
00073
00074 static bool Supported() { return true; }
00075 };
00076
00077 template <>
00078 class MimeDump<Barry::Task>
00079 {
00080 public:
00081 static void Dump(std::ostream &os, const Barry::Task &rec)
00082 {
00083 Barry::Sync::vTimeConverter vtc;
00084 Barry::Sync::vTodo vtodo(vtc);
00085 os << vtodo.ToTask(rec) << std::endl;
00086 }
00087
00088 static bool Supported() { return true; }
00089 };
00090
00091 #endif
00092