Changes

Jump to navigation Jump to search
338 bytes added ,  14:19, 20 July 2022
no edit summary
{| width='100%'
|-valign="top"
| width='120' | '''Signatures'''
|{{Func|store:get|$key as xs:string|item()*}}<br/ >
|-valign="top"
|'''Summary'''
|Retrieves an entry from the store with the given {{Code|$key}}. If the addressed entry does not exist, an empty sequence is returned.
{| width='100%'
|-valign="top"
| width='120' | '''Signatures'''
|{{Func|store:put|$key as xs:string, $value as item()*|empty-sequence()}}<br/ >
|-valign="top"
|'''Summary'''
|Stores an entry with the given {{Code|$key}} and {{Code|$value}} in the store:
{| width='100%'
|-valign="top"
| width='120' | '''Signatures'''
|{{Func|store:get-or-put|$key as xs:string, $put as function() as item()*|item()*}}<br/ >
|-valign="top"
|'''Summary'''
|Retrieves an entry from the store with the given {{Code|$key}}. The {{Code|$put}} function will only be invoked if the entry does not exist, and its result will be stored and returned instead.
{| width='100%'
|-valign="top"
| width='120' | '''Signatures'''
|{{Func|store:remove|$key as xs:string|empty-sequence()}}<br/ >
|-valign="top"
|'''Summary'''
|Removes an entry with the given {{Code|$key}} from the store. No error will be raised if an addressed entry does not exist.
{| width='100%'
|-valign="top"
| width='120' | '''Signatures'''
|{{Func|store:keys||xs:string*}}
|-valign="top"
|'''Summary'''
|Lists the names of all keys.
{| width='100%'
|-valign="top"
| width='120' | '''Signatures'''
|{{Func|store:clear||empty-sequence()}}<br/ >
|-valign="top"
|'''Summary'''
|Resets the store by removing all its entries.
{| width='100%'
|-valign="top"
| width='120' | '''Signatures'''
|{{Func|store:read||empty-sequence()}}<br/ >{{Func|store:read|$name as xs:string|empty-sequence()}}
|-valign="top"
|'''Summary'''
|Retrieves the standard store from disk, or a custom store if a {{Code|$name}} is supplied.
|-valign="top"
|'''Errors'''
|{{Error|io|#Errors}} The store could not be read.<br/>{{Error|name|#Errors}} The specified name is invalid.<br/>{{Error|not-found|#Errors}} A store with the specified name does not exist.
{| width='100%'
|-valign="top"
| width='120' | '''Signatures'''
|{{Func|store:write||empty-sequence()}}<br/ >{{Func|store:write|$name as xs:string|empty-sequence()}}
|-valign="top"
|'''Summary'''
|Writes the standard store to disk, or to a custom store file if a {{Code|$name}} is supplied. If the standard store is empty, the store file will be deleted.
|-valign="top"
|'''Errors'''
|{{Error|io|#Errors}} The store could not be written.<br/>{{Error|name|#Errors}} The specified name is invalid.
{| width='100%'
|-valign="top"
| width='120' | '''Signatures'''
|{{Func|store:list||xs:string*}}
|-valign="top"
|'''Summary'''
|Lists the names of all custom stores.
{| width='100%'
|-valign="top"
| width='120' | '''Signatures'''
|{{Func|store:delete|$name as xs:string|empty-sequence()}}
|-valign="top"
|'''Summary'''
|Deletes a custom store from disk.
|-valign="top"
|'''Errors'''
|{{Error|name|#Errors}} The specified name is invalid.<br/>{{Error|not-found|#Errors}} A store with the specified name does not exist.
! width="110"|Code
|Description
|-valign="top"
|{{Code|io}}
| The store could not be read or written.
|-valign="top"
|{{Code|name}}
| The specified name is invalid.
|-valign="top"
|{{Code|not-found}}
| A store with the specified name does not exist.
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu