aboutsummaryrefslogtreecommitdiffhomepage
path: root/Firestore/Source/Local/FSTLevelDB.mm
diff options
context:
space:
mode:
authorGravatar Gil <mcg@google.com>2018-06-13 08:12:09 -0700
committerGravatar GitHub <noreply@github.com>2018-06-13 08:12:09 -0700
commitafd897619fba10b881c4567d76793c6fdc60e93a (patch)
tree916cfceabe732ca375b82c7fe4e2cecfb265d251 /Firestore/Source/Local/FSTLevelDB.mm
parent51fb4d0ca4fae5ad30b53c9470f9e59c4678b034 (diff)
Minor LevelDB cleanups (#1401)
* Add leveldb_transaction* to the CMake build * Use std::unique_ptr for leveldb::DB pointers
Diffstat (limited to 'Firestore/Source/Local/FSTLevelDB.mm')
-rw-r--r--Firestore/Source/Local/FSTLevelDB.mm6
1 files changed, 6 insertions, 0 deletions
diff --git a/Firestore/Source/Local/FSTLevelDB.mm b/Firestore/Source/Local/FSTLevelDB.mm
index 9f75a3e..9dc50a2 100644
--- a/Firestore/Source/Local/FSTLevelDB.mm
+++ b/Firestore/Source/Local/FSTLevelDB.mm
@@ -17,6 +17,7 @@
#import "Firestore/Source/Local/FSTLevelDB.h"
#include <memory>
+#include <utility>
#import "FIRFirestoreErrors.h"
#import "Firestore/Source/Local/FSTLevelDBMigrations.h"
@@ -60,6 +61,7 @@ using leveldb::WriteOptions;
@implementation FSTLevelDB {
std::unique_ptr<LevelDbTransaction> _transaction;
+ std::unique_ptr<leveldb::DB> _ptr;
FSTTransactionRunner _transactionRunner;
}
@@ -82,6 +84,10 @@ using leveldb::WriteOptions;
return self;
}
+- (leveldb::DB *)ptr {
+ return _ptr.get();
+}
+
- (const FSTTransactionRunner &)run {
return _transactionRunner;
}