Commit graph

15 commits

Author SHA1 Message Date
Tim Eves
a441321cf5 Newer compilers are complaining about catching std::exception derived class by value, this fixes that. 2019-01-14 09:44:43 +07:00
Tim Eves
da815eb92e Fix use-after0free in abstract_processor::lookup_option() design
Since option was not assigned to non temporary storage the string was deleted and caused the API to return freed memory.
2018-12-19 12:15:24 +07:00
Tim Eves
f8f1407fb8 Rfactor options out of class state into virtual methods on abstract_processor 2018-12-19 11:20:28 +07:00
Tim Eves
57b01ad640 Implement new state API using existing machinery. 2018-12-18 08:39:37 +07:00
Tim Eves
29a5fa6d2e Add more convert function use, psuh_persist actions and various tidy-ups 2018-12-17 23:40:44 +07:00
Tim Eves
18ce72e7c8 Refactor keyboard processor initialisation code.
Turn the keyboard class backing the km_kbp_keyboard and km_kbp_keyboard_attr objects into just keyboard_attributes.
Move the abstract_processor and sublcasses as the objects that back km_kbp_keyboard and make keyboard_attrs a member of the asbtract_processor.
Move kmx_processor and mock_processor declarations into their own headers.
Make all vector<km_kbp_option_item> into vector<option> to handle memory management, moving and copying correctly.
Update test cases accordingly
2018-12-17 06:02:22 +07:00
Marc Durdin
827b00c43c [common] Addressing review comments 2018-11-24 11:33:05 +11:00
Marc Durdin
37f424f090 [common] Working options model. Introduces some gunk around state and options which should be reviewed with TSE 2018-11-20 12:19:43 +11:00
Marc Durdin
9ca7bab5f9 [Common] Final checks 2018-11-12 19:23:54 +11:00
Marc Durdin
1ab04f681a [Common] Code Review updates, some minor changes to API, mostly comments and tests; one bug fix 2018-11-12 19:12:59 +11:00
Tim Eves
242105216a Rename options_set -> options and option -> option_item 2018-11-07 02:13:40 +07:00
Tim Eves
9cb22221c6 Rework options API per review
Additionally refactored option.hpp into option.hpp & option.cpp.
lookup now returns just the value since scope and key are fully 
specified in the arguments, but updates and SAVE/RESET action items 
still provide scope, key & value.
2018-11-07 01:37:32 +07:00
Tim Eves
93c76c14df Move headers into include/keyman from include/
Necessary to allow keyboardprocessor.h to refer to auxillary headers as 
<keyboard/header.h>
2018-11-06 16:19:14 +07:00
Tim Eves
0fdb64011f Fix bugs in options_set api
* Initialise cached option value with options_set's scope so correct 
scope is returned.
* Use unordered_map::operator[] as emplace never overwrites.
* Ensure that km_kbp_options_set_to_json() returns the document size 
including the null.
* correct scope_name_lut so scope names are in the right order.
2018-10-30 17:07:00 +07:00
Tim Eves
ef548606aa Move keyboardprocessor into it's new toplevel under common/engine 2018-10-25 13:43:28 +07:00
Renamed from keyboardprocessor/src/km_kbp_options_api.cpp (Browse further)