diff options
author | Petr Mrázek <peterix@gmail.com> | 2013-01-11 02:25:40 +0100 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2013-01-11 02:25:40 +0100 |
commit | b1d00fce8da901b31fa52ea59b4bc3c8edb9d9cc (patch) | |
tree | f7c909b4080e6d1868e601609741450330dc9a1e /java/test.cpp | |
parent | d6d5c86a736537828a59ddc6389d5d0490942f8c (diff) | |
download | MultiMC-b1d00fce8da901b31fa52ea59b4bc3c8edb9d9cc.tar MultiMC-b1d00fce8da901b31fa52ea59b4bc3c8edb9d9cc.tar.gz MultiMC-b1d00fce8da901b31fa52ea59b4bc3c8edb9d9cc.tar.lz MultiMC-b1d00fce8da901b31fa52ea59b4bc3c8edb9d9cc.tar.xz MultiMC-b1d00fce8da901b31fa52ea59b4bc3c8edb9d9cc.zip |
CMake build system, big pile of libs: bspatch, quazip, java, the launcher
Diffstat (limited to 'java/test.cpp')
-rw-r--r-- | java/test.cpp | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/java/test.cpp b/java/test.cpp new file mode 100644 index 00000000..f73e3c21 --- /dev/null +++ b/java/test.cpp @@ -0,0 +1,35 @@ + +#include "classfile.h" +#include "annotations.h" +#include <fstream> +#include <iostream> + +int main(int argc, char* argv[]) +{ + if(argc > 1) + { + std::ifstream file_in(argv[1]); + if(file_in.is_open()) + { + file_in.seekg(0, std::_S_end); + auto length = file_in.tellg(); + char * data = new char[length]; + file_in.seekg(0); + file_in.read(data,length); + java::classfile cf (data, length); + java::annotation_table atable = cf.visible_class_annotations; + for(int i = 0; i < atable.size(); i++) + { + std::cout << atable[i]->toString() << std::endl; + } + return 0; + } + else + { + std::cerr << "Failed to open file : " << argv[1] << std::endl; + return 1; + } + } + std::cerr << "No file to open :(" << std::endl; + return 1; +}
\ No newline at end of file |