mirror of
https://github.com/a2x/cs2-dumper.git
synced 2025-05-06 13:15:37 +08:00
27 lines
919 B
C++
27 lines
919 B
C++
#pragma once
|
|
|
|
namespace builder {
|
|
class CSharpFileBuilder : public IFileBuilder {
|
|
public:
|
|
std::string get_extension() noexcept override {
|
|
return "cs";
|
|
}
|
|
|
|
void write_top_level(std::ofstream& output) noexcept override {
|
|
// Nothing needed here.
|
|
}
|
|
|
|
void write_namespace(std::ofstream& output, const std::string& namespace_name) noexcept override {
|
|
output << "public static class " << namespace_name << " {\n";
|
|
}
|
|
|
|
void write_variable(std::ofstream& output, const std::string& variable_name, const std::uint64_t variable_value) noexcept override {
|
|
output << " public const ulong " << variable_name << " = 0x" << std::hex << variable_value << ";\n";
|
|
}
|
|
|
|
void write_closure(std::ofstream& output, const bool eof) noexcept override {
|
|
output << (!eof ? "}\n\n": "}");
|
|
}
|
|
};
|
|
}
|