V1 #2

Merged
rboullard merged 65 commits from V1 into Development 2026-03-29 09:30:59 +00:00
2 changed files with 16 additions and 13 deletions
Showing only changes of commit f322ce3655 - Show all commits

View File

@@ -9,9 +9,9 @@ int main(int argc, char** argv)
argv = app.ensure_utf8(argv);
std::string input;
app.add_option("-f,--input", input, "The input file");
app.add_option("-f,--input", input, "The input file")->required();
std::string output;
app.add_option("-o,--output", output, "The output file");
app.add_option("-o,--output", output, "The output file")->required();
std::optional<std::string> arrayType;
app.add_option("--arrayType", arrayType, "The type of the array");
std::optional<std::string> arrayInclude;
@@ -46,8 +46,12 @@ int main(int argc, char** argv)
generator.SetMapping(Bin2CPP::MappingKey::NAMESPACE, customNamespace.value());
}
if (generator.Generate())
if (!generator.Generate())
{
BIN2CPP_LOG_ERROR("Failed to generate '{}'", input);
return 1;
}
std::ofstream out(output);
if (!out)
{
@@ -57,7 +61,6 @@ int main(int argc, char** argv)
out << generator.Get();
out.close();
}
BIN2CPP_LOG_INFO("'{}' Generated !", output);

View File

@@ -240,7 +240,7 @@ bool Generator::ComputeData(const std::span<std::byte> p_data)
std::string& value = m_mappingTable[magic_enum::enum_index(MappingKey::DATA).value()];
value.clear();
constexpr std::size_t bytesPerLine = 5;
constexpr std::size_t bytesPerLine = 16;
constexpr std::string_view linePrefix = "\n ";
for (std::size_t i = 0; i < p_data.size(); ++i)