diff options
author | Kamil Doległo <kamilok1965@interia.pl> | 2019-11-05 22:10:13 +0100 |
---|---|---|
committer | Kamil Doległo <kamilok1965@interia.pl> | 2019-11-05 22:11:14 +0100 |
commit | ae53f0525c676a5483609fdde144594a36d8d582 (patch) | |
tree | d20827c0c86344c7741e81a12641b2a33e7aa34b /core/src/main/kotlin/pages/PageNodes.kt | |
parent | 508afa4fa2bddf4b05cb888340d0dbfc0ec40d9b (diff) | |
download | dokka-ae53f0525c676a5483609fdde144594a36d8d582.tar.gz dokka-ae53f0525c676a5483609fdde144594a36d8d582.tar.bz2 dokka-ae53f0525c676a5483609fdde144594a36d8d582.zip |
Add merger (sort of)
Diffstat (limited to 'core/src/main/kotlin/pages/PageNodes.kt')
-rw-r--r-- | core/src/main/kotlin/pages/PageNodes.kt | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/core/src/main/kotlin/pages/PageNodes.kt b/core/src/main/kotlin/pages/PageNodes.kt index 3d2b6fb7..34662720 100644 --- a/core/src/main/kotlin/pages/PageNodes.kt +++ b/core/src/main/kotlin/pages/PageNodes.kt @@ -57,9 +57,15 @@ class MemberPageNode( documentationNode: DocumentationNode<*>? ): PageNode(name, content, parent, dri, documentationNode) // functions, extension functions, properties -data class PlatformData(val platformName: String, val platformType: Platform) +data class PlatformData(val platformName: String, val platformType: Platform) { + override fun toString() = platformName +} + +data class DCI(val dri: DRI, val platformDataList: List<PlatformData>) { + override fun toString() = "$dri[$platformDataList]" +} -fun PageNode.platforms(): List<PlatformData> = this.content.flatMap { it.platforms }.distinct() // TODO: Override equals??? +fun PageNode.platforms(): List<PlatformData> = this.content.flatMap { it.dci.platformDataList }.distinct() // TODO: Override equals??? fun PageNode.dfs(predicate: (PageNode) -> Boolean): PageNode? = if (predicate(this)) { this } else { this.children.asSequence().mapNotNull { it.dfs(predicate) }.firstOrNull() } |