mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-04-28 13:28:01 +03:00
Emulator: Implement config CLI args, add barrier for host CLI args
Some checks are pending
Some checks are pending
This commit is contained in:
parent
bd41774960
commit
783079266e
5 changed files with 128 additions and 32 deletions
|
@ -337,6 +337,18 @@ void cfg::encode(YAML::Emitter& out, const cfg::_base& rhs)
|
|||
out << YAML::EndMap;
|
||||
return;
|
||||
}
|
||||
case type::node_map:
|
||||
{
|
||||
//out << YAML::Block; // Does nothing, output is in Flow mode still (TODO)
|
||||
out << YAML::BeginMap;
|
||||
for (const auto& np : static_cast<const node_map_entry&>(rhs).get_map())
|
||||
{
|
||||
out << YAML::Key << np.first;
|
||||
out << YAML::Value << fmt::format("%s", np.second);
|
||||
}
|
||||
out << YAML::EndMap;
|
||||
return;
|
||||
}
|
||||
case type::log:
|
||||
{
|
||||
out << YAML::BeginMap;
|
||||
|
@ -417,6 +429,7 @@ void cfg::decode(const YAML::Node& data, cfg::_base& rhs, bool dynamic)
|
|||
break;
|
||||
}
|
||||
case type::map:
|
||||
case type::node_map:
|
||||
{
|
||||
if (!data.IsMap())
|
||||
{
|
||||
|
|
|
@ -41,6 +41,7 @@ namespace cfg
|
|||
string, // cfg::string type
|
||||
set, // cfg::set_entry type
|
||||
map, // cfg::map_entry type
|
||||
node_map, // cfg::node_map_entry type
|
||||
log, // cfg::log_entry type
|
||||
device, // cfg::device_entry type
|
||||
};
|
||||
|
@ -627,13 +628,13 @@ namespace cfg
|
|||
template<typename T>
|
||||
using map_of_type = std::map<std::string, T, std::less<>>;
|
||||
|
||||
class map_entry final : public _base
|
||||
class map_entry : public _base
|
||||
{
|
||||
map_of_type<std::string> m_map{};
|
||||
|
||||
public:
|
||||
map_entry(node* owner, const std::string& name)
|
||||
: _base(type::map, owner, name, true)
|
||||
map_entry(node* owner, const std::string& name, type _type = type::map)
|
||||
: _base(_type, owner, name, true)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -652,6 +653,15 @@ namespace cfg
|
|||
void from_default() override;
|
||||
};
|
||||
|
||||
class node_map_entry final : public map_entry
|
||||
{
|
||||
public:
|
||||
node_map_entry(node* owner, const std::string& name)
|
||||
: map_entry(owner, name, type::node_map)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
class log_entry final : public _base
|
||||
{
|
||||
map_of_type<logs::level> m_map{};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue