slot 0.0.1
A real time UI render framework
载入中...
搜索中...
未找到
Public 成员函数 | Public 属性 | 所有成员列表
ISlangFileSystemExt结构体 参考abstract

#include <slang.h>

类 ISlangFileSystemExt 继承关系图:
Inheritance graph
[图例]
ISlangFileSystemExt 的协作图:
Collaboration graph
[图例]

Public 成员函数

 SLANG_COM_INTERFACE (0x5fb632d2, 0x979d, 0x4481, {0x9f, 0xee, 0x66, 0x3c, 0x3f, 0x14, 0x49, 0xe1}) virtual SLANG_NO_THROW SlangResult SLANG_MCALL getFileUniqueIdentity(const char *path
 
virtual SLANG_NO_THROW SlangResult SLANG_MCALL calcCombinedPath (SlangPathType fromPathType, const char *fromPath, const char *path, ISlangBlob **pathOut)=0
 
virtual SLANG_NO_THROW SlangResult SLANG_MCALL getPathType (const char *path, SlangPathType *pathTypeOut)=0
 
virtual SLANG_NO_THROW SlangResult SLANG_MCALL getPath (PathKind kind, const char *path, ISlangBlob **outPath)=0
 
virtual SLANG_NO_THROW void SLANG_MCALL clearCache ()=0
 
virtual SLANG_NO_THROW SlangResult SLANG_MCALL enumeratePathContents (const char *path, FileSystemContentsCallBack callback, void *userData)=0
 
virtual SLANG_NO_THROW OSPathKind SLANG_MCALL getOSPathKind ()=0
 
- Public 成员函数 继承自 ISlangFileSystem
 SLANG_COM_INTERFACE (0x003A09FC, 0x3A4D, 0x4BA0, {0xAD, 0x60, 0x1F, 0xD8, 0x63, 0xA9, 0x15, 0xAB}) virtual SLANG_NO_THROW SlangResult SLANG_MCALL loadFile(char const *path
 
- Public 成员函数 继承自 ISlangUnknown
virtual SLANG_NO_THROW SlangResult SLANG_MCALL queryInterface (SlangUUID const &uuid, void **outObject)=0
 
virtual SLANG_NO_THROW uint32_t SLANG_MCALL addRef ()=0
 
virtual SLANG_NO_THROW uint32_t SLANG_MCALL release ()=0
 
 SLANG_COM_INTERFACE (0x00000000, 0x0000, 0x0000, {0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46}) virtual SLANG_NO_THROW SlangResult SLANG_MCALL queryInterface(SlangUUID const &uuid
 
virtual SLANG_NO_THROW uint32_t SLANG_MCALL addRef ()=0
 
virtual SLANG_NO_THROW uint32_t SLANG_MCALL release ()=0
 
SlangResult QueryInterface (struct _GUID const &uuid, void **outObject)
 
uint32_t AddRef ()
 
uint32_t Release ()
 

Public 属性

ISlangBlob ** outUniqueIdentity = 0
 
- Public 属性 继承自 ISlangFileSystem
ISlangBlob ** outBlob = 0
 
- Public 属性 继承自 ISlangUnknown
void ** outObject = 0
 

详细描述

An extended file system abstraction.

Implementing and using this interface over ISlangFileSystem gives much more control over how paths are managed, as well as how it is determined if two files 'are the same'.

All paths as input char*, or output as ISlangBlobs are always encoded as UTF-8 strings. Blobs that contain strings are always zero terminated.

成员函数说明

◆ calcCombinedPath()

virtual SLANG_NO_THROW SlangResult SLANG_MCALL ISlangFileSystemExt::calcCombinedPath ( SlangPathType fromPathType,
const char * fromPath,
const char * path,
ISlangBlob ** pathOut )
pure virtual

Calculate a path combining the 'fromPath' with 'path'

The client must ensure the blob be released when no longer used, otherwise memory will leak.

参数
fromPathTypeHow to interpret the from path - as a file or a directory.
fromPathThe from path.
pathPath to be determined relative to the fromPath
pathOutHolds the string which is the relative path. The string is held in the blob zero terminated.
返回
A SlangResult to indicate success or failure in loading the file.

◆ clearCache()

virtual SLANG_NO_THROW void SLANG_MCALL ISlangFileSystemExt::clearCache ( )
pure virtual

Clears any cached information

◆ enumeratePathContents()

virtual SLANG_NO_THROW SlangResult SLANG_MCALL ISlangFileSystemExt::enumeratePathContents ( const char * path,
FileSystemContentsCallBack callback,
void * userData )
pure virtual

Enumerate the contents of the path

Note that for normal Slang operation it isn't necessary to enumerate contents this can return SLANG_E_NOT_IMPLEMENTED.

参数
Thepath to enumerate
callbackThis callback is called for each entry in the path.
userDataThis is passed to the callback
返回
SLANG_OK if successful

◆ getOSPathKind()

virtual SLANG_NO_THROW OSPathKind SLANG_MCALL ISlangFileSystemExt::getOSPathKind ( )
pure virtual

Returns how paths map to the OS file system

返回
OSPathKind that describes how paths map to the Operating System file system

◆ getPath()

virtual SLANG_NO_THROW SlangResult SLANG_MCALL ISlangFileSystemExt::getPath ( PathKind kind,
const char * path,
ISlangBlob ** outPath )
pure virtual

Get a path based on the kind.

参数
kindThe kind of path wanted
pathThe input path
outPathThe output path held in a blob
返回
SLANG_OK if successfully simplified the path (SLANG_E_NOT_IMPLEMENTED if not implemented, or some other error code)

◆ getPathType()

virtual SLANG_NO_THROW SlangResult SLANG_MCALL ISlangFileSystemExt::getPathType ( const char * path,
SlangPathType * pathTypeOut )
pure virtual

Gets the type of path that path is on the file system.

参数
path
pathTypeOut
返回
SLANG_OK if located and type is known, else an error. SLANG_E_NOT_FOUND if not found.

◆ SLANG_COM_INTERFACE()

ISlangFileSystemExt::SLANG_COM_INTERFACE ( 0x5fb632d2 ,
0x979d ,
0x4481 ,
{0x9f, 0xee, 0x66, 0x3c, 0x3f, 0x14, 0x49, 0xe1}  ) const

Get a uniqueIdentity which uniquely identifies an object of the file system.

Given a path, returns a 'uniqueIdentity' which ideally is the same value for the same object on the file system.

The uniqueIdentity is used to compare if two paths are the same - which amongst other things allows Slang to cache source contents internally. It is also used for #pragma once functionality.

A requirement is for any implementation is that two paths can only return the same uniqueIdentity if the contents of the two files are identical. If an implementation breaks this constraint it can produce incorrect compilation. If an implementation cannot strictly identify the same files, this will only have an effect on #pragma once behavior.

The string for the uniqueIdentity is held zero terminated in the ISlangBlob of outUniqueIdentity.

Note that there are many ways a uniqueIdentity may be generated for a file. For example it could be the 'canonical path' - assuming it is available and unambiguous for a file system. Another possible mechanism could be to store the filename combined with the file date time to uniquely identify it.

The client must ensure the blob be released when no longer used, otherwise memory will leak.

NOTE! Ideally this method would be called 'getPathUniqueIdentity' but for historical reasons and backward compatibility it's name remains with 'File' even though an implementation should be made to work with directories too.

参数
path
outUniqueIdentity
返回
A SlangResult to indicate success or failure getting the uniqueIdentity.

类成员变量说明

◆ outUniqueIdentity

ISlangBlob** ISlangFileSystemExt::outUniqueIdentity = 0

该结构体的文档由以下文件生成: