-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPluginMethod.cpp
More file actions
39 lines (35 loc) · 1.13 KB
/
Copy pathPluginMethod.cpp
File metadata and controls
39 lines (35 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include "PluginMethod.h"
namespace FMTechnologies
{
PluginMethod::PluginMethod()
{
}
PluginMethod::PluginMethod(String^ name, String^ prototype, unsigned short minArgs, unsigned short maxArgs, UInt32 flags)
{
_name = name;
_prototype = prototype;
_minArgs = minArgs;
_maxArgs = maxArgs;
_methodFlags = flags;
}
bool PluginMethod::validate()
{
if (String::IsNullOrEmpty(_prototype)) {
throw gcnew Exception(String::Format("Method '{0}' has no prototype", _name));
}
if ((_maxArgs > -1) && (_minArgs > _maxArgs)) {
//#error String::Format("MinArgs is greater than MaxArgs for method: {0}", _name);
throw gcnew Exception(String::Format("MinArgs is greater than MaxArgs for method: {0}", _name));
}
if (_minArgs > 9) {
throw gcnew Exception(String::Format("MinArgs is greater than 9 for method: {0}", _name));
}
if (_maxArgs > 9) {
throw gcnew Exception(String::Format("MaxArgs is greater than 9 for method: {0}", _name));
}
if (_minArgs < 0) {
throw gcnew Exception(String::Format("MinArgs is less than zero for method: {0}", _name));
}
return true;
}
}