summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKiritoDv <kiritodev01@gmail.com>2024-02-20 17:58:00 -0600
committerKiritoDv <kiritodev01@gmail.com>2024-02-20 17:58:00 -0600
commit04e4e9dd8c1affb0c5cf4a1fa465f4adf73e6f33 (patch)
tree3ff78e28039e5a5985db08c5c531dc2618c10940
parent0a7123cbbd5fa63fdb92a538b882a5c060fa3bad (diff)
Fixed blob symbols
-rw-r--r--src/factories/BlobFactory.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/factories/BlobFactory.cpp b/src/factories/BlobFactory.cpp
index cd644bf..ef4a978 100644
--- a/src/factories/BlobFactory.cpp
+++ b/src/factories/BlobFactory.cpp
@@ -3,9 +3,15 @@
#include <iomanip>
void BlobCodeExporter::Export(std::ostream &write, std::shared_ptr<IParsedData> raw, std::string& entryName, YAML::Node &node, std::string* replacement ) {
+ auto symbol = GetSafeNode(node, "symbol", entryName);
auto data = std::static_pointer_cast<RawBuffer>(raw)->mBuffer;
- write << "u8 " << entryName << "[] = {\n" << tab;
+ if(node["ctype"]) {
+ write << node["ctype"].as<std::string>() << " " << symbol << "[] = {\n" << tab;
+ } else {
+ write << "u8 " << symbol << "[] = {\n" << tab;
+ }
+
for (int i = 0; i < data.size(); i++) {
if ((i % 15 == 0) && i != 0) {
write << "\n" << tab;
@@ -13,7 +19,7 @@ void BlobCodeExporter::Export(std::ostream &write, std::shared_ptr<IParsedData>
write << "0x" << std::hex << std::setw(2) << std::setfill('0') << (int) data[i] << ", ";
}
- write << "\n};\n";
+ write << "\n};\n\n";
}
void BlobBinaryExporter::Export(std::ostream &write, std::shared_ptr<IParsedData> raw, std::string& entryName, YAML::Node &node, std::string* replacement ) {