Add base CommandIterator implementation (#819)
* Add base CommandIterator implementation * Add check for invalid pos & finalize pr
This commit is contained in:
committed by
Nicholas Hastings
parent
aaac0b9eb2
commit
28f1ea82b6
@@ -433,6 +433,52 @@ native int GetCmdArg(int argnum, char[] buffer, int maxlength);
|
||||
*/
|
||||
native int GetCmdArgString(char[] buffer, int maxlength);
|
||||
|
||||
methodmap CommandIterator < Handle {
|
||||
// Creates a new CommandIterator. Must be freed with delete or
|
||||
// CloseHandle().
|
||||
//
|
||||
// The CommandIterator can be used to iterate commands created by
|
||||
// SourceMod plugins and allows inspection of properties associated
|
||||
// with the command.
|
||||
//
|
||||
// @return New CommandIterator Handle.
|
||||
public native CommandIterator();
|
||||
|
||||
// Determines if there is a next command. If one is found, the
|
||||
// iterator is advanced to it.
|
||||
//
|
||||
// @return true if found and iterator is advanced.
|
||||
public native bool Next();
|
||||
|
||||
// Retrieves the command's description.
|
||||
//
|
||||
// @param buffer Buffer to copy to.
|
||||
// @param maxlen Maximum size of the buffer.
|
||||
// @error Invalid iterator position.
|
||||
public native void GetDescription(char[] buffer, int maxlen);
|
||||
|
||||
// Retrieves the command's name.
|
||||
//
|
||||
// @param buffer Buffer to copy to.
|
||||
// @param maxlen Maximum size of the buffer.
|
||||
// @error Invalid iterator position.
|
||||
public native void GetName(char[] buffer, int maxlen);
|
||||
|
||||
// Retrieves the plugin handle of the command's creator
|
||||
//
|
||||
// @error Invalid iterator position.
|
||||
property Handle Plugin {
|
||||
public native get();
|
||||
}
|
||||
|
||||
// Retrieves the command's default flags
|
||||
//
|
||||
// @error Invalid iterator position.
|
||||
property int Flags {
|
||||
public native get();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a command iterator. Must be freed with CloseHandle().
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user