subkt / myaa.subkt.ass / ASSFile
class ASSFile
(source)
Represents an ASS file. If provided, will parse the given file.
Example usage:
val assFile = ASSFile(File("my_script.ass"))
println("Script resolution: ${assFile.scriptInfo.playResX}x${assFile.scriptInfo.playResY}")
// increase the layer of every event line by 10
assFile.events.lines.forEach { line ->
line.layer += 10
}
file
- The file to parse.
Name | Summary |
---|---|
<init> | ASSFile(file: File ? = null) Represents an ASS file. If provided, will parse the given file. |
Name | Summary |
---|---|
events | val events: EventSection The EventSection of the file. |
file | val file: File ? The file to parse. |
projectGarbage | val projectGarbage: AegisubProjectGarbageSection The AegisubProjectGarbageSection of the file. |
scriptInfo | val scriptInfo: ScriptInfoSection The ScriptInfoSection of the file. |
sections | val sections: MutableMap < String , Section > A map containing the sections of this ASS file, with the names of the sections as they appear in the file as the keys. |
styles | val styles: StyleSection The StyleSection of the file. |
Name | Summary |
---|---|
parse | fun parse(file: File ): Unit Parse the given ASS file and add the sections and their containing lines to this instance. |
serialize | fun serialize(includeScriptInfo: Boolean = true, includeProjectGarbage: Boolean = true, includeStyles: Boolean = true, includeEvents: Boolean = true, includeExtraData: Boolean = true): Sequence < String > Returns a sequence of serialized lines, each ending with a newline. The sequence starts with the UTF-8 BOM, which should always be written first to the ASS file. |
Name | Summary |
---|---|
eventsHeader | const val eventsHeader: String |
extraDataHeader | const val extraDataHeader: String |
linePattern | val linePattern: Regex |
projectGarbageHeader | const val projectGarbageHeader: String |
scriptInfoHeader | const val scriptInfoHeader: String |
sectionPattern | val sectionPattern: Regex |
stylesHeader | const val stylesHeader: String |