aboutsummaryrefslogtreecommitdiff
path: root/core/src/Model/Workflow/Values/Dictionary.hpp
blob: 65ea82f4a144ee67f095674714d3cf0629bdc207 (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
#pragma once

#include "Model/Workflow/Value.hpp"

#include <tsl/array_map.h>
#include <memory>
#include <string>
#include <string_view>

class DictionaryValue : public BaseValue
{
private:
	tsl::array_map<char, std::unique_ptr<BaseValue>> mElements;

public:
	static bool IsInstance(const BaseValue* value);
	DictionaryValue();

	int GetCount() const;
	BaseValue* Find(std::string_view key);

	BaseValue* Insert(std::string_view key, std::unique_ptr<BaseValue>& value);
	BaseValue& InsertOrReplace(std::string_view key, std::unique_ptr<BaseValue> value);
	void Remove(std::string_view key);
};