1 /* 2 * Copyright (c) 2021 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #include "store_mgr_proxy.h" 17 18 #include <memory> 19 #include <string> 20 21 namespace OHOS { 22 namespace HiviewDFX { GetDocStore(const std::string & db)23std::shared_ptr<DocStore> StoreMgrProxy::GetDocStore(const std::string& db) 24 { 25 Option option; 26 option.db = db; 27 option.flag = Option::NO_TRIM_ON_CLOSE; 28 return storeManager_.GetDocStore(option); 29 } 30 BackupDocStore(const std::string & db,const std::string & backupFile)31int StoreMgrProxy::BackupDocStore(const std::string& db, const std::string &backupFile) 32 { 33 Option option; 34 option.db = db; 35 return storeManager_.OnlineBackupDocStore(option, backupFile); 36 } 37 CloseDocStore(const std::string & db)38int StoreMgrProxy::CloseDocStore(const std::string& db) 39 { 40 Option option; 41 option.db = db; 42 return storeManager_.CloseDocStore(option); 43 } 44 DeleteDocStore(const std::string & db)45int StoreMgrProxy::DeleteDocStore(const std::string& db) 46 { 47 Option option; 48 option.db = db; 49 return storeManager_.DeleteDocStore(option); 50 } 51 } // HiviewDFX 52 } // OHOS