/* This file is part of Telegram Desktop, the official desktop application for the Telegram messaging service. For license and copyright information please follow this link: https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL */ #pragma once #include #include #include #include #include #include #include "codegen/common/cpp_file.h" #include "codegen/lang/parsed_file.h" namespace codegen { namespace lang { class Generator { public: Generator(const LangPack &langpack, const QString &destBasePath, const common::ProjectInfo &project); Generator(const Generator &other) = delete; Generator &operator=(const Generator &other) = delete; bool writeHeader(); bool writeSource(); private: void writeHeaderForwardDeclarations(); void writeHeaderTagTypes(); void writeHeaderInterface(); void writeHeaderTagValueLookup(); void writeHeaderReactiveInterface(); void writeHeaderProducersInterface(); void writeHeaderProducersInstances(); QString getFullKey(const LangPack::Entry &entry); template void writeSetSearch(const std::set> &set, ComputeResult computeResult, const QString &invalidResult); const LangPack &langpack_; QString basePath_, baseName_; const common::ProjectInfo &project_; std::unique_ptr source_, header_; }; } // namespace lang } // namespace codegen