| 
    Kodi Documentation 22.0
    
   Kodi is an open source media player and entertainment hub. 
   | 
 
Class:  kodi::addon::CInstanceVFS Topics | |
| Definitions, structures and enumerators | |
| VFS add-on general variables  | |
| 1. General access functions | |
| General access functions  | |
| 2. File editing functions | |
| File editing functions.  | |
Functions | |
| kodi::addon::CInstanceVFS::CInstanceVFS (const IInstanceInfo &instance) | |
| VFS class constructor used to support multiple instance types.   | |
| kodi::addon::CInstanceVFS::~CInstanceVFS () override=default | |
| Destructor.   | |
Class:  kodi::addon::CInstanceVFS This instance type is used to allow Kodi various additional file system types. Be it a special file system, a compressed package or a system available over the network, everything is possible with it.
This usage can be requested under various conditions, for example explicitly by another addon, by a Mimetype protocol defined in addon.xml or supported file extensions.
Include the header #include <kodi/addon-instance/VFS.h> to use this class.
Here is an example of what the addon.xml.in would look like for an VFS addon:
addon.xml.These values are used by Kodi to identify associated streams and file extensions and then to select the associated addon.
| Labels | Type | Description | 
|---|---|---|
 point  | string |  The identification of the addon instance to VFS is mandatory kodi.vfs. In addition, the instance declared in the first <extension ... /> is also the main type of addon.   | 
 defaultPort  | integer | Default networking port to use for protocol. | 
 directories  | boolean | VFS entry can list directories. | 
 extensions  | string |  Extensions for VFS entry. It is possible to declare several using |, e.g. .abc|.def|.ghi.   | 
 encodedhostname  | boolean | URL protocol from add-ons use encoded hostnames. | 
 filedirectories  | boolean | VFS entry contains file directories. | 
 files  | boolean | Set to declare that VFS provides files. | 
 protocols  | boolean |  Protocols for VFS entry. It is possible to declare several using |, e.g. myprot1|myprot2.
  | 
 supportWrite  | boolean | Protocol supports write operations. | 
 zeroconf  | string | Zero conf announce string for VFS protocol. | 
 library_@PLATFORM@  | string |  The runtime library used for the addon. This is usually declared by cmake and correctly displayed in the translated addon.xml.   | 
The following table describes the values that can be defined by addon.xml and which part they relate to for user input.
| Labels | Type | Description | ||
|---|---|---|---|---|
 supportBrowsing  | boolean |  Protocol supports server browsing. Used to open related sources by users in the window.
 *1: The entry in the menu represented by this option corresponds to the text given with label. When the button is pressed, CInstanceVFS::GetDirectory is called on the add-on to get its content.*2: Protocol name of the stream defined with protocols in xml.
  | ||
 supportDialog  | boolean |  To point out that Kodi assigns a dialog to this VFS in order to compare it with other values e.g. query supportPassword in it. This will be available when adding sources in Kodi under "Add network location...". 
 *1: Field for selecting the VFS handler, the addon will be available if supportDialog is set to true.*2: To set the associated server address. Note: This field is always activated and cannot be changed by the addon. *3: If supportBrowsing is set to true, the button for opening a file selection dialog is given here too, as in the file window.*4: This field is available if supportPath is set to true.*5: To edit the connection port. This field is available if supportPort is set to true.*6: This sets the required username and is available when supportUsername is set to true.*7: This sets the required password and is available when supportPassword is set to true.   | ||
 supportPath  | boolean |  Protocol has path in addition to server name (see supportDialog about *4:).   | ||
 supportPort  | boolean |  Protocol supports port customization (see supportDialog about *5:).   | ||
 supportUsername  | boolean |  Protocol uses logins (see supportDialog about *6:).   | ||
 supportPassword  | boolean |  Protocol supports passwords (see supportDialog about *7:).   | ||
 protocols  | string |  Protocols for VFS entry. 
  | ||
 label  | integer |  The text identification number used in Kodi for display in the menu at supportDialog as a selection option and at supportBrowsing (see his image reference *1) as a menu entry.This can be a text identifier in Kodi or from addon. 
  | 
addon.xml, see also https://kodi.wiki/view/Addon.xml.Example:
The destruction of the example class CMyVFS is called from Kodi's header. Manually deleting the add-on instance is not required. 
      
  | 
  inlineexplicit | 
VFS class constructor used to support multiple instance types.
| [in] | instance | The instance value given to kodi::addon::CAddonBase::CreateInstance(...). | 
instance from the CAddonBase::CreateInstance call. 
      
  | 
  overridedefault | 
Destructor.