Main Content

matlab.io.datastore.FoldersPropertyProvider class

Package: matlab.io.datastore

Add Folder property support to datastore

Since R2020a

Description

matlab.io.datastore.FoldersPropertyProvider is an abstract mixin class that adds support for a Folders property (and thus the FolderLayout name-value pair of writeall) to custom datastores.

To use this mixin class, you must inherit from the matlab.io.datastore.FoldersPropertyProvider class, in addition to the matlab.io.Datastore and matlab.io.datastore.FileWritable classes. Use this syntax as the first few lines in your class definition file:

classdef MyDatastore < matlab.io.Datastore & ....
                       matlab.io.datastore.FileWritable & ...
                       matlab.io.datastore.FoldersPropertyProvider
  ...
end
To add support for a Folders property to your custom datastore, you must:

  • Inherit from the matlab.io.datastore.FoldersPropertyProvider class.

  • Use the populateFoldersFromLocation method in the datastore constructor to indicate the location from which to populate the Folders property.

The matlab.io.datastore.FoldersPropertyProvider class is a handle class.

Properties

expand all

List of folders used to construct datastore, returned as a cell array of character vectors. This property is populated by the populateFoldersFromLocation method. The Folders property is populated differently depending on the value of the location input to the datastore constructor. If the location input specifies:

  • Folder names — All folder names in the location input are directly added to the Folders property.

  • File names — The parent folders of all input file names are added to the Folders property.

  • Wildcard names — Wildcard strings passed to the datastore constructor are matched to file names on disk. The parent folders of these file names are then added to the Folders property.

Attributes:

GetAccess
public
SetAccess
protected

Data Types: cell

Methods

expand all

Version History

Introduced in R2020a