-
-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f06a8b2
commit 17c1ee9
Showing
4 changed files
with
60 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,32 @@ | ||
|
||
#include "preprocessor.hpp" | ||
#include "a2lparser.hpp" | ||
|
||
#include <iostream> | ||
|
||
std::string ValueContainer::s_encoding{ "latin1" }; | ||
#include <filesystem> | ||
#include <fstream> | ||
|
||
int main(int argc, char** argv) { | ||
std::cout << "Hello!!!\n"; | ||
bool cmd = false; | ||
auto FN{ "C:\\csProjects\\pyA2L\\examples\\03G906021KE_9970_501409_P447_HAXN_EDC16U34_3.41.a2l" }; | ||
#include "a2lparser.hpp" | ||
#include "preprocessor.hpp" | ||
|
||
cmd = argc > 1; | ||
std::string ValueContainer::s_encoding{ "latin1" }; | ||
|
||
void process(const std::string& file_name, const std::string& encoding) { | ||
Preprocessor p{ "INFO" }; | ||
|
||
Preprocessor p{ "INFO" }; | ||
auto res = p.process(file_name, encoding); | ||
auto& [fns, linemap, ifdr] = res; | ||
p.finalize(); | ||
auto parser = A2LParser(res, fns.a2l, encoding); | ||
const auto& values = parser.get_values(); | ||
} | ||
|
||
if (cmd) { | ||
auto res = p.process(argv[1], "UTF-8"); | ||
auto reader = std::get<2>(res); | ||
p.finalize(); | ||
reader.open(); | ||
// auto id = reader.get({ 2297, 9, 2307, 20 }); | ||
// reader.close(); | ||
// ld(p, 3); | ||
int main(int argc, char** argv) { | ||
for (auto const & dir_entry : std::filesystem::directory_iterator{ "..\\..\\examples" }) { | ||
auto pth = dir_entry.path(); | ||
auto ext = pth.extension(); | ||
if (ext != ".a2l") { | ||
continue; | ||
} | ||
std::cout << pth << '\n'; | ||
process(pth.string(), "latin1"); | ||
} | ||
|
||
return 0; | ||
return 0; | ||
} |