diff --git a/src/main/kotlin/com/mefrreex/vkbot/config/Config.kt b/src/main/kotlin/com/mefrreex/vkbot/config/Config.kt index c499056..5fd45d7 100644 --- a/src/main/kotlin/com/mefrreex/vkbot/config/Config.kt +++ b/src/main/kotlin/com/mefrreex/vkbot/config/Config.kt @@ -53,43 +53,11 @@ class Config(private val file: File) { } fun set(key: String, value: Any) { - val keys = key.split("\\.".toRegex()).dropLastWhile { it.isEmpty() }.toTypedArray() - var current = config - for (i in 0 until keys.size - 1) { - val next = current!![keys[i]] as MutableMap? - if (next == null) { - val newMap = mutableMapOf() - current[keys[i]] = newMap - current = newMap - } else { - current = next - } - } - current!![keys[keys.size - 1]] = value + // TODO } fun save() { - val content = yaml!!.dump(config) - val lines = mutableListOf() - - // Считываем старое содержимое файла - if (file.exists()) { - file.forEachLine { line -> - lines.add(line) - } - } - - // Обновляем содержимое файла - val writer = file.bufferedWriter() - for (line in lines) { - if (line.trim().startsWith("#")) { - writer.write(line) - writer.newLine() - } - } - writer.write(content) - writer.flush() - writer.close() + // TODO } }