Page MenuHomePhorge

kolabformat.cpp
No OneTemporary

Authored By
Unknown
Size
3 KB
Referenced Files
None
Subscribers
None

kolabformat.cpp

/*
* Copyright (C) 2011 Christian Mollekopf <mollekopf@kolabsys.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "kolabformat.h"
#include <iostream>
#include "xcalconversions.h"
#include "xcardconversions.h"
#include "utils.h"
#include "kolabconversions.h"
namespace Kolab {
ErrorSeverity error()
{
return Utils::getError();
}
std::string errorMessage()
{
return Utils::getErrorMessage();
}
std::string productId()
{
return Utils::productId();
}
std::string xCalVersion()
{
return XCAL::global_xCalVersion;
}
std::string xKolabVersion()
{
return Utils::kolabVersion();
}
std::string getSerializedUID()
{
return Utils::createdUid();
}
void overrideTimestamp(const cDateTime& dt)
{
Utils::setOverrideTimestamp(dt);
}
Kolab::Event readEvent(const std::string& s, bool isUrl)
{
Kolab::XCAL::IncidenceTrait <Kolab::Event >::IncidencePtr ptr = XCAL::deserializeIncidence< XCAL::IncidenceTrait<Kolab::Event> >(s, isUrl);
if (!ptr.get()) {
return Kolab::Event();
}
return *ptr;
}
std::string writeEvent(const Kolab::Event &event)
{
return XCAL::serializeIncidence< XCAL::IncidenceTrait<Kolab::Event> >(event);
}
Kolab::Todo readTodo(const std::string& s, bool isUrl)
{
XCAL::IncidenceTrait<Kolab::Todo>::IncidencePtr ptr = XCAL::deserializeIncidence< XCAL::IncidenceTrait<Kolab::Todo> >(s, isUrl);
if (!ptr.get()) {
return Kolab::Todo();
}
return *ptr;
}
std::string writeTodo(const Kolab::Todo &event)
{
return XCAL::serializeIncidence< XCAL::IncidenceTrait<Kolab::Todo> >(event);
}
Journal readJournal(const std::string& s, bool isUrl)
{
XCAL::IncidenceTrait<Kolab::Journal>::IncidencePtr ptr = XCAL::deserializeIncidence<XCAL::IncidenceTrait<Kolab::Journal> >(s, isUrl);
if (!ptr.get()) {
return Kolab::Journal();
}
return *ptr;
}
std::string writeJournal(const Kolab::Journal &j)
{
return XCAL::serializeIncidence<XCAL::IncidenceTrait<Kolab::Journal> >(j);
}
Kolab::Contact readContact(const std::string& s, bool isUrl)
{
boost::shared_ptr <Kolab::Contact > ptr = XCARD::deserializeCard<Kolab::Contact>(s, isUrl);
if (!ptr.get()) {
return Kolab::Contact();
}
return *ptr;
}
std::string writeContact(const Contact &contact)
{
return XCARD::serializeCard(contact);
}
DistList readDistlist(const std::string& s, bool isUrl)
{
boost::shared_ptr <Kolab::DistList> ptr = XCARD::deserializeCard<Kolab::DistList>(s, isUrl);
if (!ptr.get()) {
return Kolab::DistList();
}
return *ptr;
}
std::string writeDistlist(const DistList &list)
{
return XCARD::serializeCard(list);
}
Note readNote(const std::string& s, bool isUrl)
{
boost::shared_ptr <Kolab::Note> ptr = Kolab::KolabObjects::deserializeObject<Kolab::Note>(s, isUrl);
if (!ptr.get()) {
return Kolab::Note();
}
return *ptr;
return Note();
}
std::string writeNote(const Note &note)
{
return Kolab::KolabObjects::serializeObject<Kolab::Note>(note);
}
Configuration readConfiguration(const std::string& /*s*/, bool /*isUrl*/)
{
// boost::shared_ptr <Kolab::Configuration> ptr = deserializeConfiguration(s, isUrl);
// if (!ptr.get()) {
// return Kolab::Configuration();
// }
// return *ptr;
return Configuration();
}
std::string writeConfiguration(const Configuration &/*config*/)
{
// return serializeConfiguration(config);
return std::string();
}
}

File Metadata

Mime Type
text/x-c++
Expires
Mon, Apr 6, 2:57 AM (2 w, 4 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
05/18/c41297cca19246501f882679f672
Default Alt Text
kolabformat.cpp (3 KB)

Event Timeline