Package-level declarations

Types

Link copied to clipboard
class CustomField(val field: Member, val custom: Custom)
Link copied to clipboard
object Helper

Various helper functions/values which can be used from Feather scripts (including .foocad files and extensions).

Link copied to clipboard
class ProgressHttpEntity(wrapped: HttpEntity, progressListener: (Long) -> Unit) : WrappedHttpEntity

Intercepts the writeTo method, so that a ProgressOutputStream can inform the progressListener when data has been written to the stream. This lets an application notify the user of progress when uploading files.

Link copied to clipboard
class ProgressOutputStream(wrapped: OutputStream, progressListener: (Long) -> Unit) : FilterOutputStream

Used by ProgressHttpEntity to notify its progressListener as data is written.

Link copied to clipboard
abstract class WrappedHttpEntity(wrapped: HttpEntity) : HttpEntity

Wraps an existing HttpEntity so that subclasses can perform additional processing within one or more methods.

Functions

Link copied to clipboard
Link copied to clipboard
fun customNameFromFile(customFile: File): String?
Link copied to clipboard
fun customValuesFile(scriptFile: File, customName: String): File
Link copied to clipboard

Currently, this is only used when saving custom values as a text file. This seems a little weird - can't we just use the existing Map??? Using this does have one advantage : if a custom value is in the Map, and the model is edited, and that field is removed (or renamed), then rebuilding the Map eliminates defunct key/value pairs in the .custom file.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun Member.getValue(source: Any): Any?
Link copied to clipboard
fun humanBytes(bytes: Long): String
Link copied to clipboard
fun loadCustomValues(customFile: File, model: Customisable): Map<String, Any>
Link copied to clipboard
fun parseCustomValueString(strValue: String, type: Class<*>): Any?
Link copied to clipboard
fun saveCustomValues(file: File, customValues: Map<String, Any>)
Link copied to clipboard
fun setCustomValuesFromMap(model: Model, customValues: Map<String, Any>)

Sets @Custom values of a Model using name->value pairs in customValues. In the simplest case, the key to customValues is a field name. However, it may also be a path to a field, such as foo.bar.baz. In which case, we need to set the field baz on model.foo.bar