Merge branch 'master' into fws

This commit is contained in:
fangwusheng
2026-03-30 10:28:45 +08:00
9 changed files with 1219 additions and 315 deletions
+33 -9
View File
@@ -18,40 +18,64 @@ package ohos.data.data_share_predicates
import ohos.data.values_bucket.*
import ohos.labels.*
@!APILevel[since: "22", syscap: "SystemCapability.DistributedDataManager.DataShare.Core"]
@!APILevel[
since: "22",
syscap: "SystemCapability.DistributedDataManager.DataShare.Core"
]
public class DataSharePredicates {
@!APILevel[since: "22", syscap: "SystemCapability.DistributedDataManager.DataShare.Core"]
@!APILevel[
since: "22",
syscap: "SystemCapability.DistributedDataManager.DataShare.Core"
]
public init() {
super()
}
@!APILevel[since: "22", syscap: "SystemCapability.DistributedDataManager.DataShare.Core", throwexception: true]
@!APILevel[
since: "22",
syscap: "SystemCapability.DistributedDataManager.DataShare.Core"
]
public func equalTo(field: String, value: VBValueType): DataSharePredicates {
return DataSharePredicates()
}
@!APILevel[since: "22", syscap: "SystemCapability.DistributedDataManager.DataShare.Core", throwexception: true]
@!APILevel[
since: "22",
syscap: "SystemCapability.DistributedDataManager.DataShare.Core"
]
public func and(): DataSharePredicates {
return DataSharePredicates()
}
@!APILevel[since: "22", syscap: "SystemCapability.DistributedDataManager.DataShare.Core", throwexception: true]
@!APILevel[
since: "22",
syscap: "SystemCapability.DistributedDataManager.DataShare.Core"
]
public func orderByAsc(field: String): DataSharePredicates {
return DataSharePredicates()
}
@!APILevel[since: "22", syscap: "SystemCapability.DistributedDataManager.DataShare.Core", throwexception: true]
@!APILevel[
since: "22",
syscap: "SystemCapability.DistributedDataManager.DataShare.Core"
]
public func orderByDesc(field: String): DataSharePredicates {
return DataSharePredicates()
}
@!APILevel[since: "22", syscap: "SystemCapability.DistributedDataManager.DataShare.Core", throwexception: true]
@!APILevel[
since: "22",
syscap: "SystemCapability.DistributedDataManager.DataShare.Core"
]
public func limit(total: Int32, offset: Int32): DataSharePredicates {
return DataSharePredicates()
}
@!APILevel[since: "22", syscap: "SystemCapability.DistributedDataManager.DataShare.Core", throwexception: true]
@!APILevel[
since: "22",
syscap: "SystemCapability.DistributedDataManager.DataShare.Core"
]
public func inValues(field: String, value: Array<VBValueType>): DataSharePredicates {
return DataSharePredicates()
}
}
}
+366 -85
View File
@@ -19,62 +19,110 @@ import ohos.app.ability.BaseContext
import ohos.business_exception.BusinessException
import ohos.labels.*
@!APILevel[since: "22", syscap: "SystemCapability.DistributedDataManager.KVStore.DistributedKVStore"]
@!APILevel[
since: "22",
syscap: "SystemCapability.DistributedDataManager.KVStore.DistributedKVStore"
]
public class DeviceKVStore <: SingleKVStore {
static func getKVStore(id: Int64, storeId: String, options: KVOptions): DeviceKVStore {
DeviceKVStore()
}
@!APILevel[since: "22", syscap: "SystemCapability.DistributedDataManager.KVStore.Core", throwexception: true, workerthread: true]
@!APILevel[
since: "22",
syscap: "SystemCapability.DistributedDataManager.KVStore.Core",
throwexception: true,
workerthread: true
]
public func get(key: String): KVValueType {
return KVValueType.StringValue(String())
}
@!APILevel[since: "22", syscap: "SystemCapability.DistributedDataManager.KVStore.Core", throwexception: true, workerthread: true]
@!APILevel[
since: "22",
syscap: "SystemCapability.DistributedDataManager.KVStore.Core",
throwexception: true,
workerthread: true
]
public func getEntries(keyPrefix: String): Array<Entry> {
return Array()
}
@!APILevel[since: "22", syscap: "SystemCapability.DistributedDataManager.KVStore.Core", throwexception: true, workerthread: true]
@!APILevel[
since: "22",
syscap: "SystemCapability.DistributedDataManager.KVStore.Core",
throwexception: true,
workerthread: true
]
public func getEntries(query: Query): Array<Entry> {
return Array()
}
@!APILevel[since: "22", syscap: "SystemCapability.DistributedDataManager.KVStore.Core", throwexception: true, workerthread: true]
@!APILevel[
since: "22",
syscap: "SystemCapability.DistributedDataManager.KVStore.Core",
throwexception: true,
workerthread: true
]
public func getResultSet(keyPrefix: String): KVStoreResultSet {
return KVStoreResultSet()
}
@!APILevel[since: "22", syscap: "SystemCapability.DistributedDataManager.KVStore.Core", throwexception: true, workerthread: true]
@!APILevel[
since: "22",
syscap: "SystemCapability.DistributedDataManager.KVStore.Core",
throwexception: true,
workerthread: true
]
public func getResultSet(query: Query): KVStoreResultSet {
return KVStoreResultSet()
}
@!APILevel[since: "22", syscap: "SystemCapability.DistributedDataManager.KVStore.Core", throwexception: true, workerthread: true]
@!APILevel[
since: "22",
syscap: "SystemCapability.DistributedDataManager.KVStore.Core",
throwexception: true,
workerthread: true
]
public func getResultSize(query: Query): Int32 {
return 0
}
public init() {
super()
}
}
@!APILevel[since: "22", syscap: "SystemCapability.DistributedDataManager.KVStore.DistributedKVStore"]
@!APILevel[
since: "22",
syscap: "SystemCapability.DistributedDataManager.KVStore.DistributedKVStore"
]
public class DistributedKVStore {
@!APILevel[since: "22", syscap: "SystemCapability.DistributedDataManager.KVStore.Core", throwexception: true]
@!APILevel[
since: "22",
syscap: "SystemCapability.DistributedDataManager.KVStore.Core",
throwexception: true
]
public static func createKVManager(config: KVManagerConfig): KVManager {
return KVManager()
}
public init() {
init() {
super()
}
}
@!APILevel[since: "22", syscap: "SystemCapability.DistributedDataManager.KVStore.Core"]
@!APILevel[
since: "22",
syscap: "SystemCapability.DistributedDataManager.KVStore.Core"
]
public class KVManager {
@!APILevel[since: "22", syscap: "SystemCapability.DistributedDataManager.KVStore.Core", throwexception: true, workerthread: true]
@!APILevel[
since: "22",
syscap: "SystemCapability.DistributedDataManager.KVStore.Core",
throwexception: true,
workerthread: true
]
public func getKVStore<T>(storeId: String, options: KVOptions): T where T <: SingleKVStore {
let KVStore = match (T.getKVStore(0, storeId, options) as T) {
case Some(v) => v
@@ -83,71 +131,146 @@ public class KVManager {
return KVStore
}
@!APILevel[since: "22", syscap: "SystemCapability.DistributedDataManager.KVStore.Core", throwexception: true, workerthread: true]
@!APILevel[
since: "22",
syscap: "SystemCapability.DistributedDataManager.KVStore.Core",
throwexception: true,
workerthread: true
]
public func closeKVStore(appId: String, storeId: String): Unit {
return ()
}
@!APILevel[since: "22", syscap: "SystemCapability.DistributedDataManager.KVStore.Core", throwexception: true, workerthread: true]
@!APILevel[
since: "22",
syscap: "SystemCapability.DistributedDataManager.KVStore.Core",
throwexception: true,
workerthread: true
]
public func deleteKVStore(appId: String, storeId: String): Unit {
return ()
}
@!APILevel[since: "22", syscap: "SystemCapability.DistributedDataManager.KVStore.Core", throwexception: true, workerthread: true]
@!APILevel[
since: "22",
syscap: "SystemCapability.DistributedDataManager.KVStore.Core",
throwexception: true,
workerthread: true
]
public func getAllKVStoreId(appId: String): Array<String> {
return Array()
}
public init() {
super()
}
}
@!APILevel[since: "22", syscap: "SystemCapability.DistributedDataManager.KVStore.Core"]
@!APILevel[
since: "22",
syscap: "SystemCapability.DistributedDataManager.KVStore.Core"
]
public class Constants {
@!APILevel[since: "22", syscap: "SystemCapability.DistributedDataManager.KVStore.Core"]
@!APILevel[
since: "22",
syscap: "SystemCapability.DistributedDataManager.KVStore.Core"
]
public static let MAX_KEY_LENGTH: Int32 = 1024
@!APILevel[since: "22", syscap: "SystemCapability.DistributedDataManager.KVStore.Core"]
@!APILevel[
since: "22",
syscap: "SystemCapability.DistributedDataManager.KVStore.Core"
]
public static let MAX_VALUE_LENGTH: Int32 = 4194303
@!APILevel[since: "22", syscap: "SystemCapability.DistributedDataManager.KVStore.Core"]
@!APILevel[
since: "22",
syscap: "SystemCapability.DistributedDataManager.KVStore.Core"
]
public static let MAX_KEY_LENGTH_DEVICE: Int32 = 896
@!APILevel[since: "22", syscap: "SystemCapability.DistributedDataManager.KVStore.Core"]
@!APILevel[
since: "22",
syscap: "SystemCapability.DistributedDataManager.KVStore.Core"
]
public static let MAX_STORE_ID_LENGTH: Int32 = 128
@!APILevel[since: "22", syscap: "SystemCapability.DistributedDataManager.KVStore.Core"]
@!APILevel[
since: "22",
syscap: "SystemCapability.DistributedDataManager.KVStore.Core"
]
public static let MAX_QUERY_LENGTH: Int32 = 512000
@!APILevel[since: "22", syscap: "SystemCapability.DistributedDataManager.KVStore.Core"]
@!APILevel[
since: "22",
syscap: "SystemCapability.DistributedDataManager.KVStore.Core"
]
public static let MAX_BATCH_SIZE: Int32 = 128
public init() {
super()
}
}
@!APILevel[since: "22", syscap: "SystemCapability.DistributedDataManager.KVStore.Core"]
@!APILevel[
since: "22",
syscap: "SystemCapability.DistributedDataManager.KVStore.Core"
]
public enum KVValueType {
@!APILevel[since: "22", syscap: "SystemCapability.DistributedDataManager.KVStore.Core"] StringValue(String)
| @!APILevel[since: "22", syscap: "SystemCapability.DistributedDataManager.KVStore.Core"] Integer(Int32)
| @!APILevel[since: "22", syscap: "SystemCapability.DistributedDataManager.KVStore.Core"] Float(Float32)
| @!APILevel[since: "22", syscap: "SystemCapability.DistributedDataManager.KVStore.Core"] ByteArray(Array<Byte>)
| @!APILevel[since: "22", syscap: "SystemCapability.DistributedDataManager.KVStore.Core"] Boolean(Bool)
| @!APILevel[since: "22", syscap: "SystemCapability.DistributedDataManager.KVStore.Core"] Double(Float64)
@!APILevel[
since: "22",
syscap: "SystemCapability.DistributedDataManager.KVStore.Core"
]
StringValue(String)
| @!APILevel[
since: "22",
syscap: "SystemCapability.DistributedDataManager.KVStore.Core"
]
Integer(Int32)
| @!APILevel[
since: "22",
syscap: "SystemCapability.DistributedDataManager.KVStore.Core"
]
Float(Float32)
| @!APILevel[
since: "22",
syscap: "SystemCapability.DistributedDataManager.KVStore.Core"
]
ByteArray(Array<Byte>)
| @!APILevel[
since: "22",
syscap: "SystemCapability.DistributedDataManager.KVStore.Core"
]
Boolean(Bool)
| @!APILevel[
since: "22",
syscap: "SystemCapability.DistributedDataManager.KVStore.Core"
]
Double(Float64)
| ...
}
@!APILevel[since: "22", syscap: "SystemCapability.DistributedDataManager.KVStore.Core"]
@!APILevel[
since: "22",
syscap: "SystemCapability.DistributedDataManager.KVStore.Core"
]
public class KVManagerConfig {
@!APILevel[since: "22", syscap: "SystemCapability.DistributedDataManager.KVStore.Core"]
@!APILevel[
since: "22",
syscap: "SystemCapability.DistributedDataManager.KVStore.Core"
]
public var bundleName: String
@!APILevel[since: "22", syscap: "SystemCapability.DistributedDataManager.KVStore.Core"]
@!APILevel[
since: "22",
syscap: "SystemCapability.DistributedDataManager.KVStore.Core"
]
public var context: BaseContext
@!APILevel[since: "22", syscap: "SystemCapability.DistributedDataManager.KVStore.Core"]
@!APILevel[
since: "22",
syscap: "SystemCapability.DistributedDataManager.KVStore.Core"
]
public init(context: BaseContext, bundleName: String) {
super()
this.bundleName = String()
@@ -155,31 +278,61 @@ public class KVManagerConfig {
}
}
@!APILevel[since: "22", syscap: "SystemCapability.DistributedDataManager.KVStore.Core"]
@!APILevel[
since: "22",
syscap: "SystemCapability.DistributedDataManager.KVStore.Core"
]
public enum KVSecurityLevel {
@!APILevel[since: "22", syscap: "SystemCapability.DistributedDataManager.KVStore.Core"]
@!APILevel[
since: "22",
syscap: "SystemCapability.DistributedDataManager.KVStore.Core"
]
S1
| @!APILevel[since: "22", syscap: "SystemCapability.DistributedDataManager.KVStore.Core"]
| @!APILevel[
since: "22",
syscap: "SystemCapability.DistributedDataManager.KVStore.Core"
]
S2
| @!APILevel[since: "22", syscap: "SystemCapability.DistributedDataManager.KVStore.Core"]
| @!APILevel[
since: "22",
syscap: "SystemCapability.DistributedDataManager.KVStore.Core"
]
S3
| @!APILevel[since: "22", syscap: "SystemCapability.DistributedDataManager.KVStore.Core"]
| @!APILevel[
since: "22",
syscap: "SystemCapability.DistributedDataManager.KVStore.Core"
]
S4
| ...
}
@!APILevel[since: "22", syscap: "SystemCapability.DistributedDataManager.KVStore.DistributedKVStore"]
@!APILevel[
since: "22",
syscap: "SystemCapability.DistributedDataManager.KVStore.DistributedKVStore"
]
public class FieldNode {
@!APILevel[since: "22", syscap: "SystemCapability.DistributedDataManager.KVStore.DistributedKVStore"]
@!APILevel[
since: "22",
syscap: "SystemCapability.DistributedDataManager.KVStore.DistributedKVStore"
]
public var default: String
@!APILevel[since: "22", syscap: "SystemCapability.DistributedDataManager.KVStore.DistributedKVStore"]
@!APILevel[
since: "22",
syscap: "SystemCapability.DistributedDataManager.KVStore.DistributedKVStore"
]
public var nullable: Bool
@!APILevel[since: "22", syscap: "SystemCapability.DistributedDataManager.KVStore.DistributedKVStore"]
@!APILevel[
since: "22",
syscap: "SystemCapability.DistributedDataManager.KVStore.DistributedKVStore"
]
public var nodeType: Int32
@!APILevel[since: "22", syscap: "SystemCapability.DistributedDataManager.KVStore.DistributedKVStore"]
@!APILevel[
since: "22",
syscap: "SystemCapability.DistributedDataManager.KVStore.DistributedKVStore"
]
public init(name: String, nullable: Bool, default: String, nodeType: Int32) {
super()
this.default = String()
@@ -188,21 +341,39 @@ public class FieldNode {
}
}
@!APILevel[since: "22", syscap: "SystemCapability.DistributedDataManager.KVStore.DistributedKVStore"]
@!APILevel[
since: "22",
syscap: "SystemCapability.DistributedDataManager.KVStore.DistributedKVStore"
]
public class Schema {
@!APILevel[since: "22", syscap: "SystemCapability.DistributedDataManager.KVStore.DistributedKVStore"]
@!APILevel[
since: "22",
syscap: "SystemCapability.DistributedDataManager.KVStore.DistributedKVStore"
]
public var root: FieldNode
@!APILevel[since: "22", syscap: "SystemCapability.DistributedDataManager.KVStore.DistributedKVStore"]
@!APILevel[
since: "22",
syscap: "SystemCapability.DistributedDataManager.KVStore.DistributedKVStore"
]
public var indexes: Array<String>
@!APILevel[since: "22", syscap: "SystemCapability.DistributedDataManager.KVStore.DistributedKVStore"]
@!APILevel[
since: "22",
syscap: "SystemCapability.DistributedDataManager.KVStore.DistributedKVStore"
]
public var mode: Int32
@!APILevel[since: "22", syscap: "SystemCapability.DistributedDataManager.KVStore.DistributedKVStore"]
@!APILevel[
since: "22",
syscap: "SystemCapability.DistributedDataManager.KVStore.DistributedKVStore"
]
public var skip: Int32
@!APILevel[since: "22", syscap: "SystemCapability.DistributedDataManager.KVStore.DistributedKVStore"]
@!APILevel[
since: "22",
syscap: "SystemCapability.DistributedDataManager.KVStore.DistributedKVStore"
]
public init(root: FieldNode, indexes: Array<String>, mode: Int32, skip: Int32) {
super()
this.root = FieldNode(
@@ -217,27 +388,52 @@ public class Schema {
}
}
@!APILevel[since: "22", syscap: "SystemCapability.DistributedDataManager.KVStore.Core"]
@!APILevel[
since: "22",
syscap: "SystemCapability.DistributedDataManager.KVStore.Core"
]
public class KVOptions {
@!APILevel[since: "22", syscap: "SystemCapability.DistributedDataManager.KVStore.Core"]
@!APILevel[
since: "22",
syscap: "SystemCapability.DistributedDataManager.KVStore.Core"
]
public var createIfMissing: Bool
@!APILevel[since: "22", syscap: "SystemCapability.DistributedDataManager.KVStore.Core"]
@!APILevel[
since: "22",
syscap: "SystemCapability.DistributedDataManager.KVStore.Core"
]
public var encrypt: Bool
@!APILevel[since: "22", syscap: "SystemCapability.DistributedDataManager.KVStore.Core"]
@!APILevel[
since: "22",
syscap: "SystemCapability.DistributedDataManager.KVStore.Core"
]
public var backup: Bool
@!APILevel[since: "22", permission: "ohos.permission.DISTRIBUTED_DATASYNC", syscap: "SystemCapability.DistributedDataManager.KVStore.Core"]
@!APILevel[
since: "22",
permission: "ohos.permission.DISTRIBUTED_DATASYNC",
syscap: "SystemCapability.DistributedDataManager.KVStore.Core"
]
public var autoSync: Bool
@!APILevel[since: "22", syscap: "SystemCapability.DistributedDataManager.KVStore.Core"]
@!APILevel[
since: "22",
syscap: "SystemCapability.DistributedDataManager.KVStore.Core"
]
public var securityLevel: KVSecurityLevel
@!APILevel[since: "22", syscap: "SystemCapability.DistributedDataManager.KVStore.DistributedKVStore"]
@!APILevel[
since: "22",
syscap: "SystemCapability.DistributedDataManager.KVStore.DistributedKVStore"
]
public var schema: ?Schema
@!APILevel[since: "22", syscap: "SystemCapability.DistributedDataManager.KVStore.Core"]
@!APILevel[
since: "22",
syscap: "SystemCapability.DistributedDataManager.KVStore.Core"
]
public init(securityLevel: KVSecurityLevel, createIfMissing!: Bool = true, encrypt!: Bool = false,
backup!: Bool = true, autoSync!: Bool = false, schema!: ?Schema = None) {
super()
@@ -250,15 +446,27 @@ public class KVOptions {
}
}
@!APILevel[since: "22", syscap: "SystemCapability.DistributedDataManager.KVStore.Core"]
@!APILevel[
since: "22",
syscap: "SystemCapability.DistributedDataManager.KVStore.Core"
]
public class Entry {
@!APILevel[since: "22", syscap: "SystemCapability.DistributedDataManager.KVStore.Core"]
@!APILevel[
since: "22",
syscap: "SystemCapability.DistributedDataManager.KVStore.Core"
]
public var key: String
@!APILevel[since: "22", syscap: "SystemCapability.DistributedDataManager.KVStore.Core"]
@!APILevel[
since: "22",
syscap: "SystemCapability.DistributedDataManager.KVStore.Core"
]
public var value: KVValueType
@!APILevel[since: "22", syscap: "SystemCapability.DistributedDataManager.KVStore.Core"]
@!APILevel[
since: "22",
syscap: "SystemCapability.DistributedDataManager.KVStore.Core"
]
public init(key: String, value: KVValueType) {
super()
this.key = String()
@@ -266,93 +474,166 @@ public class Entry {
}
}
@!APILevel[since: "22", syscap: "SystemCapability.DistributedDataManager.KVStore.Core"]
@!APILevel[
since: "22",
syscap: "SystemCapability.DistributedDataManager.KVStore.Core"
]
public class KVStoreResultSet {
@!APILevel[since: "22", syscap: "SystemCapability.DistributedDataManager.KVStore.Core"]
@!APILevel[
since: "22",
syscap: "SystemCapability.DistributedDataManager.KVStore.Core"
]
public func getCount(): Int32 {
return 0
}
public init() {
super()
}
}
@!APILevel[since: "22", syscap: "SystemCapability.DistributedDataManager.KVStore.Core"]
@!APILevel[
since: "22",
syscap: "SystemCapability.DistributedDataManager.KVStore.Core"
]
public class Query {
@!APILevel[since: "22", syscap: "SystemCapability.DistributedDataManager.KVStore.Core"]
@!APILevel[
since: "22",
syscap: "SystemCapability.DistributedDataManager.KVStore.Core"
]
public init() {
super()
}
}
@!APILevel[since: "22", syscap: "SystemCapability.DistributedDataManager.KVStore.Core"]
@!APILevel[
since: "22",
syscap: "SystemCapability.DistributedDataManager.KVStore.Core"
]
public open class SingleKVStore {
static func getKVStore(id: Int64, storeId: String, options: KVOptions): SingleKVStore {
SingleKVStore()
}
@!APILevel[since: "22", syscap: "SystemCapability.DistributedDataManager.KVStore.Core", throwexception: true, workerthread: true]
@!APILevel[
since: "22",
syscap: "SystemCapability.DistributedDataManager.KVStore.Core",
throwexception: true,
workerthread: true
]
public open func put(key: String, value: KVValueType): Unit {
return ()
}
@!APILevel[since: "22", syscap: "SystemCapability.DistributedDataManager.KVStore.Core", throwexception: true, workerthread: true]
@!APILevel[
since: "22",
syscap: "SystemCapability.DistributedDataManager.KVStore.Core",
throwexception: true,
workerthread: true
]
public open func putBatch(entries: Array<Entry>): Unit {
return ()
}
@!APILevel[since: "22", syscap: "SystemCapability.DistributedDataManager.KVStore.Core", throwexception: true, workerthread: true]
@!APILevel[
since: "22",
syscap: "SystemCapability.DistributedDataManager.KVStore.Core",
throwexception: true,
workerthread: true
]
public open func delete(key: String): Unit {
return ()
}
@!APILevel[since: "22", syscap: "SystemCapability.DistributedDataManager.KVStore.Core", throwexception: true, workerthread: true]
@!APILevel[
since: "22",
syscap: "SystemCapability.DistributedDataManager.KVStore.Core",
throwexception: true,
workerthread: true
]
public open func deleteBatch(keys: Array<String>): Unit {
return ()
}
@!APILevel[since: "22", syscap: "SystemCapability.DistributedDataManager.KVStore.Core", throwexception: true, workerthread: true]
@!APILevel[
since: "22",
syscap: "SystemCapability.DistributedDataManager.KVStore.Core",
throwexception: true,
workerthread: true
]
public open func get(key: String): KVValueType {
return KVValueType.StringValue(String())
}
@!APILevel[since: "22", syscap: "SystemCapability.DistributedDataManager.KVStore.Core", throwexception: true, workerthread: true]
@!APILevel[
since: "22",
syscap: "SystemCapability.DistributedDataManager.KVStore.Core",
throwexception: true,
workerthread: true
]
public open func backup(file: String): Unit {
return ()
}
@!APILevel[since: "22", syscap: "SystemCapability.DistributedDataManager.KVStore.Core", throwexception: true, workerthread: true]
@!APILevel[
since: "22",
syscap: "SystemCapability.DistributedDataManager.KVStore.Core",
throwexception: true,
workerthread: true
]
public open func restore(file: String): Unit {
return ()
}
@!APILevel[since: "22", syscap: "SystemCapability.DistributedDataManager.KVStore.Core", throwexception: true, workerthread: true]
@!APILevel[
since: "22",
syscap: "SystemCapability.DistributedDataManager.KVStore.Core",
throwexception: true,
workerthread: true
]
public open func startTransaction(): Unit {
return ()
}
@!APILevel[since: "22", syscap: "SystemCapability.DistributedDataManager.KVStore.Core", throwexception: true, workerthread: true]
@!APILevel[
since: "22",
syscap: "SystemCapability.DistributedDataManager.KVStore.Core",
throwexception: true,
workerthread: true
]
public open func commit(): Unit {
return ()
}
@!APILevel[since: "22", syscap: "SystemCapability.DistributedDataManager.KVStore.Core", throwexception: true, workerthread: true]
@!APILevel[
since: "22",
syscap: "SystemCapability.DistributedDataManager.KVStore.Core",
throwexception: true,
workerthread: true
]
public open func rollback(): Unit {
return ()
}
@!APILevel[since: "22", syscap: "SystemCapability.DistributedDataManager.KVStore.Core", workerthread: true]
@!APILevel[
since: "22",
syscap: "SystemCapability.DistributedDataManager.KVStore.Core",
throwexception: true
]
public open func enableSync(enabled: Bool): Unit {
return ()
}
@!APILevel[since: "22", syscap: "SystemCapability.DistributedDataManager.KVStore.Core", workerthread: true]
@!APILevel[
since: "22",
syscap: "SystemCapability.DistributedDataManager.KVStore.Core",
throwexception: true
]
public open func setSyncParam(defaultAllowedDelayMs: UInt32): Unit {
return ()
}
public init() {
super()
}
}
}
File diff suppressed because it is too large Load Diff
+25 -6
View File
@@ -17,11 +17,30 @@ package ohos.data.values_bucket
import ohos.labels.APILevel
@!APILevel[since: "22", syscap: "SystemCapability.DistributedDataManager.DataShare.Core"]
@!APILevel[
since: "22",
syscap: "SystemCapability.DistributedDataManager.DataShare.Core"
]
public enum VBValueType {
@!APILevel[since: "22", syscap: "SystemCapability.DistributedDataManager.DataShare.Core"] Integer(Int64)
| @!APILevel[since: "22", syscap: "SystemCapability.DistributedDataManager.DataShare.Core"] Double(Float64)
| @!APILevel[since: "22", syscap: "SystemCapability.DistributedDataManager.DataShare.Core"] StringValue(String)
| @!APILevel[since: "22", syscap: "SystemCapability.DistributedDataManager.DataShare.Core"] Boolean(Bool)
@!APILevel[
since: "22",
syscap: "SystemCapability.DistributedDataManager.DataShare.Core"
]
Integer(Int64)
| @!APILevel[
since: "22",
syscap: "SystemCapability.DistributedDataManager.DataShare.Core"
]
Double(Float64)
| @!APILevel[
since: "22",
syscap: "SystemCapability.DistributedDataManager.DataShare.Core"
]
StringValue(String)
| @!APILevel[
since: "22",
syscap: "SystemCapability.DistributedDataManager.DataShare.Core"
]
Boolean(Bool)
| ...
}
}
@@ -67,6 +67,8 @@ public class DistributedKVStore {
return KVManager(codeId)
}
}
init() {}
}
/**
@@ -289,7 +289,6 @@ public enum KVSecurityLevel {
syscap: "SystemCapability.DistributedDataManager.KVStore.DistributedKVStore"
]
public class FieldNode {
var name: String
/**
* Indicates the default value of field node.
*/
@@ -330,7 +329,6 @@ public class FieldNode {
syscap: "SystemCapability.DistributedDataManager.KVStore.DistributedKVStore"
]
public init(name: String, nullable: Bool, default: String, nodeType: Int32) {
this.name = name
this.nullable = nullable
this.default = default
this.nodeType = nodeType
-12
View File
@@ -440,18 +440,6 @@ public class Preferences <: RemoteDataLite {
}
}
/**
* Registers an observer to listen for the change of a {@link Preferences} object.
*
* @param { String } tp - Indicates the callback when preferences changes.
* @param { Callback1Argument<String> } callback - Indicates the callback function.
* @throws { BusinessException } 401 - Parameter error. Possible causes:
* <br>1. Mandatory parameters are left unspecified; <br>2. Incorrect parameter types;
* <br>3. Parameter verification failed.
* @throws { BusinessException } 15500000 - Inner error.
* @throws { BusinessException } 15500019 - Failed to obtain the subscription service.
*/
/**
* Registers an observer to listen for the change of a Preferences object.
*
@@ -69,7 +69,6 @@ class Test_distributed_kv_store {
@TestCase
@Tag[APILevel22, TestLevel0]
func test_creatKVManager() {
let kvstore = DistributedKVStore()
let kvstoreName = "com.example.myapplication"
let kvManager = DistributedKVStore.createKVManager(KVManagerConfig(getAbilityContext(), kvstoreName))
@Expect(true)
@@ -49,7 +49,6 @@ class Test_hide_distributed {
}
func testHideFunc(): Unit {
let kvstore = DistributedKVStore()
let kvstoreName = "com.example.myapplication"
let kvManager = DistributedKVStore.createKVManager(KVManagerConfig(getAbilityContext(), kvstoreName))
kvManager.removeDeviceData(kvstoreName)