diff options
| author | jsmall-nvidia <jsmall@nvidia.com> | 2019-06-18 18:22:43 -0400 |
|---|---|---|
| committer | Tim Foley <tfoleyNV@users.noreply.github.com> | 2019-06-18 15:22:43 -0700 |
| commit | e213e394d5008cb7bf08bbf875acd494259f5847 (patch) | |
| tree | 75a82a19aaf6be8204c1f8b4ceb446d02a1f06d7 /source/core/slang-platform.h | |
| parent | 896e460dc8146bc9a39296ea72f320fe3db28cee (diff) | |
* Added Path::combineBuilder, so as two sub paths can be combined into a StringBuilder (#988)
* Renamed and improved comments on SharedLibrary
Diffstat (limited to 'source/core/slang-platform.h')
| -rw-r--r-- | source/core/slang-platform.h | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/source/core/slang-platform.h b/source/core/slang-platform.h index c322d0568..0e6d12cb6 100644 --- a/source/core/slang-platform.h +++ b/source/core/slang-platform.h @@ -15,24 +15,27 @@ namespace Slang typedef void(*FuncPtr)(void); - /// Load via an unadorned filename. + /// Load via an unadorned path/filename. /// - /// The unadorned filename here means without any platform specific filename elements. This typically means no extension and no prefix. + /// The unadorned path here means without a path without any platform specific filename elements. + /// This typically means no extension and no prefix. /// On windows this means without the '.dll' extension. /// On linux this means without the 'lib' prefix and '.so' extension. /// To load with a platform specific filename use the 'loadWithPlatformFilename' API + /// Most platforms have a built in mechanism to search for shared libraries, such that + /// shared libraries are often just passed by filename. /// - /// @param the unadorned filename + /// @param the unadorned filename/path /// @return Returns a non null handle for the shared library on success. nullptr indicated failure - static SlangResult load(const char* filename, Handle& handleOut); + static SlangResult load(const char* path, Handle& handleOut); /// Attempt to load a shared library for /// the current platform. Returns null handle on failure /// The platform specific filename can be generated from a call to appendPlatformFileName /// - /// @param platformFileName the platform specific file name. + /// @param platform the platform specific file name/ or path /// @return Returns a non null handle for the shared library on success. nullptr indicated failure - static SlangResult loadWithPlatformFilename(char const* platformFileName, Handle& handleOut); + static SlangResult loadWithPlatformPath(char const* platformPath, Handle& handleOut); /// Unload the library that was returned from load as handle /// @param The valid handle returned from load @@ -49,6 +52,7 @@ namespace Slang /// Given a path, calculate that path with the filename replaced with the platform filename (using appendPlatformFilename) static String calcPlatformPath(const UnownedStringSlice& path); + static void calcPlatformPath(const UnownedStringSlice& path, StringBuilder& outBuilder); private: /// Not constructible! |
