Fix no error message on fail
All checks were successful
Bin2CPP / Build & Test Debug with ./ConanProfiles/clang (Unity Build: OFF) (push) Successful in 1m0s
Bin2CPP / Build & Test RelWithDebInfo with ./ConanProfiles/clang (Unity Build: OFF) (push) Successful in 1m7s
Bin2CPP / Build & Test RelWithDebInfo with ./ConanProfiles/clang (Unity Build: ON) (push) Successful in 1m5s
Bin2CPP / Build & Test RelWithDebInfo with ./ConanProfiles/clangd (Unity Build: OFF) (push) Successful in 47s
Bin2CPP / Build & Test RelWithDebInfo with ./ConanProfiles/clangd (Unity Build: ON) (push) Successful in 47s
Bin2CPP / Build & Test RelWithDebInfo with ./ConanProfiles/clangd_asan (Unity Build: OFF) (push) Successful in 1m2s
Bin2CPP / Build & Test RelWithDebInfo with ./ConanProfiles/clangd_asan (Unity Build: ON) (push) Successful in 1m6s
Bin2CPP / Build & Test Release with ./ConanProfiles/clang (Unity Build: OFF) (push) Successful in 54s
Bin2CPP / Build & Test Release with ./ConanProfiles/clang (Unity Build: ON) (push) Successful in 53s
Bin2CPP / Build & Test Release with ./ConanProfiles/clangd (Unity Build: OFF) (push) Successful in 43s
Bin2CPP / Build & Test Release with ./ConanProfiles/clangd (Unity Build: ON) (push) Successful in 45s
Bin2CPP / Build & Test Release with ./ConanProfiles/clangd_asan (Unity Build: OFF) (push) Successful in 58s
Conan Packaging / Package Bin2CPP/1.0.0 (push) Successful in 57s
Bin2CPP / Build & Test Debug with ./ConanProfiles/clang (Unity Build: ON) (push) Successful in 50s
Bin2CPP / Build & Test Debug with ./ConanProfiles/clangd (Unity Build: OFF) (push) Successful in 37s
Bin2CPP / Build & Test Debug with ./ConanProfiles/clangd (Unity Build: ON) (push) Successful in 38s
Bin2CPP / Build & Test Debug with ./ConanProfiles/clangd_asan (Unity Build: OFF) (push) Successful in 44s
Bin2CPP / Build & Test Debug with ./ConanProfiles/clangd_asan (Unity Build: ON) (push) Successful in 44s
Bin2CPP / Build & Test Release with ./ConanProfiles/clangd_asan (Unity Build: ON) (push) Successful in 1m6s
Bin2CPP / Clang Format Checks (push) Successful in 9s
All checks were successful
Bin2CPP / Build & Test Debug with ./ConanProfiles/clang (Unity Build: OFF) (push) Successful in 1m0s
Bin2CPP / Build & Test RelWithDebInfo with ./ConanProfiles/clang (Unity Build: OFF) (push) Successful in 1m7s
Bin2CPP / Build & Test RelWithDebInfo with ./ConanProfiles/clang (Unity Build: ON) (push) Successful in 1m5s
Bin2CPP / Build & Test RelWithDebInfo with ./ConanProfiles/clangd (Unity Build: OFF) (push) Successful in 47s
Bin2CPP / Build & Test RelWithDebInfo with ./ConanProfiles/clangd (Unity Build: ON) (push) Successful in 47s
Bin2CPP / Build & Test RelWithDebInfo with ./ConanProfiles/clangd_asan (Unity Build: OFF) (push) Successful in 1m2s
Bin2CPP / Build & Test RelWithDebInfo with ./ConanProfiles/clangd_asan (Unity Build: ON) (push) Successful in 1m6s
Bin2CPP / Build & Test Release with ./ConanProfiles/clang (Unity Build: OFF) (push) Successful in 54s
Bin2CPP / Build & Test Release with ./ConanProfiles/clang (Unity Build: ON) (push) Successful in 53s
Bin2CPP / Build & Test Release with ./ConanProfiles/clangd (Unity Build: OFF) (push) Successful in 43s
Bin2CPP / Build & Test Release with ./ConanProfiles/clangd (Unity Build: ON) (push) Successful in 45s
Bin2CPP / Build & Test Release with ./ConanProfiles/clangd_asan (Unity Build: OFF) (push) Successful in 58s
Conan Packaging / Package Bin2CPP/1.0.0 (push) Successful in 57s
Bin2CPP / Build & Test Debug with ./ConanProfiles/clang (Unity Build: ON) (push) Successful in 50s
Bin2CPP / Build & Test Debug with ./ConanProfiles/clangd (Unity Build: OFF) (push) Successful in 37s
Bin2CPP / Build & Test Debug with ./ConanProfiles/clangd (Unity Build: ON) (push) Successful in 38s
Bin2CPP / Build & Test Debug with ./ConanProfiles/clangd_asan (Unity Build: OFF) (push) Successful in 44s
Bin2CPP / Build & Test Debug with ./ConanProfiles/clangd_asan (Unity Build: ON) (push) Successful in 44s
Bin2CPP / Build & Test Release with ./ConanProfiles/clangd_asan (Unity Build: ON) (push) Successful in 1m6s
Bin2CPP / Clang Format Checks (push) Successful in 9s
This commit is contained in:
@@ -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,19 +46,22 @@ int main(int argc, char** argv)
|
||||
generator.SetMapping(Bin2CPP::MappingKey::NAMESPACE, customNamespace.value());
|
||||
}
|
||||
|
||||
if (generator.Generate())
|
||||
if (!generator.Generate())
|
||||
{
|
||||
std::ofstream out(output);
|
||||
if (!out)
|
||||
{
|
||||
BIN2CPP_LOG_ERROR("Failed to open '{}'", output);
|
||||
return 1;
|
||||
}
|
||||
|
||||
out << generator.Get();
|
||||
out.close();
|
||||
BIN2CPP_LOG_ERROR("Failed to generate '{}'", input);
|
||||
return 1;
|
||||
}
|
||||
|
||||
std::ofstream out(output);
|
||||
if (!out)
|
||||
{
|
||||
BIN2CPP_LOG_ERROR("Failed to open '{}'", output);
|
||||
return 1;
|
||||
}
|
||||
|
||||
out << generator.Get();
|
||||
out.close();
|
||||
|
||||
BIN2CPP_LOG_INFO("'{}' Generated !", output);
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user