initial commit
This commit is contained in:
20
imagemeta.cpp
Normal file
20
imagemeta.cpp
Normal file
@ -0,0 +1,20 @@
|
||||
#include "imagemeta.h"
|
||||
|
||||
ImageMeta::ImageMeta(const std::filesystem::path& path, const QString& text):
|
||||
path{path}, text{text}
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
ImageMeta::ImageMeta(const QJsonObject& json, const std::filesystem::path& dir)
|
||||
{
|
||||
QJsonValue filename = json["file_name"];
|
||||
if(filename == QJsonValue::Undefined || !filename.isString())
|
||||
throw ParseException("No or invalid file_name field found");
|
||||
path = dir/filename.toString().toStdString();
|
||||
|
||||
QJsonValue textfrommeta = json["text"];
|
||||
text = textfrommeta.toString("");
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user