diff --git a/CHANGELOG.md b/CHANGELOG.md index 9528044d..ae61e9d9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## [Unreleased] ### Added +- Add `readOnly` property to descriptors - Add `specOrNull` delegate to meta and Scheme - Suspended read methods to the `Binary` - Synchronously accessed `meta` to all `DataSet`s diff --git a/build.gradle.kts b/build.gradle.kts index 65d2312d..7b1cdf22 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -6,7 +6,7 @@ plugins { allprojects { group = "space.kscience" - version = "0.6.0-dev-13" + version = "0.6.0-dev-14" } subprojects { diff --git a/dataforge-meta/src/commonMain/kotlin/space/kscience/dataforge/meta/descriptors/MetaDescriptor.kt b/dataforge-meta/src/commonMain/kotlin/space/kscience/dataforge/meta/descriptors/MetaDescriptor.kt index 3197dc07..2ad9f7d2 100644 --- a/dataforge-meta/src/commonMain/kotlin/space/kscience/dataforge/meta/descriptors/MetaDescriptor.kt +++ b/dataforge-meta/src/commonMain/kotlin/space/kscience/dataforge/meta/descriptors/MetaDescriptor.kt @@ -29,7 +29,7 @@ public enum class ValueRequirement { * @param info description text * @param children child descriptors for this node * @param multiple True if same name siblings with this name are allowed - * @param required The requirements for node content + * @param valueRequirement The requirements for node content * @param valueTypes list of allowed types for [Meta.value], null if all values are allowed. * Empty list means that no value should be present in this node. * @param indexKey An index field by which this node is identified in case of same name siblings construct @@ -45,6 +45,7 @@ public data class MetaDescriptor( public val valueTypes: List? = null, public val indexKey: String = Meta.INDEX_KEY, public val defaultValue: Value? = null, + public val readOnly: Boolean = false, public val attributes: Meta = Meta.EMPTY, ) { /** diff --git a/dataforge-meta/src/commonMain/kotlin/space/kscience/dataforge/meta/descriptors/MetaDescriptorBuilder.kt b/dataforge-meta/src/commonMain/kotlin/space/kscience/dataforge/meta/descriptors/MetaDescriptorBuilder.kt index 6584791a..524342b0 100644 --- a/dataforge-meta/src/commonMain/kotlin/space/kscience/dataforge/meta/descriptors/MetaDescriptorBuilder.kt +++ b/dataforge-meta/src/commonMain/kotlin/space/kscience/dataforge/meta/descriptors/MetaDescriptorBuilder.kt @@ -13,6 +13,7 @@ public class MetaDescriptorBuilder @PublishedApi internal constructor() { public var children: MutableMap = linkedMapOf() public var multiple: Boolean = false public var valueRequirement: ValueRequirement = ValueRequirement.NONE + public var readOnly: Boolean = false public var type: List? = null @@ -85,6 +86,7 @@ public class MetaDescriptorBuilder @PublishedApi internal constructor() { valueTypes = type, indexKey = indexKey, defaultValue = default, + readOnly = readOnly, attributes = attributes ) }