[ExecString] combine SplitParameters with identical function of CUtil
[xbmc.git] / xbmc / DbUrl.h
blobbb9be82608013508b09ffa35c0a74ab7c41a123e
1 /*
2 * Copyright (C) 2012-2018 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
7 */
9 #pragma once
11 #include "URL.h"
12 #include "utils/UrlOptions.h"
14 #include <string>
16 class CVariant;
18 class CDbUrl : CUrlOptions
20 public:
21 CDbUrl();
22 ~CDbUrl() override;
24 bool IsValid() const { return m_valid; }
25 void Reset();
27 std::string ToString() const;
28 bool FromString(const std::string &dbUrl);
30 const std::string& GetType() const { return m_type; }
31 void AppendPath(const std::string &subPath);
33 using CUrlOptions::GetOption;
34 using CUrlOptions::GetOptions;
35 using CUrlOptions::GetOptionsString;
36 using CUrlOptions::HasOption;
38 void AddOption(const std::string &key, const char *value) override;
39 void AddOption(const std::string &key, const std::string &value) override;
40 void AddOption(const std::string &key, int value) override;
41 void AddOption(const std::string &key, float value) override;
42 void AddOption(const std::string &key, double value) override;
43 void AddOption(const std::string &key, bool value) override;
44 void AddOptions(const std::string &options) override;
45 void RemoveOption(const std::string &key) override;
47 protected:
48 virtual bool parse() = 0;
49 virtual bool validateOption(const std::string &key, const CVariant &value);
51 CURL m_url;
52 std::string m_type;
54 private:
55 void updateOptions();
57 bool m_valid;