本文整理汇总了C++中CClientWebBrowser::SetTempURL方法的典型用法代码示例。如果您正苦于以下问题:C++ CClientWebBrowser::SetTempURL方法的具体用法?C++ CClientWebBrowser::SetTempURL怎么用?C++ CClientWebBrowser::SetTempURL使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CClientWebBrowser
的用法示例。
在下文中一共展示了CClientWebBrowser::SetTempURL方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LoadBrowserURL
int CLuaFunctionDefs::LoadBrowserURL ( lua_State* luaVM )
{
// bool loadBrowserURL ( browser webBrowser, string url [, string postData = "", bool postURLEncoded = true ] )
CClientWebBrowser* pWebBrowser; SString strURL; SString strPostData; bool bURLEncoded;
CScriptArgReader argStream ( luaVM );
argStream.ReadUserData ( pWebBrowser );
argStream.ReadString ( strURL );
argStream.ReadString ( strPostData, "" );
argStream.ReadBool ( bURLEncoded, true );
if ( !argStream.HasErrors () )
{
// Are we dealing with a remote website?
if ( strURL.substr ( 0, 7 ) == "http://" || strURL.substr ( 0, 8 ) == "https://" )
{
lua_pushboolean ( luaVM, pWebBrowser->LoadURL ( strURL, true, strPostData, bURLEncoded ) );
return 1;
}
// Are we dealing with a local website? If so, parse resource path. Otherwise, return false and load nothing
// Todo: Add an ACL right which is necessary to load local websites or websites in general
CLuaMain* pLuaMain = m_pLuaManager->GetVirtualMachine ( luaVM );
if ( pLuaMain )
{
SString strAbsPath;
CResource* pResource = pLuaMain->GetResource ();
if ( CResourceManager::ParseResourcePathInput ( strURL, pResource, strAbsPath ) && pWebBrowser->IsLocal () )
{
pWebBrowser->SetTempURL ( strURL );
lua_pushboolean ( luaVM, pWebBrowser->LoadURL ( "mtalocal://" + strURL, false, strPostData, bURLEncoded ) );
return 1;
}
}
}
else
m_pScriptDebugging->LogCustom ( luaVM, argStream.GetFullErrorMessage () );
lua_pushboolean ( luaVM, false );
return 1;
}