mirror of
https://gitee.com/openharmony/distributeddatamgr_relational_store
synced 2024-11-23 07:00:41 +00:00
ndk
Signed-off-by: lihuihui <lihuihui29@huawei.com>
This commit is contained in:
parent
2ee2713f02
commit
0beb5f8ebb
@ -87,7 +87,7 @@
|
||||
"oh_predicates.h",
|
||||
"relational_store.h",
|
||||
"oh_cursor.h",
|
||||
"relational_error_code.h",
|
||||
"relational_store_error_code.h",
|
||||
"oh_value_object.h",
|
||||
"oh_values_bucket.h"
|
||||
],
|
||||
|
@ -129,7 +129,7 @@ void RdbStoreImpl::GetSchema(const RdbStoreConfig &config)
|
||||
|
||||
RdbStoreImpl::RdbStoreImpl(const RdbStoreConfig &config)
|
||||
: rdbStoreConfig(config), connectionPool(nullptr), isOpen(false), path(""), orgPath(""), isReadOnly(false),
|
||||
isMemoryRdb(false), isEncrypt_(false)
|
||||
isMemoryRdb(false), isEncrypt_(false), backupFilePath_({})
|
||||
{
|
||||
}
|
||||
|
||||
@ -1110,12 +1110,12 @@ int RdbStoreImpl::ConfigLocale(const std::string localeStr)
|
||||
int RdbStoreImpl::Restore(const std::string backupPath, const std::vector<uint8_t> &newKey)
|
||||
{
|
||||
if (isOpen == false) {
|
||||
LOG_ERROR("ChangeDbFileForRestore:The connection pool has been closed.");
|
||||
LOG_ERROR("The connection pool has been closed.");
|
||||
return E_ERROR;
|
||||
}
|
||||
|
||||
if (connectionPool == nullptr) {
|
||||
LOG_ERROR("ChangeDbFileForRestore:The connectionPool is null.");
|
||||
LOG_ERROR("The connectionPool is null.");
|
||||
return E_ERROR;
|
||||
}
|
||||
|
||||
@ -1126,7 +1126,7 @@ int RdbStoreImpl::Restore(const std::string backupPath, const std::vector<uint8_
|
||||
}
|
||||
|
||||
if (backupFilePath == path) {
|
||||
LOG_ERROR("ChangeDbFileForRestore:The backupPath and path should not be same.");
|
||||
LOG_ERROR("The backupPath and path should not be same.");
|
||||
return E_INVALID_FILE_PATH;
|
||||
}
|
||||
|
||||
|
@ -359,16 +359,6 @@ public:
|
||||
*/
|
||||
virtual int Restore(const std::string backupPath, const std::vector<uint8_t> &newKey = std::vector<uint8_t>()) = 0;
|
||||
|
||||
/**
|
||||
* @brief Restores a database from a specified encrypted or unencrypted database file.
|
||||
*
|
||||
* @param newPath Indicates the database new path.
|
||||
* @param backupPath Indicates the database backup path.
|
||||
* @param newKey Indicates the database new key.
|
||||
*/
|
||||
virtual int ChangeDbFileForRestore(const std::string newPath, const std::string backupPath,
|
||||
const std::vector<uint8_t> &newKey) = 0;
|
||||
|
||||
/**
|
||||
* @brief Set table to be distributed table.
|
||||
*
|
||||
|
@ -83,8 +83,6 @@ public:
|
||||
virtual bool IsReadOnly() const = 0;
|
||||
virtual bool IsMemoryRdb() const = 0;
|
||||
virtual int Restore(const std::string backupPath, const std::vector<uint8_t> &newKey = std::vector<uint8_t>()) = 0;
|
||||
virtual int ChangeDbFileForRestore(const std::string newPath, const std::string backupPath,
|
||||
const std::vector<uint8_t> &newKey) = 0;
|
||||
};
|
||||
} // namespace OHOS::NativeRdb
|
||||
#endif
|
||||
|
@ -22,7 +22,7 @@ ohos_ndk_headers("native_rdb_ndk_header") {
|
||||
"./include/oh_predicates.h",
|
||||
"./include/oh_value_object.h",
|
||||
"./include/oh_values_bucket.h",
|
||||
"./include/relational_error_code.h",
|
||||
"./include/relational_store_error_code.h",
|
||||
"./include/relational_store.h",
|
||||
]
|
||||
}
|
||||
|
@ -13,8 +13,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef RELATIONAL_ERRNO_CODE_H
|
||||
#define RELATIONAL_ERRNO_CODE_H
|
||||
#ifndef RELATIONAL_STORE_ERRNO_CODE_H
|
||||
#define RELATIONAL_STORE_ERRNO_CODE_H
|
||||
|
||||
/**
|
||||
* @addtogroup RDB
|
||||
@ -31,7 +31,7 @@
|
||||
|
||||
|
||||
/**
|
||||
* @file relational_error_code.h
|
||||
* @file relational_store_error_code.h
|
||||
*
|
||||
* @brief Declaration error code information.
|
||||
*
|
||||
@ -313,4 +313,4 @@ typedef enum OH_Rdb_ErrCode {
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif // RELATIONAL_ERRNO_CODE_H
|
||||
#endif // RELATIONAL_STORE_ERRNO_CODE_H
|
@ -20,7 +20,7 @@
|
||||
#include "logger.h"
|
||||
#include "oh_cursor.h"
|
||||
#include "relational_cursor_impl.h"
|
||||
#include "relational_error_code.h"
|
||||
#include "relational_store_error_code.h"
|
||||
#include "rdb_errno.h"
|
||||
#include "securec.h"
|
||||
|
||||
|
@ -15,7 +15,7 @@
|
||||
|
||||
#include "logger.h"
|
||||
#include "oh_predicates.h"
|
||||
#include "relational_error_code.h"
|
||||
#include "relational_store_error_code.h"
|
||||
#include "relational_predicates_impl.h"
|
||||
#include "relational_value_object_impl.h"
|
||||
#include "sqlite_global_config.h"
|
||||
|
@ -20,7 +20,7 @@
|
||||
#include "rdb_helper.h"
|
||||
#include "rdb_predicates.h"
|
||||
#include "relational_cursor_impl.h"
|
||||
#include "relational_error_code.h"
|
||||
#include "relational_store_error_code.h"
|
||||
#include "relational_predicates_impl.h"
|
||||
#include "relational_store_impl.h"
|
||||
#include "relational_value_object_impl.h"
|
||||
|
@ -15,7 +15,7 @@
|
||||
|
||||
#include "logger.h"
|
||||
#include "oh_value_object.h"
|
||||
#include "relational_error_code.h"
|
||||
#include "relational_store_error_code.h"
|
||||
#include "relational_value_object_impl.h"
|
||||
|
||||
using namespace OHOS::RdbNdk;
|
||||
|
@ -17,7 +17,7 @@
|
||||
|
||||
#include "logger.h"
|
||||
#include "oh_values_bucket.h"
|
||||
#include "relational_error_code.h"
|
||||
#include "relational_store_error_code.h"
|
||||
#include "relational_values_bucket_impl.h"
|
||||
#include "value_object.h"
|
||||
#include "securec.h"
|
||||
|
@ -18,7 +18,7 @@
|
||||
#include <string>
|
||||
#include "common.h"
|
||||
#include "relational_store.h"
|
||||
#include "relational_error_code.h"
|
||||
#include "relational_store_error_code.h"
|
||||
|
||||
using namespace testing::ext;
|
||||
using namespace OHOS::NativeRdb;
|
||||
|
Loading…
Reference in New Issue
Block a user