|
@@ -14,12 +14,7 @@ static std::string getCode(std::vector<class_view_info> classViews)
|
|
|
ss << std::put_time(std::localtime(&now_c), "%F %T");
|
|
|
//头文件
|
|
|
code += "//生成时间 " + ss.str() + "\n";
|
|
|
- code += "#ifndef __PROJECT_REFLECT_H__\n";
|
|
|
- code += "#define __PROJECT_REFLECT_H__\n\n";
|
|
|
- code += "#if defined(_MSC_VER) && (_MSC_VER >= 1200)\n";
|
|
|
code += "#pragma once\n";
|
|
|
- code += "#pragma execution_character_set(\"utf-8\")\n";
|
|
|
- code += "#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)\n\n";
|
|
|
code += "#include <rttr/registration>\n";
|
|
|
for (auto& it : classViews) {
|
|
|
code += "#include \"" + it.include + "\"\n";
|
|
@@ -239,18 +234,19 @@ static std::string getCode(std::vector<class_view_info> classViews)
|
|
|
code += " __soap_ioc_register__();\n";
|
|
|
code += "}\n";
|
|
|
|
|
|
- code += "#endif //!__PROJECT_REFLECT_H__\n";
|
|
|
-
|
|
|
return code.c_str();
|
|
|
}
|
|
|
|
|
|
int main(int argc, char* argv[])
|
|
|
{
|
|
|
- if (argc != 2) {
|
|
|
- std::cout << "项目路径错误!" << std::endl;
|
|
|
- return 0;
|
|
|
+ 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[1];
|
|
|
+ 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";
|