mirror of
https://github.com/GLEGram/GLEGram-iOS.git
synced 2026-05-01 15:27:55 +02:00
4647310322
Based on Swiftgram 12.5 (Telegram iOS 12.5). All GLEGram features ported and organized in GLEGram/ folder. Features: Ghost Mode, Saved Deleted Messages, Content Protection Bypass, Font Replacement, Fake Profile, Chat Export, Plugin System, and more. See CHANGELOG_12.5.md for full details.
54 lines
1.4 KiB
C++
54 lines
1.4 KiB
C++
#ifndef Group_hpp
|
|
#define Group_hpp
|
|
|
|
#include "Lottie/Private/Model/ShapeItems/ShapeItem.hpp"
|
|
#include "Lottie/Private/Parsing/JsonParsing.hpp"
|
|
|
|
#include <vector>
|
|
#include <memory>
|
|
|
|
namespace lottie {
|
|
|
|
/// An item that define an ellipse shape
|
|
class Group: public ShapeItem {
|
|
public:
|
|
explicit Group(lottiejson11::Json::object const &json) noexcept(false) :
|
|
ShapeItem(json) {
|
|
auto itemsData = getObjectArray(json, "it");
|
|
for (const auto &itemData : itemsData) {
|
|
items.push_back(parseShapeItem(itemData));
|
|
}
|
|
|
|
numberOfProperties = getOptionalInt(json, "np");
|
|
}
|
|
|
|
virtual ~Group() = default;
|
|
|
|
virtual void toJson(lottiejson11::Json::object &json) const override {
|
|
ShapeItem::toJson(json);
|
|
|
|
lottiejson11::Json::array itemArray;
|
|
for (const auto &item : items) {
|
|
lottiejson11::Json::object itemJson;
|
|
item->toJson(itemJson);
|
|
itemArray.push_back(itemJson);
|
|
}
|
|
|
|
json.insert(std::make_pair("it", itemArray));
|
|
|
|
if (numberOfProperties.has_value()) {
|
|
json.insert(std::make_pair("np", numberOfProperties.value()));
|
|
}
|
|
}
|
|
|
|
public:
|
|
/// A list of shape items.
|
|
std::vector<std::shared_ptr<ShapeItem>> items;
|
|
|
|
std::optional<int> numberOfProperties;
|
|
};
|
|
|
|
}
|
|
|
|
#endif /* Group_hpp */
|