SAP 3D Visual Enterprise applications SDK
IDVLLibrary Class Referenceabstract

#include <DVLLibrary.h>

Public Member Functions

virtual DVLRESULT RetrieveFolderListing (const char *szURL, uint32_t flags, sDVLLibraryFolderListing *pListing)=0
 
virtual void ReleaseFolderListing (sDVLLibraryFolderListing *pListing)=0
 
virtual DVLRESULT RetrieveThumbnail (const char *szURL, sDVLImage *pThumbnail)=0
 
virtual void ReleaseThumbnail (sDVLImage *pThumbnail)=0
 
virtual DVLRESULT RetrieveInfo (const char *szURL, uint32_t &flags, uint32_t &major, uint32_t &minor)=0
 

Detailed Description

This class defines the interface for interaction with file library.

Note
The folder listing feature is designed to be used with non-standard file systems, like remote ones. If all you need is to load files from the standard file system, there's no need to use the folder listing functions of IDVLLibrary, use the standard file system API instead. However, RetrieveThumbnail() function is still useful.

Member Function Documentation

§ ReleaseFolderListing()

virtual void IDVLLibrary::ReleaseFolderListing ( sDVLLibraryFolderListing pListing)
pure virtual

Releases all memory that was initialized in a previous call to RetrieveFolderListing()

Note
If "pListing" is NULL or m_uSizeOfDVLLibraryFolderListing is wrong, "pListing" will not be deleted (and you'll get a memory leak)

§ ReleaseThumbnail()

virtual void IDVLLibrary::ReleaseThumbnail ( sDVLImage pThumbnail)
pure virtual

Releases all memory that was initialized in a previous call to RetrieveThumbnail()

Note
If m_uSizeOfDVLImage has invalid value the memory will not be released.

§ RetrieveFolderListing()

virtual DVLRESULT IDVLLibrary::RetrieveFolderListing ( const char *  szURL,
uint32_t  flags,
sDVLLibraryFolderListing pListing 
)
pure virtual

Retrieves folder listing information into the provided structure

Parameters
szURLURL of the folder to query on. Set to NULL for local listing. Can be http://login:pwd@server:port/folder1/folder2/.
flagsBitfield combination of one or more DVLLIBRARYLISTING_XXX defines
Note
Do NOT initialize the "pListing" structure as RetrieveFolderListing() fully initializes it (even the fields that are not requested)
Only set m_uSizeOfDVLLibraryFolderListing to sizeof(sDVLLibraryFolderListing)
Retrieve all info that you need in a single call with multiple flags set (it's faster than issuing multiple calls with less flags)
Return values
DVLRESULT_BADFORMATIf m_uSizeOfDVLLibraryFolderListing is wrong or URL format incorrect
DVLRESULT_BADARGIf pListing == NULL

§ RetrieveInfo()

virtual DVLRESULT IDVLLibrary::RetrieveInfo ( const char *  szURL,
uint32_t &  flags,
uint32_t &  major,
uint32_t &  minor 
)
pure virtual

Retrieves file thumbnail into the provided buffer

Parameters
szURLURL of a file to retrieve thumbnail for. The format is "file://path/to/file.vds", the encoding is UTF-8
flagsBitwise combination of flags that provide extra information about the file, like if it is encrypted. See DVLFILEFLAG enum for a list of available flags.
majorMajor file version
minorMinor file version
Return values
DVLRESULT_BADARGIf either szURL is NULL
DVLRESULT_FILENOTFOUNDSuch file does not exist
DVLRESULT_OUTOFMEMORYIf could not allocate thumbnail buffer
DVLRESULT_BADFORMATIf the file is not recognized as a supported VDS file

§ RetrieveThumbnail()

virtual DVLRESULT IDVLLibrary::RetrieveThumbnail ( const char *  szURL,
sDVLImage pThumbnail 
)
pure virtual

Retrieves file thumbnail into the provided buffer

Parameters
szURLURL of a file to retrieve thumbnail for. The format is "file://path/to/file.vds", the encoding is UTF-8
pThumbnailThumbnail will be retrieved into this data structure.
Return values
DVLRESULT_BADARGIf either szURL or pThumbnail is NULL
DVLRESULT_BADARGIf m_uSizeOfDVLImage is wrong or szURL format incorrect
DVLRESULT_FILENOTFOUNDSuch file/folder does not exist
DVLRESULT_NOTFOUNDFile does not have a thumbnail (in this case you need to show some default thumbnail)
DVLRESULT_ENCRYPTEDFile is encrypted and thus doesn't have a thumbnail (for security resasons)
DVLRESULT_OUTOFMEMORYIf could not allocate thumbnail buffer

Notes

  • You need to initialize the m_uSizeOfDVLImage member of the sDVLImage structure with its size.

Example

sDVLImage img = {};
img.m_uSizeOfDVLImage = sizeof(img);
DVLRESULT res = pLibrary->RetrieveThumbnail("file://path/to/file.vds", &img);
if (DVLSUCCEEDED(res))
{
// use the thumbnail
pLibrary->ReleaseThumbnail(&img);
}

The documentation for this class was generated from the following file: