summaryrefslogtreecommitdiff
path: root/src/factories/bk64/BKHeaderExporter.h
blob: 44d65c72f122e4f75188d2a5940b26c05c627f74 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#pragma once

#include "Companion.h"
#include <factories/BaseFactory.h>

namespace BK64 {

class BKHeaderExporter : public BaseExporter {
    ExportResult Export(std::ostream& write, std::shared_ptr<IParsedData> raw, std::string& entryName,
                        YAML::Node& node, std::string* replacement) override {
        const auto symbol = GetSafeNode(node, "symbol", entryName);

        if (Companion::Instance->IsOTRMode()) {
            write << "static const ALIGN_ASSET(2) char " << symbol << "[] = \"__OTR__" << (*replacement) << "\";\n\n";
        }

        return std::nullopt;
    }
};

} // namespace BK64