• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 #ifndef NATIVE_RDB_SQLITE_CONFIG_H
17 #define NATIVE_RDB_SQLITE_CONFIG_H
18 
19 #include <string>
20 #include <vector>
21 
22 #include "rdb_store_config.h"
23 
24 namespace OHOS {
25 namespace NativeRdb {
26 
27 class SqliteConfig {
28 public:
29     explicit SqliteConfig(const RdbStoreConfig &config);
30     ~SqliteConfig();
31     std::string GetPath() const;
32     void SetPath(std::string newPath);
33     StorageMode GetStorageMode() const;
34     std::string GetJournalMode() const;
35     std::string GetSyncMode() const;
36     std::string GetDatabaseFileType() const;
37     bool IsReadOnly() const;
38     bool IsEncrypt() const;
39     std::string GetBundleName() const;
40     bool IsCreateNecessary() const;
41     void SetCreateNecessary(bool CreateNecessary);
42 private:
43     std::string path;
44     StorageMode storageMode;
45     std::string journalMode;
46     std::string syncMode;
47     bool readOnly;
48     std::string databaseFileType;
49 
50     // Encryption
51     bool isEncrypt = false;
52     std::string bundleName;
53     bool isCreateNecessary;
54 };
55 
56 } // namespace NativeRdb
57 } // namespace OHOS
58 #endif
59