Clean up som pdf code.
This commit is contained in:
parent
650cfa5c6f
commit
290b64e230
24 changed files with 264 additions and 256 deletions
|
@ -1,21 +1,21 @@
|
|||
#include "Dictionary.h"
|
||||
|
||||
bool Dictionary::HasKey(const std::string& key) const
|
||||
bool Dictionary::hasKey(const std::string& key) const
|
||||
{
|
||||
return HasStringKey(key) || HasDictKey(key);
|
||||
return hasStringKey(key) || hasDictKey(key);
|
||||
}
|
||||
|
||||
bool Dictionary::HasStringKey(const std::string& key) const
|
||||
bool Dictionary::hasStringKey(const std::string& key) const
|
||||
{
|
||||
return mStringData.count(key) > 0;
|
||||
}
|
||||
|
||||
bool Dictionary::HasDictKey(const std::string& key) const
|
||||
bool Dictionary::hasDictKey(const std::string& key) const
|
||||
{
|
||||
return mDictData.count(key) > 0;
|
||||
}
|
||||
|
||||
std::vector<std::string> Dictionary::GetStringKeys() const
|
||||
std::vector<std::string> Dictionary::getStringKeys() const
|
||||
{
|
||||
std::vector<std::string> keys;
|
||||
for (const auto& item : mStringData)
|
||||
|
@ -25,7 +25,7 @@ std::vector<std::string> Dictionary::GetStringKeys() const
|
|||
return keys;
|
||||
}
|
||||
|
||||
std::vector<std::string> Dictionary::GetDictKeys() const
|
||||
std::vector<std::string> Dictionary::getDictKeys() const
|
||||
{
|
||||
std::vector<std::string> keys;
|
||||
for (const auto& item : mDictData)
|
||||
|
@ -35,22 +35,22 @@ std::vector<std::string> Dictionary::GetDictKeys() const
|
|||
return keys;
|
||||
}
|
||||
|
||||
Dictionary* Dictionary::GetDict(const std::string& key) const
|
||||
Dictionary* Dictionary::getDict(const std::string& key) const
|
||||
{
|
||||
return mDictData.at(key).get();
|
||||
}
|
||||
|
||||
std::string Dictionary::GetItem(const std::string& key) const
|
||||
std::string Dictionary::getItem(const std::string& key) const
|
||||
{
|
||||
return mStringData.at(key);
|
||||
}
|
||||
|
||||
void Dictionary::AddStringItem(const std::string& key, const std::string& item)
|
||||
void Dictionary::addStringItem(const std::string& key, const std::string& item)
|
||||
{
|
||||
mStringData[key] = item;
|
||||
}
|
||||
|
||||
void Dictionary::AddDictItem(const std::string& key, std::unique_ptr<Dictionary> dict)
|
||||
void Dictionary::addDictItem(const std::string& key, std::unique_ptr<Dictionary> dict)
|
||||
{
|
||||
mDictData[key] = std::move(dict);
|
||||
}
|
||||
|
|
|
@ -10,24 +10,23 @@ public:
|
|||
Dictionary() = default;
|
||||
virtual ~Dictionary() = default;
|
||||
|
||||
bool HasKey(const std::string& key) const;
|
||||
void addStringItem(const std::string& key, const std::string& item);
|
||||
|
||||
bool HasStringKey(const std::string& key) const;
|
||||
void addDictItem(const std::string& key, std::unique_ptr<Dictionary> dict);
|
||||
|
||||
bool HasDictKey(const std::string& key) const;
|
||||
Dictionary* getDict(const std::string& key) const;
|
||||
|
||||
Dictionary* GetDict(const std::string& key) const;
|
||||
std::vector<std::string> getDictKeys() const;
|
||||
|
||||
std::vector<std::string> GetDictKeys() const;
|
||||
std::vector<std::string> getStringKeys() const;
|
||||
|
||||
std::vector<std::string> GetStringKeys() const;
|
||||
std::string getItem(const std::string& key) const;
|
||||
|
||||
std::string GetItem(const std::string& key) const;
|
||||
bool hasKey(const std::string& key) const;
|
||||
|
||||
void AddStringItem(const std::string& key, const std::string& item);
|
||||
|
||||
void AddDictItem(const std::string& key, std::unique_ptr<Dictionary> dict);
|
||||
bool hasStringKey(const std::string& key) const;
|
||||
|
||||
bool hasDictKey(const std::string& key) const;
|
||||
protected:
|
||||
|
||||
std::map<std::string, std::string> mStringData;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue