yum-mirror/slang
Making it easier to work with shaders
git clone https://git.yummers.dev/yum-mirror/slang
f65d756bf
master
1// slang-artifact-representation.h 2#ifndef SLANG_ARTIFACT_REPRESENTATION_H 3#define SLANG_ARTIFACT_REPRESENTATION_H 4 5#include "slang-artifact.h" 6 7namespace Slang 8{ 9 10/* Base interface for types that have a path. */ 11class IPathArtifactRepresentation :public IArtifactRepresentation 12{ 13SLANG_COM_INTERFACE ( 140xcb1c188c , 150x7e48 , 160x43eb , 17 {0xb0 ,0x9a ,0xa1 ,0x6e ,0xef ,0xd4 ,0x9b ,0xef }); 18 19/// The path 20virtual SLANG_NO_THROW const char * SLANG_MCALL getPath ()= 0 ; 21/// Get type 22virtual SLANG_NO_THROW SlangPathType SLANG_MCALL getPathType ()= 0 ; 23/// Returns the unique identity. If a unique identity is not supported 24/// or available will return nullptr. 25virtual SLANG_NO_THROW const char * SLANG_MCALL getUniqueIdentity ()= 0 ; 26}; 27 28/* Represents a path to a file held on an ISlangFileSystem. */ 29class IExtFileArtifactRepresentation :public IPathArtifactRepresentation 30{ 31SLANG_COM_INTERFACE ( 320xacd65576 , 330xb09d , 340x4ac9 , 35 {0xa5 ,0x93 ,0xeb ,0xf8 ,0x9b ,0xd7 ,0x11 ,0xfd }); 36 37/// File system that holds the item along the path. 38virtual SLANG_NO_THROW ISlangFileSystemExt * SLANG_MCALL getFileSystem ()= 0 ; 39}; 40 41/* 42A representation as a file on the OS file system. */ 43class IOSFileArtifactRepresentation :public IPathArtifactRepresentation 44{ 45public : 46SLANG_COM_INTERFACE ( 470xc7d7d3a4 , 480x8683 , 490x44b5 , 50 {0x87 ,0x96 ,0xdf ,0xba ,0x9b ,0xc3 ,0xf1 ,0x7b }); 51 52/* Determines ownership and other characteristics of the OS 'file' */ 53enum class Kind 54 { 55Reference ,///< References a file on the file system 56NameOnly ,///< Typically used for items that can be found by the 'system'. The path is just 57///< a name, and cannot typically be loaded as a blob. 58Owned ,///< File is *owned* by this instance and will be deleted when goes out of scope 59Lock ,///< An owned type, indicates potentially in part may only exist to 'lock' a path for 60///< a temporary file. Other files might exists based on the 'lock' path. 61CountOf , 62 }; 63 64/// The the kind of file. 65virtual SLANG_NO_THROW Kind SLANG_MCALL getKind ()= 0 ; 66/// Makes the file no longer owned. Only applicable for Owned/Lock and they will become 67/// 'Reference' 68virtual SLANG_NO_THROW void SLANG_MCALL disown ()= 0 ; 69/// Gets the 'lock file' if any associated with this file. Returns nullptr if there isn't one. 70/// If this file is based on a 'lock file', the lock file must stay in scope at least as long as 71/// this does. 72virtual SLANG_NO_THROW IOSFileArtifactRepresentation * SLANG_MCALL getLockFile ()= 0 ; 73}; 74 75}// namespace Slang 76 77#endif