本文整理汇总了C++中ToolSystem::LoadProject方法的典型用法代码示例。如果您正苦于以下问题:C++ ToolSystem::LoadProject方法的具体用法?C++ ToolSystem::LoadProject怎么用?C++ ToolSystem::LoadProject使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ToolSystem
的用法示例。
在下文中一共展示了ToolSystem::LoadProject方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Start
void AtomicTool::Start()
{
// Subscribe to events
SubscribeToEvent(E_COMMANDERROR, HANDLER(AtomicTool, HandleCommandError));
SubscribeToEvent(E_COMMANDFINISHED, HANDLER(AtomicTool, HandleCommandFinished));
SubscribeToEvent(E_LICENSE_EULAREQUIRED, HANDLER(AtomicTool, HandleLicenseEulaRequired));
SubscribeToEvent(E_LICENSE_ACTIVATIONREQUIRED, HANDLER(AtomicTool, HandleLicenseActivationRequired));
SubscribeToEvent(E_LICENSE_ERROR, HANDLER(AtomicTool, HandleLicenseError));
SubscribeToEvent(E_LICENSE_SUCCESS, HANDLER(AtomicTool, HandleLicenseSuccess));
const Vector<String>& arguments = GetArguments();
ToolSystem* tsystem = new ToolSystem(context_);
context_->RegisterSubsystem(tsystem);
ToolEnvironment* env = new ToolEnvironment(context_);
context_->RegisterSubsystem(env);
//#ifdef ATOMIC_DEV_BUILD
if (!env->InitFromJSON())
{
ErrorExit(ToString("Unable to initialize tool environment from %s", env->GetDevConfigFilename().CString()));
return;
}
if (!cliDataPath_.Length())
{
cliDataPath_ = env->GetRootSourceDir() + "/Resources/";
}
//#endif
tsystem->SetCLI();
tsystem->SetDataPath(cliDataPath_);
if (activationKey_.Length())
{
DoActivation();
return;
} else if (deactivate_)
{
DoDeactivation();
return;
}
BuildSystem* buildSystem = GetSubsystem<BuildSystem>();
SharedPtr<CommandParser> parser(new CommandParser(context_));
SharedPtr<Command> cmd(parser->Parse(arguments));
if (!cmd)
{
String error = "No command found";
if (parser->GetErrorMessage().Length())
error = parser->GetErrorMessage();
ErrorExit(error);
return;
}
if (cmd->RequiresProjectLoad())
{
FileSystem* fileSystem = GetSubsystem<FileSystem>();
String projectDirectory = fileSystem->GetCurrentDir();
Vector<String> projectFiles;
fileSystem->ScanDir(projectFiles, projectDirectory, "*.atomic", SCAN_FILES, false);
if (!projectFiles.Size())
{
ErrorExit(ToString("No .atomic project file in %s", projectDirectory.CString()));
return;
}
else if (projectFiles.Size() > 1)
{
ErrorExit(ToString("Multiple .atomic project files found in %s", projectDirectory.CString()));
return;
}
String projectFile = projectDirectory + "/" + projectFiles[0];
if (!tsystem->LoadProject(projectFile))
{
//ErrorExit(ToString("Failed to load project: %s", projectFile.CString()));
//return;
}
// Set the build path
String buildFolder = projectDirectory + "/" + "Build";
buildSystem->SetBuildPath(buildFolder);
if (!fileSystem->DirExists(buildFolder))
{
fileSystem->CreateDir(buildFolder);
if (!fileSystem->DirExists(buildFolder))
//.........这里部分代码省略.........