|
|
@ -122,7 +122,7 @@ protected: |
|
|
|
CDataStream ssKey(SER_DISK, CLIENT_VERSION); |
|
|
|
CDataStream ssKey(SER_DISK, CLIENT_VERSION); |
|
|
|
ssKey.reserve(1000); |
|
|
|
ssKey.reserve(1000); |
|
|
|
ssKey << key; |
|
|
|
ssKey << key; |
|
|
|
Dbt datKey(&ssKey[0], ssKey.size()); |
|
|
|
Dbt datKey(ssKey.data(), ssKey.size()); |
|
|
|
|
|
|
|
|
|
|
|
// Read
|
|
|
|
// Read
|
|
|
|
Dbt datValue; |
|
|
|
Dbt datValue; |
|
|
@ -158,13 +158,13 @@ protected: |
|
|
|
CDataStream ssKey(SER_DISK, CLIENT_VERSION); |
|
|
|
CDataStream ssKey(SER_DISK, CLIENT_VERSION); |
|
|
|
ssKey.reserve(1000); |
|
|
|
ssKey.reserve(1000); |
|
|
|
ssKey << key; |
|
|
|
ssKey << key; |
|
|
|
Dbt datKey(&ssKey[0], ssKey.size()); |
|
|
|
Dbt datKey(ssKey.data(), ssKey.size()); |
|
|
|
|
|
|
|
|
|
|
|
// Value
|
|
|
|
// Value
|
|
|
|
CDataStream ssValue(SER_DISK, CLIENT_VERSION); |
|
|
|
CDataStream ssValue(SER_DISK, CLIENT_VERSION); |
|
|
|
ssValue.reserve(10000); |
|
|
|
ssValue.reserve(10000); |
|
|
|
ssValue << value; |
|
|
|
ssValue << value; |
|
|
|
Dbt datValue(&ssValue[0], ssValue.size()); |
|
|
|
Dbt datValue(ssValue.data(), ssValue.size()); |
|
|
|
|
|
|
|
|
|
|
|
// Write
|
|
|
|
// Write
|
|
|
|
int ret = pdb->put(activeTxn, &datKey, &datValue, (fOverwrite ? 0 : DB_NOOVERWRITE)); |
|
|
|
int ret = pdb->put(activeTxn, &datKey, &datValue, (fOverwrite ? 0 : DB_NOOVERWRITE)); |
|
|
@ -187,7 +187,7 @@ protected: |
|
|
|
CDataStream ssKey(SER_DISK, CLIENT_VERSION); |
|
|
|
CDataStream ssKey(SER_DISK, CLIENT_VERSION); |
|
|
|
ssKey.reserve(1000); |
|
|
|
ssKey.reserve(1000); |
|
|
|
ssKey << key; |
|
|
|
ssKey << key; |
|
|
|
Dbt datKey(&ssKey[0], ssKey.size()); |
|
|
|
Dbt datKey(ssKey.data(), ssKey.size()); |
|
|
|
|
|
|
|
|
|
|
|
// Erase
|
|
|
|
// Erase
|
|
|
|
int ret = pdb->del(activeTxn, &datKey, 0); |
|
|
|
int ret = pdb->del(activeTxn, &datKey, 0); |
|
|
@ -207,7 +207,7 @@ protected: |
|
|
|
CDataStream ssKey(SER_DISK, CLIENT_VERSION); |
|
|
|
CDataStream ssKey(SER_DISK, CLIENT_VERSION); |
|
|
|
ssKey.reserve(1000); |
|
|
|
ssKey.reserve(1000); |
|
|
|
ssKey << key; |
|
|
|
ssKey << key; |
|
|
|
Dbt datKey(&ssKey[0], ssKey.size()); |
|
|
|
Dbt datKey(ssKey.data(), ssKey.size()); |
|
|
|
|
|
|
|
|
|
|
|
// Exists
|
|
|
|
// Exists
|
|
|
|
int ret = pdb->exists(activeTxn, &datKey, 0); |
|
|
|
int ret = pdb->exists(activeTxn, &datKey, 0); |
|
|
@ -234,7 +234,7 @@ protected: |
|
|
|
Dbt datKey; |
|
|
|
Dbt datKey; |
|
|
|
unsigned int fFlags = DB_NEXT; |
|
|
|
unsigned int fFlags = DB_NEXT; |
|
|
|
if (setRange) { |
|
|
|
if (setRange) { |
|
|
|
datKey.set_data(&ssKey[0]); |
|
|
|
datKey.set_data(ssKey.data()); |
|
|
|
datKey.set_size(ssKey.size()); |
|
|
|
datKey.set_size(ssKey.size()); |
|
|
|
fFlags = DB_SET_RANGE; |
|
|
|
fFlags = DB_SET_RANGE; |
|
|
|
} |
|
|
|
} |
|
|
|