Contains various operating system specific code.
More...
#include <public/ILibrarySys.h>
|
|
virtual const char * | GetInterfaceName () |
| | Must return a string defining the interface's unique name.
|
| |
|
virtual unsigned int | GetInterfaceVersion () |
| | Must return an integer defining the interface's version.
|
| |
| virtual ILibrary * | OpenLibrary (const char *path, char *error, size_t maxlength)=0 |
| | Opens a dynamic library file. More...
|
| |
| virtual IDirectory * | OpenDirectory (const char *path)=0 |
| | Opens a directory for reading. More...
|
| |
| virtual void | CloseDirectory (IDirectory *dir)=0 |
| | Closes a directory and frees its handle. More...
|
| |
|
virtual bool | PathExists (const char *path)=0 |
| | Returns true if a path exists.
|
| |
|
virtual bool | IsPathFile (const char *path)=0 |
| | Returns true if the path is a normal file.
|
| |
|
virtual bool | IsPathDirectory (const char *path)=0 |
| | Returns true if the path is a normal directory.
|
| |
| virtual void | GetPlatformError (char *error, size_t maxlength)=0 |
| | Gets a platform-specific error message. This should only be called when an ILibrary function fails. Win32 equivalent: GetLastError() + FormatMessage() POSIX equivalent: errno + strerror() More...
|
| |
| virtual size_t | PathFormat (char *buffer, size_t maxlength, const char *pathfmt,...)=0 |
| | Formats a string similar to snprintf(), except corrects all non-platform compatible path separators to be the correct platform character. More...
|
| |
| virtual const char * | GetFileExtension (const char *filename)=0 |
| | Returns a pointer to the extension in a filename. More...
|
| |
| virtual bool | CreateFolder (const char *path)=0 |
| | Creates a directory. More...
|
| |
| virtual bool | FileTime (const char *path, FileTimeType type, time_t *pTime)=0 |
| | Returns the requested timestamp of a file. More...
|
| |
| virtual size_t | GetFileFromPath (char *buffer, size_t maxlength, const char *path)=0 |
| | Retrieve the file component of the given path. More...
|
| |
| virtual bool | IsVersionCompatible (unsigned int version) |
| | Must return whether the requested version number is backwards compatible. Note: This can be overridden for breaking changes or custom versioning. More...
|
| |
Contains various operating system specific code.
| virtual void SourceMod::ILibrarySys::CloseDirectory |
( |
IDirectory * |
dir | ) |
|
|
pure virtual |
Closes a directory and frees its handle.
- Parameters
-
| virtual bool SourceMod::ILibrarySys::CreateFolder |
( |
const char * |
path | ) |
|
|
pure virtual |
Creates a directory.
- Parameters
-
| path | Full, absolute path of the directory to create. |
- Returns
- True on success, false otherwise.
| virtual bool SourceMod::ILibrarySys::FileTime |
( |
const char * |
path, |
|
|
FileTimeType |
type, |
|
|
time_t * |
pTime |
|
) |
| |
|
pure virtual |
Returns the requested timestamp of a file.
NOTE: On FAT file systems, the access and creation times may not be valid.
- Parameters
-
| path | Path to file. |
| type | FileTimeType of time value to request. |
| pTime | Pointer to store time. |
- Returns
- True on success, false on failure.
| virtual const char* SourceMod::ILibrarySys::GetFileExtension |
( |
const char * |
filename | ) |
|
|
pure virtual |
Returns a pointer to the extension in a filename.
- Parameters
-
| filename | Name of file from which the extension should be extracted. |
- Returns
- Pointer to file extension.
| virtual size_t SourceMod::ILibrarySys::GetFileFromPath |
( |
char * |
buffer, |
|
|
size_t |
maxlength, |
|
|
const char * |
path |
|
) |
| |
|
pure virtual |
Retrieve the file component of the given path.
- Parameters
-
| buffer | Output buffer. |
| maxlength | Length of the output buffer. |
| path | Path to search for a filename. |
- Returns
- Number of bytes written to buffer, not including the null terminator.
| virtual void SourceMod::ILibrarySys::GetPlatformError |
( |
char * |
error, |
|
|
size_t |
maxlength |
|
) |
| |
|
pure virtual |
Gets a platform-specific error message. This should only be called when an ILibrary function fails. Win32 equivalent: GetLastError() + FormatMessage() POSIX equivalent: errno + strerror()
- Parameters
-
| error | Error message buffer. |
| maxlength | Maximum length of error buffer. |
| virtual IDirectory* SourceMod::ILibrarySys::OpenDirectory |
( |
const char * |
path | ) |
|
|
pure virtual |
Opens a directory for reading.
- Parameters
-
- Returns
- Pointer to an IDirectory, NULL if failed.
| virtual ILibrary* SourceMod::ILibrarySys::OpenLibrary |
( |
const char * |
path, |
|
|
char * |
error, |
|
|
size_t |
maxlength |
|
) |
| |
|
pure virtual |
Opens a dynamic library file.
- Parameters
-
| path | Path to library file (.dll/.so). |
| error | Buffer for any error message (may be NULL). |
| maxlength | Maximum length of error buffer. |
- Returns
- Pointer to an ILibrary, NULL if failed.
| virtual size_t SourceMod::ILibrarySys::PathFormat |
( |
char * |
buffer, |
|
|
size_t |
maxlength, |
|
|
const char * |
pathfmt, |
|
|
|
... |
|
) |
| |
|
pure virtual |
Formats a string similar to snprintf(), except corrects all non-platform compatible path separators to be the correct platform character.
- Parameters
-
| buffer | Output buffer pointer. |
| maxlength | Output buffer size. |
| pathfmt | Format string of path. |
| ... | Format string arguments. |
The documentation for this class was generated from the following file: