initial commit
This commit is contained in:
commit
b585be3679
9 changed files with 561 additions and 0 deletions
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("");
|
||||
}
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue