|
|
@ -228,19 +228,17 @@ protected: |
|
|
|
return pcursor; |
|
|
|
return pcursor; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
int ReadAtCursor(Dbc* pcursor, CDataStream& ssKey, CDataStream& ssValue, unsigned int fFlags = DB_NEXT) |
|
|
|
int ReadAtCursor(Dbc* pcursor, CDataStream& ssKey, CDataStream& ssValue, bool setRange = false) |
|
|
|
{ |
|
|
|
{ |
|
|
|
// Read at cursor
|
|
|
|
// Read at cursor
|
|
|
|
Dbt datKey; |
|
|
|
Dbt datKey; |
|
|
|
if (fFlags == DB_SET || fFlags == DB_SET_RANGE || fFlags == DB_GET_BOTH || fFlags == DB_GET_BOTH_RANGE) { |
|
|
|
unsigned int fFlags = DB_NEXT; |
|
|
|
|
|
|
|
if (setRange) { |
|
|
|
datKey.set_data(&ssKey[0]); |
|
|
|
datKey.set_data(&ssKey[0]); |
|
|
|
datKey.set_size(ssKey.size()); |
|
|
|
datKey.set_size(ssKey.size()); |
|
|
|
|
|
|
|
fFlags = DB_SET_RANGE; |
|
|
|
} |
|
|
|
} |
|
|
|
Dbt datValue; |
|
|
|
Dbt datValue; |
|
|
|
if (fFlags == DB_GET_BOTH || fFlags == DB_GET_BOTH_RANGE) { |
|
|
|
|
|
|
|
datValue.set_data(&ssValue[0]); |
|
|
|
|
|
|
|
datValue.set_size(ssValue.size()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
datKey.set_flags(DB_DBT_MALLOC); |
|
|
|
datKey.set_flags(DB_DBT_MALLOC); |
|
|
|
datValue.set_flags(DB_DBT_MALLOC); |
|
|
|
datValue.set_flags(DB_DBT_MALLOC); |
|
|
|
int ret = pcursor->get(&datKey, &datValue, fFlags); |
|
|
|
int ret = pcursor->get(&datKey, &datValue, fFlags); |
|
|
|