summaryrefslogtreecommitdiffstats
blob: a4d2d6596a8c42e072f704c224bc042bb5280197 (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
/*
 * Copyright (c) 2010-2016 Isode Limited.
 * All rights reserved.
 * See the COPYING file for more information.
 */

#pragma once

#include <map>
#include <string>

#include <boost/optional.hpp>

#include <Swiften/Base/API.h>
#include <Swiften/Base/ByteArray.h>

namespace Swift {
    class SWIFTEN_API DIGESTMD5Properties {
        public:
            DIGESTMD5Properties();

            boost::optional<std::string> getValue(const std::string& key) const;

            void setValue(const std::string& key, const std::string& value);

            ByteArray serialize() const;

            static DIGESTMD5Properties parse(const ByteArray&);

        private:
            static bool isQuoted(const std::string& property);

        private:
            typedef std::multimap<std::string, ByteArray> DIGESTMD5PropertiesMap;
            DIGESTMD5PropertiesMap properties;
    };
}