Add directory based open & create calls#74
Add directory based open & create calls#74movitto wants to merge 1 commit intocppalliance:masterfrom
Conversation
|
This is a reasonable quality of life feature in principle, but it should not require accessing private members of |
|
Hey @vinniefalco I'm afraid I'm not following. The basic_store public/private access control is still in effect and this patch just overloads nudb::create and nudb::basic_store#open to facilitate dir based initialization. Can you help me understand your design principles behind preferring external wrapper methods to extending the base_store interface? |
Init files from default names under dir
|
OK @vinniefalco thanks for the link, I just bought a copy of "effective c++" for future reference! I incorporated the feedback you had for this patch from this PR and #75. Specifically:
Let me know if there's anything else! |
Since in the examples and most implementations NuDB will use 'nudb.[dat|key|log]' files to persistently store the DB, this patch simplifies this 'default' scenario, allowing the end user to create and access a database given the directory in which those files reside.
Thus the user can now open the db like so:
store.open("/path/to/db/", error_code)