本文整理汇总了C++中Engine::AddSearchPath方法的典型用法代码示例。如果您正苦于以下问题:C++ Engine::AddSearchPath方法的具体用法?C++ Engine::AddSearchPath怎么用?C++ Engine::AddSearchPath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Engine
的用法示例。
在下文中一共展示了Engine::AddSearchPath方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char* argv[])
{
if (argc == 1)
{
//Pika_DisplayUsage(argv[0]);
Engine* eng = Engine::Create();
eng->ReadExecutePrintLoop();
eng->Release();
return 0;
}
if (argc >= 2)
{
Array* arguments = 0;
Engine* eng = 0;
const char* fileName = 0;
try
{
eng = Engine::Create();
{
GCPAUSE_NORUN( eng );
arguments = Array::Create(eng, eng->Array_Type, 0, 0);
}
CommandLine cl(argc, argv);
if (cl.Kind() == '\0' && cl.Opt())
{
fileName = cl.Opt();
cl.Next();
}
while (cl)
{
if (cl.Opt() == 0)
{
if (cl.Kind() != 'v')
{
Pika_DisplayUsage(argv[0]);
}
}
switch (cl.Kind())
{
/*
* Search path specification: -pPathToSearch
* -------------------------------------------------------------
* Used by import to find modules, scripts and open files.
*/
case 'p':
{
if ((cl.Opt() == 0))
{
Pika_DisplayUsage(argv[0]);
}
eng->AddSearchPath(cl.Opt());
break;
}
/*
* Argument specification: -a"Arg1 Arg2 Arg3" or -aArg1
* -------------------------------------------------------------
* Each argument should be space seperated.
* If arguments have already been specified then these arguments
* are appended to the previous array of arguments.
* All arguments are strings.
*/
case 'a':
{
AddArgument(eng, cl.Opt(), arguments);
}
break;
/*
* Script File: -fFileToExecute
*/
case 'f':
{
fileName = cl.Opt();
break;
}
/*
* Suppress Banner: -s
*/
case 'v':
{
if (!fileName)
{
Pika_PrintBanner();
exit(0);
}
break;
}
default:
{
if (cl.Kind() == '\0' && cl.Opt())
{
if (!fileName)
{
fileName = cl.Opt();
}
else
//.........这里部分代码省略.........