Contains various operating system specific code.
More...
#include <public/ILibrarySys.h>
Inherits SourceMod::SMInterface.
List of all members.
Public Member Functions |
|
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.
|
| virtual IDirectory * | OpenDirectory (const char *path)=0 |
| | Opens a directory for reading.
|
| virtual void | CloseDirectory (IDirectory *dir)=0 |
| | Closes a directory and frees its handle.
|
|
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().
|
| 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.
|
| virtual const char * | GetFileExtension (const char *filename)=0 |
| | Returns a pointer to the extension in a filename.
|
| virtual bool | CreateFolder (const char *path)=0 |
| | Creates a directory.
|
| virtual bool | FileTime (const char *path, FileTimeType type, time_t *pTime)=0 |
| | Returns the requested timestamp of a file.
|
Detailed Description
Contains various operating system specific code.
Definition at line 123 of file ILibrarySys.h.
Member Function Documentation
| 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 IDirectory* SourceMod::ILibrarySys::OpenDirectory |
( |
const char * |
path |
) |
[pure virtual] |
Opens a directory for reading.
- Parameters:
-
- Returns:
- Pointer to an IDirectory, NULL if failed.
| virtual void SourceMod::ILibrarySys::CloseDirectory |
( |
IDirectory * |
dir |
) |
[pure virtual] |
Closes a directory and frees its handle.
- Parameters:
-
| 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 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. |
| 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 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.
The documentation for this class was generated from the following file: