# vjournal.h

    00001 //
    00002 // \file        vjournal.h
    00003 //              Conversion routines for vjournals (VCALENDAR, etc)
    00004 //
    00005
    00006 /*
    00007     Copyright (C) 2008-2009, Nicolas VIVIEN
    00008     Copyright (C) 2006-2011, Net Direct Inc. (http://www.netdirect.ca/)
    00009
    00010     This program is free software; you can redistribute it and/or modify
    00011     it under the terms of the GNU General Public License as published by
    00012     the Free Software Foundation; either version 2 of the License, or
    00013     (at your option) any later version.
    00014
    00015     This program is distributed in the hope that it will be useful,
    00016     but WITHOUT ANY WARRANTY; without even the implied warranty of
    00017     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    00018
    00019     See the GNU General Public License in the COPYING file at the
    00020     root directory of this project for more details.
    00021 */
    00022
    00023 #ifndef __BARRY_SYNC_VJOURNAL_H__
    00024 #define __BARRY_SYNC_VJOURNAL_H__
    00025
    00026 #include "dll.h"
    00027 #include "vbase.h"
    00028 #include "vformat.h"
    00029 #include "r_memo.h"
    00030 #include <stdint.h>
    00031 #include <string>
    00032
    00033 namespace Barry { namespace Sync {
    00034
    00035 //
    00036 // vJournal
    00037 //
    00038 /// Class for converting between RFC 2445 iCalendar data format,
    00039 /// and the Barry::Memo class.
    00040 ///
    00041 class BXEXPORT vJournal : public vBase
    00042 {
    00043         // data to pass to external requests
    00044         char *m_gJournalData;   // dynamic memory returned by vformat()... can
    00045                                 // be used directly by the plugin, without
    00046                                 // overmuch allocation and freeing (see Extract())
    00047         std::string m_vJournalData;     // copy of m_gJournalData, for C++ use
    00048         Barry::Memo m_BarryMemo;
    00049
    00050 protected:
    00051         bool HasMultipleVJournals() const;
    00052
    00053 public:
    00054         vJournal();
    00055         ~vJournal();
    00056
    00057         const std::string&      ToMemo(const Barry::Memo &memo);
    00058         const Barry::Memo&      ToBarry(const char *vjournal, uint32_t RecordId);
    00059
    00060         char* ExtractVJournal();
    00061
    00062         void Clear();
    00063
    00064         // This is the v-name of the innermost BEGIN/END block
    00065         static const char* GetVName() { return "VJOURNAL"; }
    00066 };
    00067
    00068 }} // namespace Barry::Sync
    00069
    00070 #endif
    00071