123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- #include <iostream>
- #include <chrono>
- #include "class_view.hpp"
- int main(int argc, char* argv[])
- {
- system("chcp 65001");
- if (argc <= 0) {
- std::cout << "参数错误!" << std::endl;
- return -1;
- }
- for (int i = 0; i < argc; ++i) {
- std::cout << "参数:"<< argv[i] << std::endl;
- }
- std::string project_path = argv[argc - 1];
- std::string reflect_path;
- if (project_path[project_path.size() - 1] == '/' || project_path[project_path.size() - 1] == '\\') {
- reflect_path = project_path + "reflect.h";
- }
- else {
- reflect_path = project_path + "/reflect.h";
- }
- std::cout << "项目反射文件:" << reflect_path << std::endl;
-
- std::string code = analysis::code_analysis::generate_code(project_path);
- std::cout << "项目反射代码生成完成" << std::endl;
- std::ofstream file(reflect_path, std::ios::out);
- if (!file.is_open()) {
- std::cerr << "无法打开文件" << std::endl;
- return -1;
- }
- file << code;
- file.close();
- return 0;
- }
|