Package-level declarations

  • KRisIO can be used from Java or Kotlin to work with exiting readers, files or streams.

  • ExportExtensions contains extension functions to the kotlin client for exporting RisRecords.

  • ImportExtensions contains extension functions to the kotlin client for importing RisRecords.

Types

Link copied to clipboard

Provides access to the different types of CoroutineDispatchers, defaulting to the regular kotlin Dispatcher implementation.

Link copied to clipboard
object KRisIO

Convenience methods offering to directly work with IO methods.

Functions

Link copied to clipboard
fun File.accept(records: List<RisRecord>, sort: List<String> = emptyList(), dispatchers: DispatcherProvider = DefaultDispatcherProvider)

Converts a list of RisRecords into a list of Strings in RIS file format, writing them into the File provided as receiver. Optionally accepts a list of names of RisTags defining a sort order for the RisTags in the file.

fun OutputStream.accept(records: List<RisRecord>, sort: List<String> = emptyList(), dispatchers: DispatcherProvider = DefaultDispatcherProvider)

Converts a list of RisRecords into a list of Strings in RIS file format, writing them into the OutputStream provided as receiver. Optionally accepts a list of names of RisTags defining a sort order for the RisTags in the file.

fun Writer.accept(records: List<RisRecord>, sort: List<String> = emptyList(), dispatchers: DispatcherProvider = DefaultDispatcherProvider)

Converts a list of RisRecords into a list of Strings in RIS file format, dumping them into the Writer provided as receiver. Optionally accepts a list of names of RisTags defining a sort order for the RisTags in the file.

fun String.accept(records: List<RisRecord>, sort: List<String> = emptyList(), dispatchers: DispatcherProvider = DefaultDispatcherProvider)

Converts a list of RisRecords into a list of Strings in RIS file format, writing them into file with the path provided as the receiver, if possible. Optionally accepts a list of names of RisTags defining a sort order for the RisTags in the file.

Link copied to clipboard
fun File.process(dispatchers: DispatcherProvider = DefaultDispatcherProvider): List<RisRecord>

Converts the RISFile lines in the File provided as receiver into a list of RisRecords. May throw an IOException if the file cannot be read successfully, or a KRisException if the lines cannot be parsed successfully.

fun InputStream.process(dispatchers: DispatcherProvider = DefaultDispatcherProvider): List<RisRecord>

Converts the RISFile lines provided by the InputStream as receiver into a list of RisRecords. May throw an IOException if the stream cannot be read successfully, or a KRisException if the lines cannot be parsed successfully.

fun Reader.process(dispatchers: DispatcherProvider = DefaultDispatcherProvider): List<RisRecord>

Converts the RISFile lines provided by the Reader as receiver into a list of RisRecords. May throw an IOException if the reader fails to deliver lines or a KRisException if the lines cannot be parsed successfully.

fun String.process(dispatchers: DispatcherProvider = DefaultDispatcherProvider): List<RisRecord>

Converts the RISFile lines from the file with the path provided as receiver into a list of RisRecords. May throw an IOException if the file cannot be read successfully, or a KRisException if the lines cannot be parsed successfully.

Link copied to clipboard
fun File.processToStream(dispatchers: DispatcherProvider = DefaultDispatcherProvider): Stream<RisRecord>

Converts the RISFile lines in the File provided as receiver into a stream of RisRecords. May throw an IOException if the file cannot be read successfully, or a KRisException if the lines cannot be parsed successfully.

fun InputStream.processToStream(dispatchers: DispatcherProvider = DefaultDispatcherProvider): Stream<RisRecord>

Converts the RISFile lines provided by the InputStream as receiver into a stream of RisRecords. May throw an IOException if the stream cannot be read successfully, or a KRisException if the lines cannot be parsed successfully.

fun Reader.processToStream(dispatchers: DispatcherProvider = DefaultDispatcherProvider): Stream<RisRecord>

Converts the RISFile lines provided by the Reader as receiver into a stream of RisRecords. May throw an IOException if the reader fails to deliver lines or a KRisException if the lines cannot be parsed successfully.

fun String.processToStream(dispatchers: DispatcherProvider = DefaultDispatcherProvider): Stream<RisRecord>

Converts the RISFile lines from the file with the path provided as receiver into a stream of RisRecords. May throw an IOException if the file cannot be read successfully, or a KRisException if the lines cannot be parsed successfully.