diff options
author | rtk0c <[email protected]> | 2023-10-19 22:50:07 -0700 |
---|---|---|
committer | rtk0c <[email protected]> | 2025-08-16 11:31:16 -0700 |
commit | 297232d21594b138bb368a42b5b0d085ff9ed6aa (patch) | |
tree | 075d5407e1e12a9d35cbee6e4c20ad34e0765c42 /source/20-codegen-compiler/CodegenOutput.cpp | |
parent | d5cd34ff69f7fd134d5450696f298af1a864afbc (diff) |
The great renaming: switch to "module style"
Diffstat (limited to 'source/20-codegen-compiler/CodegenOutput.cpp')
-rw-r--r-- | source/20-codegen-compiler/CodegenOutput.cpp | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/source/20-codegen-compiler/CodegenOutput.cpp b/source/20-codegen-compiler/CodegenOutput.cpp deleted file mode 100644 index d85feac..0000000 --- a/source/20-codegen-compiler/CodegenOutput.cpp +++ /dev/null @@ -1,39 +0,0 @@ -#include "CodegenOutput.hpp" - -#include "CodegenUtils.hpp" - -void CodegenOutput::AddRequestInclude(std::string_view include) { - if (!mRequestIncludes.contains(include)) { - mRequestIncludes.insert(std::string(include)); - } -} - -void CodegenOutput::AddOutputThing(CodegenOutputThing thing, int placementLocation) { - if (placementLocation < 0 || placementLocation >= mOutThings.size()) { - mOutThings.push_back(std::move(thing)); - } else { - int maxIndex = (int)mOutThings.size() - 1; - if (placementLocation > maxIndex) { - placementLocation = maxIndex; - } - - auto placementIter = mOutThings.begin() + placementLocation; - mOutThings.insert(placementIter, std::move(thing)); - } -} - -void CodegenOutput::MergeContents(CodegenOutput other) { - std::move(other.mOutThings.begin(), other.mOutThings.end(), std::back_inserter(this->mOutThings)); -} - -void CodegenOutput::Write(FILE* file) const { - for (auto& include : mRequestIncludes) { - // TODO how to resolve to the correct include paths? - WRITE_FMT_LN(file, "#include <%s>", include.c_str()); - } - - for (auto& thing : mOutThings) { - fwrite(thing.text.c_str(), sizeof(char), thing.text.size(), file); - WRITE_LIT(file, "\n"); - } -} |