本文整理汇总了C++中JSBClass::AddFunctionOverride方法的典型用法代码示例。如果您正苦于以下问题:C++ JSBClass::AddFunctionOverride方法的具体用法?C++ JSBClass::AddFunctionOverride怎么用?C++ JSBClass::AddFunctionOverride使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JSBClass
的用法示例。
在下文中一共展示了JSBClass::AddFunctionOverride方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ProcessOverloads
void JSBModule::ProcessOverloads()
{
// overloads
JSONValue root = moduleJSON_->GetRoot();
JSONValue overloads = root.GetChild("overloads");
if (overloads.IsObject())
{
Vector<String> childNames = overloads.GetChildNames();
for (unsigned j = 0; j < childNames.Size(); j++)
{
String classname = childNames.At(j);
JSBClass* klass = GetClass(classname);
if (!klass)
{
ErrorExit("Bad overload klass");
}
JSONValue classoverloads = overloads.GetChild(classname);
Vector<String> functionNames = classoverloads.GetChildNames();
for (unsigned k = 0; k < functionNames.Size(); k++)
{
JSONValue sig = classoverloads.GetChild(functionNames[k]);
if (!sig.IsArray())
{
ErrorExit("Bad overload defintion");
}
Vector<String> values;
for (unsigned x = 0; x < sig.GetSize(); x++)
{
values.Push(sig.GetString(x));
}
JSBFunctionSignature* fo = new JSBFunctionSignature(functionNames[k], values);
klass->AddFunctionOverride(fo);
}
}
}
}
示例2: Load
//.........这里部分代码省略.........
}
if (includes.IsArray())
{
for (unsigned j = 0; j < includes.GetSize(); j++)
{
includes_.Push(includes.GetString(j));
}
}
if (classes.IsArray())
{
for (unsigned j = 0; j < classes.GetSize(); j++)
{
String classname = classes.GetString(j);
if (rename.Contains(classname))
bindings_->RegisterClass(classname, rename[classname]);
else
bindings_->RegisterClass(classname);
}
}
if (overloads.IsObject())
{
Vector<String> childNames = overloads.GetChildNames();
for (unsigned j = 0; j < childNames.Size(); j++)
{
String classname = childNames.At(j);
JSBClass* klass = bindings_->GetClass(classname);
if (!klass)
{
ErrorExit("Bad overload klass");
}
JSONValue classoverloads = overloads.GetChild(classname);
Vector<String> functionNames = classoverloads.GetChildNames();
for (unsigned k = 0; k < functionNames.Size(); k++)
{
JSONValue sig = classoverloads.GetChild(functionNames[k]);
if (!sig.IsArray())
{
ErrorExit("Bad overload defintion");
}
Vector<String> values;
for (unsigned x = 0; x < sig.GetSize(); x++)
{
values.Push(sig.GetString(x));
}
JSBFunctionOverride* fo = new JSBFunctionOverride(functionNames[k], values);
klass->AddFunctionOverride(fo);
}
}
}
this->name_ = moduleJSON.GetString("name");
if (this->name_ == "Graphics")
{
#ifdef _MSC_VER
sources.AddString("Graphics/Direct3D9");
#else
sources.AddString("Graphics/OpenGL");
#endif
}
for (unsigned j = 0; j < sources.GetSize(); j++)
{
String sourceFolder = sources.GetString(j);
Vector<String> fileNames;
String sourceRoot = "Atomic";
if (sourceFolder == "Javascript")
sourceRoot = "AtomicJS";
JSBind::fileSystem_->ScanDir(fileNames, JSBind::ROOT_FOLDER + "/Source/" + sourceRoot + "/" + sourceFolder, "*.h", SCAN_FILES, false);
for (unsigned k = 0; k < fileNames.Size(); k++)
{
// TODO: filter
String filepath = JSBind::ROOT_FOLDER + "/Source/" + sourceRoot + "/" + sourceFolder + "/" + fileNames[k];
this->headerFiles_.Push(filepath);
}
}
}