Source code

Revision control

Copy as Markdown

Other Tools

[bindings.swift]
cdylib_name = "custom_types"
[bindings.swift.custom_types.Url]
# Name of the type in the Swift code
type_name = "URL"
# Modules that need to be imported
imports = ["Foundation"]
# Functions to convert between strings and URLs
into_custom = "URL(string: {})!"
from_custom = "String(describing: {})"
[bindings.kotlin]
cdylib_name = "custom_types"
package_name = "customtypes"
[bindings.kotlin.custom_types.Url]
# Name of the type in the Kotlin code
type_name = "URL"
# Classes that need to be imported
imports = [ "java.net.URL" ]
# Functions to convert between strings and URLs
into_custom = "URL({})"
from_custom = "{}.toString()"
[bindings.python]
cdylib_name = "custom_types"
[bindings.python.custom_types.Url]
# We're going to be the urllib.parse.ParseResult class, which is the closest
# thing Python has to a Url class. No need to specify `type_name` though,
# since Python is loosely typed.
# modules to import
imports = ["urllib.parse"]
# Functions to convert between strings and the ParsedUrl class
into_custom = "urllib.parse.urlparse({})"
from_custom = "urllib.parse.urlunparse({})"
[bindings.ruby]
cdylib_name = "custom_types"