| 12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- #include <sstream>
- #include "CPropertyBoolean.h"
- #include "WallpaperEngine/Core/Core.h"
- using namespace WallpaperEngine::Core::Projects;
- CPropertyBoolean* CPropertyBoolean::fromJSON (json data, const std::string& name)
- {
- json::const_iterator value = data.find ("value");
- std::string text = jsonFindDefault <std::string> (data, "text", "");
- return new CPropertyBoolean (
- *value,
- name,
- text
- );
- }
- bool CPropertyBoolean::getValue ()
- {
- return this->m_value;
- }
- std::string CPropertyBoolean::dump () const
- {
- std::stringstream ss;
- ss
- << this->m_name << " - boolean" << std::endl
- << "\t" << "Description: " << this->m_text << std::endl
- << "\t" << "Value: " << this->m_value;
- return ss.str();
- }
- CPropertyBoolean::CPropertyBoolean (bool value, const std::string& name, const std::string& text) :
- CProperty (name, Type, text),
- m_value (value)
- {
- }
- const std::string CPropertyBoolean::Type = "bool";
|