Merge pull request #26220 from 78andyp/blurayfixes
[xbmc.git] / xbmc / utils / ExecString.h
blob67d91f74d3fb5abf99da4a85f3e1d5caad19ac7b
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 <string>
12 #include <vector>
14 class CFileItem;
16 class CExecString
18 public:
19 CExecString() = default;
20 explicit CExecString(const std::string& execString);
21 CExecString(const std::string& function, const std::vector<std::string>& params);
22 CExecString(const std::string& function, const CFileItem& target, const std::string& param);
23 CExecString(const CFileItem& item, const std::string& contextWindow);
25 virtual ~CExecString() = default;
27 const std::string& GetExecString() const { return m_execString; }
29 bool IsValid() const { return m_valid; }
31 const std::string& GetFunction() const { return m_function; }
32 const std::vector<std::string>& GetParams() const { return m_params; }
34 private:
35 bool Parse(const std::string& execString);
36 bool Parse(const CFileItem& item, const std::string& contextWindow);
38 void Build(const std::string& function, const std::vector<std::string>& params);
39 void BuildPlayMedia(const CFileItem& item, const std::string& target);
41 void SetExecString();
43 bool m_valid{false};
44 std::string m_function;
45 std::vector<std::string> m_params;
46 std::string m_execString;