mirror of
https://gitee.com/acl-dev/acl.git
synced 2024-12-02 20:08:21 +08:00
add gson
This commit is contained in:
parent
2fe39cdca3
commit
140e74364f
@ -94,6 +94,7 @@ gsoner::gsoner()
|
||||
gen_header_ = NULL;
|
||||
gen_source_ = NULL;
|
||||
default_ = true;
|
||||
required_ = default_;
|
||||
gen_header_filename_ = "gson.h";
|
||||
gen_source_filename_ = "gson.cpp";
|
||||
default_delimiters_ = "\\\r\n\t ";
|
||||
@ -272,13 +273,13 @@ std::string gsoner::get_unpack_code(const std::string &obj_name,
|
||||
|
||||
return tab_ +
|
||||
"if(" + field.name_ + ")\n" + tab_ + tab_ +
|
||||
"gson(*" + field.name_ + ",&obj." + field.name_ + ");\n";
|
||||
"gson(*" + field.name_ + ",&obj." + field.name_ + ");";
|
||||
|
||||
else if(field.required_ == false)
|
||||
return tab_
|
||||
+ "if(" + field.name_ + "&& " + field.name_
|
||||
+ "->get_obj())\n" + tab_ + tab_ + " gson(*" + field.name_
|
||||
+ "->get_obj(), &obj." + field.name_ + ");\n";
|
||||
+ "->get_obj(), &obj." + field.name_ + ");";
|
||||
|
||||
return "unknown_type";
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user