DataDescriptionPresetStorageInterface Class Reference

#include <datadescriptionpresetstorage.h>

Detailed Description

Helper class to handle loading and saving of presets.

Static Public Member Functions

static MAXON_METHOD Result< PresetStorageLoadPreset (const AssetRepositoryRef &repository, const Id &presetIdentifier, const Id &presetName)
 
static MAXON_METHOD Result< AssetDescription > StorePreset (const AssetRepositoryRef &repository, const Id &presetIdentifier, const Id &presetName, const PresetStorage &presetData)
 
static MAXON_METHOD Result< BoolDeletePreset (const AssetRepositoryRef &repository, const Id &presetIdentifier, const Id &presetName)
 
static MAXON_METHOD Result< BaseArray< Id > > GetPresetIdentifiers (const AssetRepositoryRef &repository)
 
static MAXON_METHOD Result< BaseArray< Id > > GetPresets (const AssetRepositoryRef &repository, const Id &presetIdentifier)
 
static MAXON_METHOD Result< HashSet< InternedId > > GetPresetAttributes (const AssetRepositoryRef &repository, const Id &presetIdentifier)
 
static MAXON_METHOD Result< StringGetPresetName (const AssetRepositoryRef &repository, const Id &presetIdentifier, const Id &presetName, const LanguageRef &language)
 
static MAXON_METHOD Result< void > SetPresetName (const AssetDescription &assetDescription, const Id &presetName, const String &name, const LanguageRef &language)
 

Private Member Functions

 MAXON_INTERFACE_NONVIRTUAL (DataDescriptionPresetStorageInterface, MAXON_REFERENCE_NONE, "net.maxon.interface.datadescriptionpresetstorage")
 

Member Function Documentation

◆ MAXON_INTERFACE_NONVIRTUAL()

MAXON_INTERFACE_NONVIRTUAL ( DataDescriptionPresetStorageInterface  ,
MAXON_REFERENCE_NONE  ,
"net.maxon.interface.datadescriptionpresetstorage"   
)
private

◆ LoadPreset()

static MAXON_METHOD Result<PresetStorage> LoadPreset ( const AssetRepositoryRef &  repository,
const Id presetIdentifier,
const Id presetName 
)
static

LoadPreset reads a preset from the database.

Parameters
[in]repositoryRepository to search for presets (including it's bases).
[in]presetIdentifierIdentifier to check.
[in]presetNameName of the preset.
Returns
PresetStorage on success.

◆ StorePreset()

static MAXON_METHOD Result<AssetDescription> StorePreset ( const AssetRepositoryRef &  repository,
const Id presetIdentifier,
const Id presetName,
const PresetStorage presetData 
)
static

StorePreset stores a preset under the given scope and id in the database.

Parameters
[in]repositoryRepository to search for presets (including it's bases).
[in]presetIdentifierIdentifier to check.
[in]presetNameName of the preset.
[in]presetDataData to store.
Returns
AssetDescription on success.

◆ DeletePreset()

static MAXON_METHOD Result<Bool> DeletePreset ( const AssetRepositoryRef &  repository,
const Id presetIdentifier,
const Id presetName 
)
static

DeletePreset deletes a preset from the database.

Parameters
[in]repositoryRepository to search for presets (including it's bases).
[in]presetIdentifierIdentifier to check.
[in]presetNameName of the preset.
Returns
true if the preset could be deleted. false if the repository which stores the asset is write protected.

◆ GetPresetIdentifiers()

static MAXON_METHOD Result<BaseArray<Id> > GetPresetIdentifiers ( const AssetRepositoryRef &  repository)
static

Returns all preset identifiers registered under the given scope

Parameters
[in]repositoryRepository to search for presets (including it's bases).
Returns
Array of Ids on success.

◆ GetPresets()

static MAXON_METHOD Result<BaseArray<Id> > GetPresets ( const AssetRepositoryRef &  repository,
const Id presetIdentifier 
)
static

Returns all stored preset ids.

Parameters
[in]repositoryRepository to search for presets (including it's bases).
[in]presetIdentifierIdentifier to check.
Returns
Array of preset identifiers on success.

◆ GetPresetAttributes()

static MAXON_METHOD Result<HashSet<InternedId> > GetPresetAttributes ( const AssetRepositoryRef &  repository,
const Id presetIdentifier 
)
static

Returns all stored attribute ids of a given preset identifier database.

Parameters
[in]repositoryRepository to search for presets (including it's bases).
[in]presetIdentifierIdentifier to check.
Returns
Array of attribute ids on success.

◆ GetPresetName()

static MAXON_METHOD Result<String> GetPresetName ( const AssetRepositoryRef &  repository,
const Id presetIdentifier,
const Id presetName,
const LanguageRef &  language 
)
static

Returns the localized string of the preset name.

Parameters
[in]repositoryRepository to search for presets (including it's bases).
[in]presetIdentifierIdentifier to check.
[in]presetNameName of the preset.
[in]languageLanguage to find.
Returns
Localized String on success.

◆ SetPresetName()

static MAXON_METHOD Result<void> SetPresetName ( const AssetDescription &  assetDescription,
const Id presetName,
const String name,
const LanguageRef &  language 
)
static

Sets the localized string of the preset name.

Parameters
[in]assetDescriptionAsset to modify.
[in]presetNameName of the preset.
[in]nameLocalized String for the given language.
[in]languageLanguage to find.
Returns
OK on success.