aboutsummaryrefslogtreecommitdiff
path: root/core/src/main/kotlin/pages/PageNodes.kt
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/main/kotlin/pages/PageNodes.kt')
-rw-r--r--core/src/main/kotlin/pages/PageNodes.kt10
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() }