Commit Graph

13 Commits

Author SHA1 Message Date
Christopher Lam
0c4d438a0e [kvp-frame.cpp] expose iterator, skip inexistent frame 2022-04-09 17:45:44 +08:00
Christian Gruber
01c76e2391 Remove unused template of function for_each_slot_prefix()
for_each_slot_prefix() is not used anywhere with two arguments
2020-02-17 23:41:05 +01:00
Christian Gruber
322f2d99de Rework key prefix matching
Use C string comparison instead of C++ function std::mismatch to increase
performance.
2020-02-10 22:31:29 +01:00
Christian Gruber
da60560ac4 Change behaviour of KvpFrame::for_each_slot_prefix()
Provided function func is now called with key suffix only instead of
full key (prefix is omitted). This is neccessary for fixing function
build_token_info() in the next commit.
2020-02-02 18:00:27 +01:00
lmat
f782be1a51 Code review responses
Using Aliases to represent cmplicated types
Corrected variable-sized array on stack
Using PascalCase for type names and aliases
2017-12-21 07:39:33 -05:00
lmat
29ad8ff9b0 Remove unused kvp function 2017-12-21 07:39:33 -05:00
lmat
5636afc4a2 Kvp no longer parses entries looking for delimiters 2017-12-21 07:39:32 -05:00
lmat
9d7ec35ce5 Removed qof_instance_set_kvp, qof_instance_get_kvp
And replaced them with versions that take lists of key path elements.
This is in an effort to eliminate the parsing of kvp keys.
2017-12-21 07:39:32 -05:00
lmat
eb6dad86e3 Fixed conversion problem
The conversion assumed there were only three levels to bayes import
map kvp: IMAP token, user-supplied token, GUID/account name. In
actuality, since user-supplied tokens could have the delimiter in them,
there could be several. This fix takes that into account like so:
IMAP token, potentially several user-supplied tokens, GUID/account name.

The import map is undergoing two conversions at the same time: account names
to guids and an hierarchical representation to a flat representation in KVP.
2017-12-21 07:39:32 -05:00
lmat
b3667c76fc Implement flat bayes kvp
The bayes data are stored in the KVP store. Before this commit, they are
stored under /import-map-bayes/<token>/<account guid>/count (where count
is the datum that "matters" in bayes matching).

The problem with this is that any token including the kvp delimiter
(currently '/') gets divided, and is not found correctly during bayes
kvp searching. The quickest solution to this is to replace all "/"
characters with some other character. That has been done, along with a
re-structuring of the bayes matching code to take advantage of c++
features to make the code more concise and readable.

Also modified some test functions to fix leaks and double-frees: the
same kvp value can't be in the kvp tree twice.

Also, when I added code to clean up after the tests, some things started
breaking due to double-delete. Apparently const_cast was hiding some
programming errors. Really? You don't say? When giving a GUID* to KvpValue,
the latter takes ownership of the former.
2017-12-21 07:39:32 -05:00
lmat
08aa0104ef Change kvp string representation
The nested representation was very noisy. Now, the string representation
shows one line per value with the full prefix which is also more
expressive than the old version.
2017-12-21 07:39:32 -05:00
lmat
34e0d6cfa0 kvp frame to template and correcting failure macro
The template avoids the need to cast to and from void*, and adds flexibility to
the targeted function's signature.

test-stuff.h defines a macro, "failure" which is used as an identifier
in the standard IO library, so I moved any inclusion of test-stuff.h to
the last include position so that "failure" wouldn't be defined before
the IO library was included.
2017-12-21 07:39:32 -05:00
Geert Janssens
83d14e1c1c Restructure the src directory
It is split into
- /libgnucash (for the non-gui bits)
- /gnucash (for the gui)
- /common (misc source files used by both)
- /bindings (currently only holds python bindings)

This is the first step in restructuring the code. It will need much
more fine tuning later on.
2017-08-10 18:45:00 +02:00