storage

package
v1.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 14, 2020 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewURI

func NewURI(u string) fyne.URI

NewURI creates a new URI from the given string representation. This could be a URI from an external source or one saved from URI.String()

func OpenFileFromURI

func OpenFileFromURI(uri fyne.URI) (fyne.URIReadCloser, error)

OpenFileFromURI loads a file read stream from a resource identifier. This is mostly provided so that file references can be saved using their URI and loaded again later.

func SaveFileToURI

func SaveFileToURI(uri fyne.URI) (fyne.URIWriteCloser, error)

SaveFileToURI loads a file write stream to a resource identifier. This is mostly provided so that file references can be saved using their URI and written to again later.

Types

type ExtensionFileFilter

type ExtensionFileFilter struct {
	Extensions []string
}

ExtensionFileFilter represents a file filter based on the the ending of file names, for example ".txt" and ".png".

func (*ExtensionFileFilter) Matches

func (e *ExtensionFileFilter) Matches(uri fyne.URI) bool

Matches returns true if a file URI has one of the filtered extensions.

type FileFilter

type FileFilter interface {
	Matches(fyne.URI) bool
}

FileFilter is an interface that can be implemented to provide a filter to a file dialog.

func NewExtensionFileFilter

func NewExtensionFileFilter(extensions []string) FileFilter

NewExtensionFileFilter takes a string slice of extensions with a leading . and creates a filter for the file dialog. Example: .jpg, .mp3, .txt, .sh

func NewMimeTypeFileFilter

func NewMimeTypeFileFilter(mimeTypes []string) FileFilter

NewMimeTypeFileFilter takes a string slice of mimetypes, including globs, and creates a filter for the file dialog. Example: image/*, audio/mp3, text/plain, application/*

type MimeTypeFileFilter

type MimeTypeFileFilter struct {
	MimeTypes []string
}

MimeTypeFileFilter represents a file filter based on the files mime type, for example "image/*", "audio/mp3".

func (*MimeTypeFileFilter) Matches

func (mt *MimeTypeFileFilter) Matches(uri fyne.URI) bool

Matches returns true if a file URI has one of the filtered mimetypes.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL