mirror of
https://github.com/Almamu/linux-wallpaperengine.git
synced 2025-09-14 13:56:48 +08:00

Added casting for integer to double in json loading Added support for dumping all available properties Signed-off-by: Alexis Maiquez <almamu@almamu.com>
33 lines
701 B
C++
33 lines
701 B
C++
#include <sstream>
|
|
#include "CPropertyText.h"
|
|
#include "WallpaperEngine/Core/Core.h"
|
|
|
|
using namespace WallpaperEngine::Core::Projects;
|
|
|
|
CPropertyText* CPropertyText::fromJSON (json data, const std::string& name)
|
|
{
|
|
json::const_iterator text = data.find ("type");
|
|
|
|
return new CPropertyText (
|
|
name,
|
|
*text
|
|
);
|
|
}
|
|
|
|
std::string CPropertyText::dump () const
|
|
{
|
|
std::stringstream ss;
|
|
|
|
ss
|
|
<< this->m_name << " - text" << std::endl
|
|
<< "\t" << "Value: " << this->m_text;
|
|
|
|
return ss.str();
|
|
}
|
|
|
|
CPropertyText::CPropertyText (const std::string& name, const std::string& text) :
|
|
CProperty (name, Type, text)
|
|
{
|
|
}
|
|
|
|
const std::string CPropertyText::Type = "text"; |