store: small cleanups

Remove readonly/inmemory from properties. Add read_only() accessor.
This commit is contained in:
Dirk-Jan C. Binnema
2023-04-23 20:26:16 +03:00
parent 1acf00bdd5
commit a3538e5ef1
2 changed files with 28 additions and 28 deletions

View File

@ -127,9 +127,7 @@ public:
std::string schema_version; /**< Database schema version */
std::time_t created; /**< database creation time */
bool read_only; /**< Is the database opened read-only? */
size_t batch_size; /**< Maximum database transaction batch size */
bool in_memory; /**< Is this an in-memory database (for testing)?*/
std::string root_maildir; /**< Absolute path to the top-level maildir */
@ -164,6 +162,27 @@ public:
Statistics statistics() const;
/**
* Get the number of documents in the document database
*
* @return the number
*/
std::size_t size() const;
/**
* Is the database empty?
*
* @return true or false
*/
bool empty() const { return size() == 0; }
/**
* Is the database read-only?
*
* @return true or false
*/
bool read_only() const;
/**
* Get the ContactsCache object for this store
*
@ -424,20 +443,6 @@ public:
*/
void set_dirstamp(const std::string& path, time_t tstamp);
/**
* Get the number of documents in the document database
*
* @return the number
*/
std::size_t size() const;
/**
* Is the database empty?
*
* @return true or false
*/
bool empty() const;
/**
* Commit the current batch of modifications to disk, opportunistically.
* If no transaction is underway, do nothing.