13 #include "../acl_cpp_define.hpp" 19 #ifndef ACL_CLIENT_ONLY 28 bool read_file(
const char *filepath);
29 bool read_multi_file(
const std::vector<std::string>& files);
32 void set_default_required();
33 void set_default_optional();
34 void set_header_filename(
const std::string &filename);
35 void set_source_filename(
const std::string &filename);
38 enum code_parser_status_t
69 field_t(type_t t,
const std::string &
name,
bool required);
89 typedef std::list<field_t> fields_t;
92 std::list<parent_obj_t> parent_obj_;
96 struct function_code_t
99 std::string declare_ptr_;
100 std::string declare2_;
101 std::string definition_;
102 std::string definition_ptr_;
103 std::string definition2_;
106 parent_obj_t::level_t get_level(std::string str);
107 std::string get_node_func (
const field_t &field);
108 std::string get_gson_func_laber (
const field_t &field);
109 function_code_t gen_pack_code (
const object_t &obj);
110 std::string get_unpack_code(
const std::string &obj_name,
111 const field_t &field)
const ;
112 std::string get_node_name(
const std::string &
name);
113 std::string next_token(std::string delimiters);
114 std::string get_namespace();
115 function_code_t gen_unpack_code(
const object_t &obj);
116 std::string get_static_string(
const std::string &str,
int &index);
117 std::string get_include_files();
118 std::string get_filename(
const char *filepath);
120 bool skip_space_comment();
122 bool check_use_namespace();
123 bool check_namespace();
124 bool check_namespace_end();
125 bool check_struct_begin ();
126 bool check_struct_end ();
127 bool check_include();
128 bool check_comment ();
129 bool check_function();
132 std::pair<bool, std::string> get_function_declare();
134 std::string add_4space(
const std::string &code);
136 void write_header(
const std::string &data);
137 void write_source(
const std::string &data);
141 std::list<std::string> get_initializelist ();
145 std::string comment_begin_;
146 std::string comment_end_;
148 code_parser_status_t status_;
153 std::string newname_;
154 object_t current_obj_;
155 std::map<std::string,object_t> objs_;
156 std::list<std::string> namespaces_;
157 std::list<std::string> includes_;
158 std::list<std::string> files_;
159 std::ofstream *gen_header_;
160 std::ofstream *gen_source_;
161 std::string gen_header_filename_;
162 std::string gen_source_filename_;
163 std::string default_delimiters_;
168 #endif // ACL_CLIENT_ONLY HTTP_API void const char * name