mirror of
https://github.com/a2x/cs2-dumper.git
synced 2026-04-17 22:59:59 +08:00
Updated README
This commit is contained in:
27
include/builder/rust_file_builder.hpp
Normal file
27
include/builder/rust_file_builder.hpp
Normal file
@@ -0,0 +1,27 @@
|
||||
#pragma once
|
||||
|
||||
namespace builder {
|
||||
class RustFileBuilder : public IFileBuilder {
|
||||
public:
|
||||
std::string get_extension() noexcept override {
|
||||
return "rs";
|
||||
}
|
||||
|
||||
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 << "#[allow(non_snake_case, non_upper_case_globals)]\n";
|
||||
output << "pub mod " << namespace_name << " {\n";
|
||||
}
|
||||
|
||||
void write_variable(std::ofstream& output, const std::string& variable_name, const std::uint64_t variable_value) noexcept override {
|
||||
output << " pub const " << variable_name << ": usize = 0x" << std::hex << variable_value << ";\n";
|
||||
}
|
||||
|
||||
void write_closure(std::ofstream& output, const bool eof) noexcept override {
|
||||
output << (!eof ? "}\n\n": "}");
|
||||
}
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user