Mercurial > cgi-bin > hgweb.cgi > JpegWasher
comparison src/name/blackcap/exifwasher/Whitelist.kt @ 5:dc1f4359659d
Got it compiling.
author | David Barts <n5jrn@me.com> |
---|---|
date | Thu, 09 Apr 2020 18:20:34 -0700 |
parents | 19c381c536ec |
children | aafc9c127c7b |
comparison
equal
deleted
inserted
replaced
4:ba5dc14652da | 5:dc1f4359659d |
---|---|
31 | 31 |
32 fun toList(): List<String> = prefixes + entire | 32 fun toList(): List<String> = prefixes + entire |
33 | 33 |
34 override fun toString(): String = toList().joinToString(",") | 34 override fun toString(): String = toList().joinToString(",") |
35 | 35 |
36 override public fun clone() = this().also { new -> | 36 override public fun clone() = Whitelist().also { new -> |
37 entire.forEach { new.addEntire(it) } | 37 entire.forEach { new.addEntire(it) } |
38 prefixes.forEach { new.addPrefix(it) } | 38 prefixes.forEach { new.addPrefix(it) } |
39 } | 39 } |
40 | 40 |
41 companion object { | 41 companion object { |
42 private val SPLITTER = Pattern.compile(",\\s*") | 42 private val SPLITTER = Pattern.compile(",\\s*") |
43 fun parse(raw: String) = this().also { | 43 fun parse(raw: String) = Whitelist().also { |
44 for (s in raw.split(SPLITTER)) { | 44 for (s in raw.split(SPLITTER)) { |
45 it.add(s) | 45 it.add(s) |
46 } | 46 } |
47 } | 47 } |
48 } | 48 } |