#pragma once #include #include #include #include #include #include // Photoshop's text-engine dictionary, a small PostScript subset. namespace PSDTextEngine { struct Engine; using Dictionary = std::map; using Array = std::vector; struct Engine { std::variant value; }; std::optional parse(const QByteArray &data); // Swift's `walk`: nested dictionary keys, else none. const Engine *walk(const Engine *value, std::initializer_list keys); std::optional number(const Engine *value); std::optional boolean(const Engine *value); std::optional string(const Engine *value); // An array's items; anything else reads empty. Array array(const Engine *value); }