Open Search
    AssetUtilitiesInterface Class Reference

    #include <asset_utilities.h>

    Detailed Description

    Helper Interface for Asset functions.

    Static Public Member Functions

    static MAXON_METHOD Result< StringIncreaseAssetVersion (const String &currentVersion)
     
    static MAXON_METHOD Result< void > AssetSetMetaData (const AssetDescription &asset, const String &userAssetName, const String &assetVersion, const Id &assetCategory)
     
    static MAXON_METHOD Result< UrlGetAssetIcon (const AssetDescription &asset)
     
    static MAXON_METHOD Result< EnumDataTypeGetEnumTypeForVersions (const AssetRepositoryRef &repo, const AssetType &type, const Id &assetId)
     
    static MAXON_METHOD Result< void > AssetSetCreationData (const AssetDescription &asset, Int c4dVersion, const String &c4dBuildId, Int releaseType)
     
    static MAXON_METHOD Result< void > AssetSetCreationData (const AssetDescription &asset)
     
    static MAXON_METHOD Result< DataDictionary > GetMergedAssetOriginData (const AssetDescription &nodeAsset, const AssetLink &link, const LanguageRef &lang)
     
    static MAXON_METHOD Bool HasUrlQueryCharacters (const String &query)
     
    static MAXON_METHOD Result< StringReplaceUrlQueryCharacters (const String &query)
     
    static MAXON_METHOD Result< void > AppendUrlQueryVariable (String &query, const String &variableName, const String &variableValue)
     

    Private Member Functions

     MAXON_INTERFACE_NONVIRTUAL (AssetUtilitiesInterface, MAXON_REFERENCE_STATIC, "net.maxon.asset.helperinterface")
     

    Member Function Documentation

    ◆ MAXON_INTERFACE_NONVIRTUAL()

    MAXON_INTERFACE_NONVIRTUAL ( AssetUtilitiesInterface  ,
    MAXON_REFERENCE_STATIC  ,
    "net.maxon.asset.helperinterface"   
    )
    private

    ◆ IncreaseAssetVersion()

    static MAXON_METHOD Result<String> IncreaseAssetVersion ( const String currentVersion)
    static

    IncreaseAssetVersion description.

    Parameters
    [in]currentVersionIncreases the version string by one. e.g. "1.0" -> "1.1" or "1.0.99" -> "1.1.00"
    Returns
    New Version String on success.

    ◆ AssetSetMetaData()

    static MAXON_METHOD Result<void> AssetSetMetaData ( const AssetDescription &  asset,
    const String userAssetName,
    const String assetVersion,
    const Id assetCategory 
    )
    static

    Sets the asset's meta data.

    Parameters
    [in]assetAsset which will receive the meta data.
    [in]userAssetNameHuman readable asset name to set. Can start with #$XXAssetName where XX are numbers indicating the asset's sorting value (ASSETMETADATA::ASSET_SORT).
    [in]assetVersionAsset version to set (ASSETMETADATA::ASSET_VERSIONTAG).
    [in]assetCategoryAsset category identifier to set.
    Returns
    OK on success.

    ◆ GetAssetIcon()

    static MAXON_METHOD Result<Url> GetAssetIcon ( const AssetDescription &  asset)
    static

    Returns the asset icon. It returns the preview stored under ASSETMETADATA::ASSET_PREVIEWIMAGEURL

    Parameters
    [in]assetAsset to use.
    Returns
    Url to the preview icon on success.

    ◆ GetEnumTypeForVersions()

    static MAXON_METHOD Result<EnumDataType> GetEnumTypeForVersions ( const AssetRepositoryRef &  repo,
    const AssetType &  type,
    const Id assetId 
    )
    static

    Returns an EnumDataType which contains all versions of the asset, plus an additional "latest" entry.

    Parameters
    [in]repoThe asset repository for the lookup.
    [in]typeThe asset type of the asset.
    [in]assetIdThe asset id to look for.
    Returns
    An enum type which has "latest" as first entry and all found versions of the asset as following entries.

    ◆ AssetSetCreationData() [1/2]

    static MAXON_METHOD Result<void> AssetSetCreationData ( const AssetDescription &  asset,
    Int  c4dVersion,
    const String c4dBuildId,
    Int  releaseType 
    )
    static

    Sets the asset's creation meta data.

    See also
    ASSETMETADATA::CreationProperties
    Parameters
    [in]assetAsset which will receive the meta data.
    [in]c4dVersionCurrent Cinema 4D version (Application::GetVersion).
    [in]c4dBuildIdCurrent Cinema 4D build (Application::GetVersion).
    [in]releaseTypeUsually BRANCH_RELEASE_TYPE_VALUE.
    Returns
    OK on success.

    ◆ AssetSetCreationData() [2/2]

    static MAXON_METHOD Result<void> AssetSetCreationData ( const AssetDescription &  asset)
    static

    Sets the asset's creation meta data with current version's values.

    See also
    ASSETMETADATA::CreationProperties
    Parameters
    [in]assetAsset which will receive the meta data.
    Returns
    OK on success.

    ◆ GetMergedAssetOriginData()

    static MAXON_METHOD Result<DataDictionary> GetMergedAssetOriginData ( const AssetDescription &  nodeAsset,
    const AssetLink &  link,
    const LanguageRef &  lang 
    )
    static

    Creates an updated version of the AssetLink's origin data, filled with missing informations from the asset's meta data. Result will be a merge #link origin data and a new origin data built from #nodeAsset.

    Parameters
    [in]nodeAssetThe asset.
    [in]linkThe link containing the origin data to update or fill.
    [in]langLanguage to use for filling origin data.
    Returns
    The updated origin data.

    ◆ HasUrlQueryCharacters()

    static MAXON_METHOD Bool HasUrlQueryCharacters ( const String query)
    static

    Iterates through the given string to search for characters that would disrupt a Url URLFLAGS::QUERY. Like '=', '&'.

    Parameters
    [in]queryThe query string to validate.
    Returns
    True if the query contains unwanted characters.

    ◆ ReplaceUrlQueryCharacters()

    static MAXON_METHOD Result<String> ReplaceUrlQueryCharacters ( const String query)
    static

    Iterates through the given string to replace characters that would disrupt a Url URLFLAGS::QUERY.

    See also
    HasUrlQueryCharacters
    Parameters
    [in]queryThe query string to fix.
    Returns
    The fixed query string.

    ◆ AppendUrlQueryVariable()

    static MAXON_METHOD Result<void> AppendUrlQueryVariable ( String query,
    const String variableName,
    const String variableValue 
    )
    static

    Appends a variable and value pair to the query string. Name and value will be cleansed of any unwanted characters. Appended result will be "name=value" with a '&' prefix if there was already some other variables in the query.

    See also
    URLFLAGS::QUERY
    Parameters
    [in,out]queryThe query string to append to.
    [in]variableNameThe variable's identifier to append.
    [in]variableValueThe variable's value to append.
    Returns
    OK on success.