summaryrefslogtreecommitdiff
path: root/TemplateFactory.cpp
diff options
context:
space:
mode:
authorpetrie911 <petrie911@yahoo.com>2024-03-12 11:25:51 -0500
committerLywx <kiritodev01@gmail.com>2024-03-12 11:57:53 -0600
commit84b6686f5b051ce729cc03d92dc71c94d0f19537 (patch)
tree7b188b7d9d89bc09a468ff3ecb1d9d4628986cc6 /TemplateFactory.cpp
parent83adeb4b7f9e746d52c7d35f1964aa59e599a93d (diff)
script
Diffstat (limited to 'TemplateFactory.cpp')
-rw-r--r--TemplateFactory.cpp38
1 files changed, 38 insertions, 0 deletions
diff --git a/TemplateFactory.cpp b/TemplateFactory.cpp
new file mode 100644
index 0000000..1d89a6f
--- /dev/null
+++ b/TemplateFactory.cpp
@@ -0,0 +1,38 @@
+#include "TemplateFactory.h"
+#include "spdlog/spdlog.h"
+
+#include "Companion.h"
+#include "utils/Decompressor.h"
+#include "utils/TorchUtils.h"
+
+TypeData::TypeData(uint32_t data): mData(data) {
+
+}
+
+void TypeHeaderExporter::Export(std::ostream &write, std::shared_ptr<IParsedData> raw, std::string& entryName, YAML::Node &node, std::string* replacement) {
+ const auto symbol = GetSafeNode(node, "symbol", entryName);
+
+ if(Companion::Instance->IsOTRMode()){
+ write << "static const char " << symbol << "[] = \"__OTR__" << (*replacement) << "\";\n\n";
+ return;
+ }
+
+ write << "extern Type " << symbol << ";\n";
+ // write << "extern Type " << symbol << "[];\n";
+}
+
+void TypeCodeExporter::Export(std::ostream &write, std::shared_ptr<IParsedData> raw, std::string& entryName, YAML::Node &node, std::string* replacement ) {
+ const auto symbol = GetSafeNode(node, "symbol", entryName);
+ const auto offset = GetSafeNode<uint32_t>(node, "offset");
+ auto data = std::static_pointer_cast<TypeData>(raw);
+
+}
+
+void TypeBinaryExporter::Export(std::ostream &write, std::shared_ptr<IParsedData> raw, std::string& entryName, YAML::Node &node, std::string* replacement ) {
+
+}
+
+std::optional<std::shared_ptr<IParsedData>> TypeFactory::parse(std::vector<uint8_t>& buffer, YAML::Node& node) {
+
+ return std::make_shared<TypeData>();
+}