34 lines
834 B
C++
34 lines
834 B
C++
#pragma once
|
|
#include <string>
|
|
#include <vector>
|
|
#include <map>
|
|
#include <memory>
|
|
|
|
class Dictionary
|
|
{
|
|
public:
|
|
Dictionary() = default;
|
|
virtual ~Dictionary() = default;
|
|
|
|
void addStringItem(const std::string& key, const std::string& item);
|
|
|
|
void addDictItem(const std::string& key, std::unique_ptr<Dictionary> dict);
|
|
|
|
Dictionary* getDict(const std::string& key) const;
|
|
|
|
std::vector<std::string> getDictKeys() const;
|
|
|
|
std::vector<std::string> getStringKeys() const;
|
|
|
|
std::string getItem(const std::string& key) const;
|
|
|
|
bool hasKey(const std::string& key) const;
|
|
|
|
bool hasStringKey(const std::string& key) const;
|
|
|
|
bool hasDictKey(const std::string& key) const;
|
|
protected:
|
|
|
|
std::map<std::string, std::string> mStringData;
|
|
std::map<std::string, std::unique_ptr<Dictionary> > mDictData;
|
|
};
|