2016-04-17 09:30:14 +00:00
|
|
|
/*
|
|
|
|
This file is part of Telegram Desktop,
|
2018-01-03 10:23:14 +00:00
|
|
|
the official desktop application for the Telegram messaging service.
|
2016-04-17 09:30:14 +00:00
|
|
|
|
2018-01-03 10:23:14 +00:00
|
|
|
For license and copyright information please follow this link:
|
|
|
|
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
2016-04-17 09:30:14 +00:00
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
2016-04-18 20:33:43 +00:00
|
|
|
#include <memory>
|
2016-04-17 09:30:14 +00:00
|
|
|
#include <QtCore/QString>
|
2016-04-18 20:33:43 +00:00
|
|
|
#include <QtCore/QSet>
|
|
|
|
#include "codegen/common/cpp_file.h"
|
|
|
|
#include "codegen/numbers/parsed_file.h"
|
2016-04-17 09:30:14 +00:00
|
|
|
|
|
|
|
namespace codegen {
|
2016-04-18 20:33:43 +00:00
|
|
|
namespace numbers {
|
2016-04-17 09:30:14 +00:00
|
|
|
|
2016-04-18 20:33:43 +00:00
|
|
|
class Generator {
|
|
|
|
public:
|
|
|
|
Generator(const Rules &rules, const QString &destBasePath, const common::ProjectInfo &project);
|
|
|
|
Generator(const Generator &other) = delete;
|
|
|
|
Generator &operator=(const Generator &other) = delete;
|
2016-04-17 13:22:00 +00:00
|
|
|
|
2016-04-18 20:33:43 +00:00
|
|
|
bool writeHeader();
|
|
|
|
bool writeSource();
|
2016-04-17 09:30:14 +00:00
|
|
|
|
2016-04-18 20:33:43 +00:00
|
|
|
private:
|
|
|
|
const Rules &rules_;
|
|
|
|
QString basePath_;
|
|
|
|
const common::ProjectInfo &project_;
|
|
|
|
std::unique_ptr<common::CppFile> source_, header_;
|
2016-04-17 13:22:00 +00:00
|
|
|
|
2016-04-17 09:30:14 +00:00
|
|
|
};
|
|
|
|
|
2016-04-18 20:33:43 +00:00
|
|
|
} // namespace numbers
|
2016-04-17 09:30:14 +00:00
|
|
|
} // namespace codegen
|