| 136 | using namespace luabind; |
| 137 | |
| 138 | void CScriptIniFile::script_register(lua_State* L) |
| 139 | { |
| 140 | module(L)[(def("ini_file", &initialize_ini_file, adopt<result>()), def("ini_file", &initialize_ini_file_full, adopt<result>()), |
| 141 | |
| 142 | class_<CInifile>("__ini_file") |
| 143 | .def(constructor<LPCSTR>()) |
| 144 | .def("section_exist", §ion_exist_script) |
| 145 | .def("line_exist", &line_exist_script) |
| 146 | .def("line_count", (u32(CInifile::*)(LPCSTR)) & CInifile::line_count) |
| 147 | .def("append_section", &append_section_script) |
| 148 | .def("append_section", &append_section_script2) |
| 149 | .def("remove_line", &CInifile::remove_line) |
| 150 | .def("remove_section", &CInifile::remove_section) |
| 151 | .def("get_as_string", &CInifile::get_as_string) |
| 152 | .def("save", &CInifile::save_as) |
| 153 | .def("name", &CInifile::fname) |
| 154 | .def("iterate_sections", &iterate_sections) |
| 155 | .def("iterate_lines", &iterate_lines) |
| 156 | |
| 157 | .def_readwrite("readonly", &CInifile::bReadOnly) |
| 158 | |
| 159 | .def("r_line", &::r_line, pure_out_value<4>() + pure_out_value<5>()) |
| 160 | |
| 161 | .def("r_bool", &r_bool_script) |
| 162 | .def("r_string", (LPCSTR(CInifile::*)(LPCSTR, LPCSTR)) & CInifile::r_string) |
| 163 | .def("r_u32", (u32(CInifile::*)(LPCSTR, LPCSTR)) & CInifile::r_u32) |
| 164 | .def("r_s32", (s32(CInifile::*)(LPCSTR, LPCSTR)) & CInifile::r_s32) |
| 165 | .def("r_u16", (u16(CInifile::*)(LPCSTR, LPCSTR)) & CInifile::r_u16) |
| 166 | .def("r_s16", (s16(CInifile::*)(LPCSTR, LPCSTR)) & CInifile::r_s16) |
| 167 | .def("r_u8", (u8(CInifile::*)(LPCSTR, LPCSTR)) & CInifile::r_u8) |
| 168 | .def("r_s8", (s8(CInifile::*)(LPCSTR, LPCSTR)) & CInifile::r_s8) |
| 169 | |
| 170 | .def("r_u32_hex", (u32(CInifile::*)(LPCSTR, LPCSTR)) & CInifile::r_u32_hex) |
| 171 | .def("r_u16_hex", (u16(CInifile::*)(LPCSTR, LPCSTR)) & CInifile::r_u16_hex) |
| 172 | .def("r_u8_hex", (u8(CInifile::*)(LPCSTR, LPCSTR)) & CInifile::r_u8_hex) |
| 173 | |
| 174 | .def("r_float", (float(CInifile::*)(LPCSTR, LPCSTR)) & CInifile::r_float) |
| 175 | .def("r_vector2", (Fvector2(CInifile::*)(LPCSTR, LPCSTR)) & CInifile::r_fvector2) |
| 176 | .def("r_vector", (Fvector3(CInifile::*)(LPCSTR, LPCSTR)) & CInifile::r_fvector3) |
| 177 | .def("r_vector4", (Fvector4(CInifile::*)(LPCSTR, LPCSTR)) & CInifile::r_fvector4) |
| 178 | |
| 179 | .def("r_clsid", &r_clsid_script) |
| 180 | .def("r_string_wq", &r_string_wb_script) |
| 181 | |
| 182 | //.def("annotation", &CInifile::annotation) |
| 183 | |
| 184 | .def("w_bool", &CInifile::w_bool) |
| 185 | .def("w_string", &CInifile::w_string) |
| 186 | .def("w_u32", &CInifile::w_u32) |
| 187 | .def("w_s32", &CInifile::w_s32) |
| 188 | .def("w_u16", &CInifile::w_u16) |
| 189 | .def("w_s16", &CInifile::w_s16) |
| 190 | .def("w_u8", &CInifile::w_u8) |
| 191 | .def("w_s8", &CInifile::w_s8) |
| 192 | |
| 193 | .def("w_u32_hex", &CInifile::w_u32_hex) |
| 194 | .def("w_u16_hex", &CInifile::w_u16_hex) |
| 195 | .def("w_u8_hex", &CInifile::w_u8_hex) |