summaryrefslogtreecommitdiff
path: root/src/backends/webdav/CalDAVVxxSource.cpp
blob: 977e50d914a9073d67577c346928ef43907fa767 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/*
 * Copyright (C) 2010 Intel Corporation
 */

#include "CalDAVVxxSource.h"

#ifdef ENABLE_DAV

#include <syncevo/declarations.h>
SE_BEGIN_CXX

// TODO: use EDS backend icalstrdup.c
#define ical_strdup(_x) (_x)

CalDAVVxxSource::CalDAVVxxSource(const std::string &content,
                                 const SyncSourceParams &params,
                                 const boost::shared_ptr<Neon::Settings> &settings) :
    WebDAVSource(params, settings),
    m_content(content)
{
    SyncSourceLogging::init(InitList<std::string>("SUMMARY") + "LOCATION",
                            " ",
                            m_operations);
}

std::string CalDAVVxxSource::getDescription(const string &luid)
{
    // TODO
    return "";
}

bool CalDAVVxxSource::typeMatches(const StringMap &props) const
{
    std::string davcomp = StringPrintf("<urn:ietf:params:xml:ns:caldavcomp name='%s'></urn:ietf:params:xml:ns:caldavcomp>",
                                       m_content.c_str());

    StringMap::const_iterator it = props.find("urn:ietf:params:xml:ns:caldav:supported-calendar-component-set");
    if (it != props.end() &&
        it->second.find(davcomp) != std::string::npos) {
        return true;
    } else {
        return false;
    }
}

SE_END_CXX

#endif // ENABLE_DAV