• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ LLURI函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中LLURI函数的典型用法代码示例。如果您正苦于以下问题:C++ LLURI函数的具体用法?C++ LLURI怎么用?C++ LLURI使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了LLURI函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: checkParts

void URITestObject::test<4>()
{
    // scheme w/o paths
    checkParts(LLURI("mailto:[email protected]"),
               "mailto", "[email protected]", "", "");
    checkParts(LLURI("silly://abc/def?foo"),
               "silly", "//abc/def?foo", "", "");
}
开发者ID:HizWylder,项目名称:GIS,代码行数:8,代码来源:lluri_test.cpp


示例2: downloadMarkerPath

void LLUpdateDownloader::Implementation::resume(void)
{
	mCancelled = false;

	if(isDownloading()) {
		mClient.downloadError("download in progress");
	}

	mDownloadRecordPath = downloadMarkerPath();
	llifstream dataStream(mDownloadRecordPath);
	if(!dataStream) {
		mClient.downloadError("no download marker");
		return;
	}
	
	LLSDSerialize::fromXMLDocument(mDownloadData, dataStream);
	
	if(!mDownloadData.asBoolean()) {
		mClient.downloadError("no download information in marker");
		return;
	}
	
	std::string filePath = mDownloadData["path"].asString();
	try {
		if(LLFile::isfile(filePath)) {		
			llstat fileStatus;
			LLFile::stat(filePath, &fileStatus);
			if(fileStatus.st_size != mDownloadData["size"].asInteger()) {
				resumeDownloading(fileStatus.st_size);
			} else if(!validateDownload()) {
				LLFile::remove(filePath);
				download(LLURI(mDownloadData["url"].asString()), 
						 mDownloadData["hash"].asString(),
						 mDownloadData["update_version"].asString(),
						 mDownloadData["required"].asBoolean());
			} else {
				mClient.downloadComplete(mDownloadData);
			}
		} else {
			download(LLURI(mDownloadData["url"].asString()), 
					 mDownloadData["hash"].asString(),
					 mDownloadData["update_version"].asString(),
					 mDownloadData["required"].asBoolean());
		}
	} catch(DownloadError & e) {
		mClient.downloadError(e.what());
	}
}
开发者ID:Krazy-Bish-Margie,项目名称:Thunderstorm,代码行数:48,代码来源:llupdatedownloader.cpp


示例3: startInternetStream

// virtual
void LLAudioEngine::startInternetStream(const std::string& url)
{
	llinfos << "entered startInternetStream()" << llendl;

	if (!mInternetStreamMedia)
	{
		LLMediaManager* mgr = LLMediaManager::getInstance();
		if (mgr)
		{
			mInternetStreamMedia = mgr->createSourceFromMimeType(LLURI(url).scheme(), "audio/mpeg"); // assumes that whatever media implementation supports mp3 also supports vorbis.
			llinfos << "mInternetStreamMedia is now " << mInternetStreamMedia << llendl;
		}
	}

	if(!mInternetStreamMedia)
		return;
	
	if (!url.empty()) {
		llinfos << "Starting internet stream: " << url << llendl;
		mInternetStreamURL = url;
#if LL_QUICKTIME_ENABLED
		mInternetStreamMedia->navigateTo ( createListenPls(url) );
#else
		mInternetStreamMedia->navigateTo ( url );
#endif
		llinfos << "Playing....." << llendl;		
		mInternetStreamMedia->addCommand(LLMediaBase::COMMAND_START);
		mInternetStreamMedia->updateMedia();
	} else {
		llinfos << "setting stream to NULL"<< llendl;
		mInternetStreamURL.clear();
		mInternetStreamMedia->addCommand(LLMediaBase::COMMAND_STOP);
		mInternetStreamMedia->updateMedia();
	}
}
开发者ID:Xara,项目名称:Luna-Viewer,代码行数:36,代码来源:audioengine.cpp


示例4: LLURI

std::string LLUrlEntryRegion::getLocation(const std::string &url) const
{
	LLSD path_array = LLURI(url).pathArray();
	std::string region_name = unescapeUrl(path_array[2]);
	LL_DEBUGS("UrlEntry") << "location " << region_name << LL_ENDL;
	return region_name;
}
开发者ID:DarkSpyro003,项目名称:DarkSpyros_Viewer,代码行数:7,代码来源:llurlentry.cpp


示例5: LLURI

// virtual
LLSD LLAssetStorage::getPendingDetailsImpl(const LLAssetStorage::request_list_t* requests,
										LLAssetType::EType asset_type,
										const std::string& detail_prefix) const
{
	LLSD details;
	if (requests)
	{
		request_list_t::const_iterator it = requests->begin();
		request_list_t::const_iterator end = requests->end();
		for ( ; it != end; ++it)
		{
			LLAssetRequest* req = *it;
			if (   (LLAssetType::AT_NONE == asset_type)
				|| (req->getType() == asset_type) )
			{
				LLSD row = req->getTerseDetails();

				std::ostringstream detail;
				detail	<< detail_prefix << "/" << LLAssetType::lookup(req->getType())
						<< "/" << req->getUUID();
				row["detail"] = LLURI(detail.str());

				details.append(row);
			}
		}
	}
	return details;
}
开发者ID:Barosonix,项目名称:AstraViewer,代码行数:29,代码来源:llassetstorage.cpp


示例6: sanitizeUri

void HippoGridInfo::setLoginUri(const std::string& loginUri)
{
	std::string uri = loginUri;
	mLoginUri = sanitizeUri(uri);
	if (utf8str_tolower(LLURI(uri).hostName()) == "login.agni.lindenlab.com")
	{
		mIsInProductionGrid = true;
	}
}
开发者ID:nhede,项目名称:SingularityViewer,代码行数:9,代码来源:hippogridmanager.cpp


示例7: sanitizeUri

void HippoGridInfo::setLoginUri(const std::string& loginUri)
{
	mLoginUri = sanitizeUri(loginUri);
	if (utf8str_tolower(LLURI(mLoginUri).hostName()) == "login.agni.lindenlab.com")
	{
		mIsInProductionGrid = true;
		useHttps();
		setPlatform(PLATFORM_SECONDLIFE);
	}
	else if (utf8str_tolower(LLURI(mLoginUri).hostName()) == "login.aditi.lindenlab.com")
	{
		useHttps();
		setPlatform(PLATFORM_SECONDLIFE);
	}
	else if (utf8str_tolower(LLURI(mLoginUri).hostName()) == "login.avination.com" ||
		utf8str_tolower(LLURI(mLoginUri).hostName()) == "login.avination.net")
	{
		mIsInAvination = true;
		useHttps();
	}
}
开发者ID:1234-,项目名称:SingularityViewer,代码行数:21,代码来源:hippogridmanager.cpp


示例8: startInternetStream

// virtual
void LLAudioEngine::startInternetStream(const std::string& url)
{
	llinfos << "entered startInternetStream()" << llendl;

	if (!mInternetStreamMedia)
	{
		LLMediaManager* mgr = LLMediaManager::getInstance();
		if (mgr)
		{
			mInternetStreamMedia = mgr->createSourceFromMimeType(LLURI(url).scheme(), "audio/mpeg"); // assumes that whatever media implementation supports mp3 also supports vorbis.
			llinfos << "mInternetStreamMedia is now " << mInternetStreamMedia << llendl;
		}
	}

	if(!mInternetStreamMedia)
	{
		return;
	}
	// Check for a dead stream from gstreamer, just in case
	else if(getStatus() == LLMediaBase::STATUS_DEAD)
	{
		llinfos << "don't play dead stream urls"<< llendl;
		mInternetStreamURL.clear();
		mInternetStreamMedia->addCommand(LLMediaBase::COMMAND_STOP);
		mInternetStreamMedia->updateMedia();
		stopInternetStream();
	}
	else if (url.empty())
	{
		llinfos << "url is emptly. Setting stream to NULL"<< llendl;
		mInternetStreamURL.clear();
		mInternetStreamMedia->addCommand(LLMediaBase::COMMAND_STOP);
		mInternetStreamMedia->updateMedia();
	}
	// Stream appears to be good, attempting to play
	else
	{
		// stop any other stream first
		stopInternetStream();

		llinfos << "Starting internet stream: " << url << llendl;
		mInternetStreamURL = url;
		mInternetStreamMedia->navigateTo(url);
		//llinfos << "Playing....." << llendl;		
		mInternetStreamMedia->addCommand(LLMediaBase::COMMAND_START);
		mInternetStreamMedia->updateMedia();
		mStatus = LLMediaBase::STATUS_STARTED;
	}
}
开发者ID:ArminW,项目名称:imprudence,代码行数:50,代码来源:audioengine.cpp


示例9: LLURI

// static
LLURI LLURI::buildHTTP(const std::string& prefix,
					   const LLSD& path)
{
	LLURI result;
	
	// TODO: deal with '/' '?' '#' in host_port
	if (prefix.find("://") != prefix.npos)
	{
		// it is a prefix
		result = LLURI(prefix);
	}
	else
	{
		// it is just a host and optional port
		result.mScheme = "http";
		result.mEscapedAuthority = escapeHostAndPort(prefix);
	}

	if (path.isArray())
	{
		// break out and escape each path component
		for (LLSD::array_const_iterator it = path.beginArray();
			 it != path.endArray();
			 ++it)
		{
			lldebugs << "PATH: inserting " << it->asString() << llendl;
			result.mEscapedPath += "/" + escapePathComponent(it->asString());
		}
	}
	else if(path.isString())
	{
		result.mEscapedPath += "/" + escapePathComponent(path.asString());
	} 
	else if(path.isUndefined())
	{
	  // do nothing
	}
    else
	{
	  llwarns << "Valid path arguments to buildHTTP are array, string, or undef, you passed type" 
			  << path.type() << llendl;
	}
	result.mEscapedOpaque = "//" + result.mEscapedAuthority +
		result.mEscapedPath;
	return result;
}
开发者ID:OS-Development,项目名称:VW.Kirsten,代码行数:47,代码来源:lluri.cpp


示例10: LLURI

void FSPanelLogin::loadLoginPage()
{
	if (!sInstance) return;

	LLURI login_page = LLURI(LLGridManager::getInstance()->getLoginPage());
	LLSD params(login_page.queryMap());

	LL_DEBUGS("AppInit") << "login_page: " << login_page << LL_ENDL;

	// Language
	params["lang"] = LLUI::getLanguage();

	// First Login?
	if (gSavedSettings.getBOOL("FirstLoginThisInstall"))
	{
		params["firstlogin"] = "TRUE"; // not bool: server expects string TRUE
	}

	// Channel and Version
	params["version"] = llformat("%s (%d)",
								 LLVersionInfo::getShortVersion().c_str(),
								 LLVersionInfo::getBuild());
	params["channel"] = LLVersionInfo::getChannel();

	// Grid
	params["grid"] = LLGridManager::getInstance()->getGridId();

	// add OS info
	params["os"] = LLAppViewer::instance()->getOSInfo().getOSStringSimple();

	// sourceid
	params["sourceid"] = gSavedSettings.getString("sourceid");

	// Make an LLURI with this augmented info
	LLURI login_uri(LLURI::buildHTTP(login_page.authority(),
									 login_page.path(),
									 params));

	LLMediaCtrl* web_browser = sInstance->getChild<LLMediaCtrl>("login_html");
	if (web_browser->getCurrentNavUrl() != login_uri.asString())
	{
		LL_DEBUGS("AppInit") << "loading:    " << login_uri << LL_ENDL;
		web_browser->navigateTo( login_uri.asString(), HTTP_CONTENT_TEXT_HTML );
	}
}
开发者ID:CaseyraeStarfinder,项目名称:Firestorm-Viewer,代码行数:45,代码来源:fspanellogin.cpp


示例11: u

void URITestObject::test<18>()
{
    LLURI u("GIS:///app/login?first_name=Testert4&last_name=Tester&web_login_key=test");
    // if GIS is the scheme, LLURI should parse /app/login as path, with no authority
    ensure_equals("scheme",		u.scheme(),		"GIS");
    ensure_equals("authority",	u.authority(),	"");
    ensure_equals("path",		u.path(),		"/app/login");
    ensure_equals("pathmap",	u.pathArray()[0].asString(),	"app");
    ensure_equals("pathmap",	u.pathArray()[1].asString(),	"login");
    ensure_equals("query",		u.query(),		"first_name=Testert4&last_name=Tester&web_login_key=test");
    ensure_equals("query map element", u.queryMap()["last_name"].asString(), "Tester");

    u = LLURI("GIS://Da Boom/128/128/128");
    // if GIS is the scheme, LLURI should parse /128/128/128 as path, with Da Boom as authority
    ensure_equals("scheme",		u.scheme(),		"GIS");
    ensure_equals("authority",	u.authority(),	"Da Boom");
    ensure_equals("path",		u.path(),		"/128/128/128");
    ensure_equals("pathmap",	u.pathArray()[0].asString(),	"128");
    ensure_equals("pathmap",	u.pathArray()[1].asString(),	"128");
    ensure_equals("pathmap",	u.pathArray()[2].asString(),	"128");
    ensure_equals("query",		u.query(),		"");
}
开发者ID:HizWylder,项目名称:GIS,代码行数:22,代码来源:lluri_test.cpp


示例12: candidate_uri

// static
bool LLMediaEntry::checkUrlAgainstWhitelist(const std::string& url, 
                                            const std::vector<std::string> &whitelist)
{
    bool passes = true;
    // *NOTE: no entries?  Don't check
    if (whitelist.size() > 0) 
    {
        passes = false;
            
        // Case insensitive: the reason why we toUpper both this and the
        // filter
        std::string candidate_url = url;
        // Use lluri to see if there is a path part in the candidate URL.  No path?  Assume "/"
        LLURI candidate_uri(candidate_url);
        std::vector<std::string>::const_iterator iter = whitelist.begin();
        std::vector<std::string>::const_iterator end = whitelist.end();
        for ( ; iter < end; ++iter )
        {
            std::string filter = *iter;
                
            LLURI filter_uri(filter);
            bool scheme_passes = pattern_match( candidate_uri.scheme(), filter_uri.scheme() );
            if (filter_uri.scheme().empty()) 
            {
                filter_uri = LLURI(DEFAULT_URL_PREFIX + filter);
            }
            bool authority_passes = pattern_match( candidate_uri.authority(), filter_uri.authority() );
            bool path_passes = pattern_match( candidate_uri.escapedPath(), filter_uri.escapedPath() );

            if (scheme_passes && authority_passes && path_passes)
            {
                passes = true;
                break;
            }
        }
    }
    return passes;
}
开发者ID:OS-Development,项目名称:VW.Kirsten,代码行数:39,代码来源:llmediaentry.cpp


示例13: LLURI

void LLPanelLogin::loadLoginPage()
{
	if (!sInstance) return;
	

	std::string login_page = gHippoGridManager->getCurrentGrid()->getLoginPage();
	if (login_page.empty()) 
	{
		sInstance->setSiteIsAlive(false);
		return;
	}

	std::ostringstream oStr;
	oStr << login_page;
	
	// Use the right delimeter depending on how LLURI parses the URL
	LLURI login_page_uri = LLURI(login_page);
	std::string first_query_delimiter = "&";
	if (login_page_uri.queryMap().size() == 0)
	{
		first_query_delimiter = "?";
	}

	// Language
	std::string language = LLUI::getLanguage();
	oStr << first_query_delimiter<<"lang=" << language;
	
	// First Login?
	if (gSavedSettings.getBOOL("FirstLoginThisInstall"))
	{
		oStr << "&firstlogin=TRUE";
	}

	// Channel and Version
	std::string version = llformat("%d.%d.%d %s",
		ViewerVersion::getImpMajorVersion(), ViewerVersion::getImpMinorVersion(),
		ViewerVersion::getImpPatchVersion(), ViewerVersion::getImpTestVersion().c_str() );

	char* curl_channel = curl_escape(gSavedSettings.getString("VersionChannelName").c_str(), 0);
	char* curl_version = curl_escape(version.c_str(), 0);

	oStr << "&channel=" << curl_channel;
	oStr << "&version=" << curl_version;

	curl_free(curl_channel);
	curl_free(curl_version);

	// Grid
	char* curl_grid = curl_escape(LLViewerLogin::getInstance()->getGridLabel().c_str(), 0);
	oStr << "&grid=" << curl_grid;
	curl_free(curl_grid);

	gViewerWindow->setMenuBackgroundColor(false, !LLViewerLogin::getInstance()->isInProductionGrid());
	//LLViewerLogin::getInstance()->setMenuColor();
	gLoginMenuBarView->setBackgroundColor(gMenuBarView->getBackgroundColor());


#if USE_VIEWER_AUTH
	LLURLSimString::sInstance.parse();

	std::string location;
	std::string region;
	std::string password;
	
	if (LLURLSimString::parse())
	{
		std::ostringstream oRegionStr;
		location = "specify";
		oRegionStr << LLURLSimString::sInstance.mSimName << "/" << LLURLSimString::sInstance.mX << "/"
			 << LLURLSimString::sInstance.mY << "/"
			 << LLURLSimString::sInstance.mZ;
		region = oRegionStr.str();
	}
	else
	{
		if (gSavedSettings.getBOOL("LoginLastLocation"))
		{
			location = "last";
		}
		else
		{
			location = "home";
		}
	}

	std::string firstname, lastname;

	if(gSavedSettings.getLLSD("UserLoginInfo").size() == 3)
	{
		LLSD cmd_line_login = gSavedSettings.getLLSD("UserLoginInfo");
		firstname = cmd_line_login[0].asString();
		lastname = cmd_line_login[1].asString();
		password = cmd_line_login[2].asString();
	}

	if (firstname.empty())
	{
		firstname = gSavedSettings.getString("FirstName");
	}
	
//.........这里部分代码省略.........
开发者ID:ArminW,项目名称:imprudence,代码行数:101,代码来源:llpanellogin.cpp


示例14: LLURI

void LLPanelLogin::loadLoginPage()
{
	if (!sInstance) return;

	sInstance->updateGridCombo();
	std::ostringstream oStr;

	std::string login_page = gHippoGridManager->getConnectedGrid()->getLoginPage();
	if (login_page.empty())
	{
		sInstance->setSiteIsAlive(false);
		return;
	}

	oStr << login_page;

	// Use the right delimeter depending on how LLURI parses the URL
	LLURI login_page_uri = LLURI(login_page);
	std::string first_query_delimiter = "&";
	if (login_page_uri.queryMap().size() == 0)
	{
		first_query_delimiter = "?";
	}

	// Language
	std::string language = LLUI::getLanguage();
	oStr << first_query_delimiter<<"lang=" << language;

	// First Login?
	if (gSavedSettings.getBOOL("FirstLoginThisInstall"))
	{
		oStr << "&firstlogin=TRUE";
	}

	std::string version = llformat("%d.%d.%d (%d)",
						LL_VERSION_MAJOR, LL_VERSION_MINOR, LL_VERSION_PATCH, LL_VERSION_BUILD);

	if(login_page.find("secondlife.com") == -1) {
		oStr << "&channel=" << LLWeb::curlEscape(LL_CHANNEL);
		oStr << "&version=" << LLWeb::curlEscape(version);
	}

	// Grid
	oStr << "&grid=" << LLWeb::curlEscape(LLViewerLogin::getInstance()->getGridLabel());

	if (gHippoGridManager->getConnectedGrid()->isSecondLife()) {
		// find second life grid from login URI
		// yes, this is heuristic, but hey, it is just to get the right login page...
		std::string tmp = gHippoGridManager->getConnectedGrid()->getLoginUri();
		int i = tmp.find(".lindenlab.com");
		if (i != std::string::npos) {
			tmp = tmp.substr(0, i);
			i = tmp.rfind('.');
			if (i == std::string::npos)
				i = tmp.rfind('/');
			if (i != std::string::npos) {
				tmp = tmp.substr(i+1);
				oStr << "&grid=" << LLWeb::curlEscape(tmp);
			}
		}
	}
	
	gViewerWindow->setMenuBackgroundColor(false, !LLViewerLogin::getInstance()->isInProductionGrid());
	gLoginMenuBarView->setBackgroundColor(gMenuBarView->getBackgroundColor());


#if USE_VIEWER_AUTH
	LLURLSimString::sInstance.parse();

	std::string location;
	std::string region;
	std::string password;
	
	if (LLURLSimString::parse())
	{
		std::ostringstream oRegionStr;
		location = "specify";
		oRegionStr << LLURLSimString::sInstance.mSimName << "/" << LLURLSimString::sInstance.mX << "/"
			 << LLURLSimString::sInstance.mY << "/"
			 << LLURLSimString::sInstance.mZ;
		region = oRegionStr.str();
	}
	else
	{
		if (gSavedSettings.getBOOL("LoginLastLocation"))
		{
			location = "last";
		}
		else
		{
			location = "home";
		}
	}
	
	std::string firstname, lastname;

    if(gSavedSettings.getLLSD("UserLoginInfo").size() == 3)
    {
        LLSD cmd_line_login = gSavedSettings.getLLSD("UserLoginInfo");
		firstname = cmd_line_login[0].asString();
//.........这里部分代码省略.........
开发者ID:Barosonix,项目名称:AstraViewer,代码行数:101,代码来源:llpanellogin.cpp


示例15: LLURI

void LLPanelLogin::loadLoginPage()
{
	if (!sInstance) return;
	
	std::ostringstream oStr;

	LLViewerLogin* vl = LLViewerLogin::getInstance();
	std::string login_page = vl->getLoginPageURI();
	if (login_page.empty())
	{
		login_page = sInstance->getString( "real_url" );
		vl->setLoginPageURI(login_page);
	}
	oStr << login_page;
	
	// Use the right delimeter depending on how LLURI parses the URL
	LLURI login_page_uri = LLURI(login_page);
	std::string first_query_delimiter = "&";
	if (login_page_uri.queryMap().size() == 0)
	{
		first_query_delimiter = "?";
	}

	// Language
	std::string language = LLUI::getLanguage();
	oStr << first_query_delimiter<<"lang=" << language;
	
	// First Login?
	if (gSavedSettings.getBOOL("FirstLoginThisInstall"))
	{
		oStr << "&firstlogin=TRUE";
	}

	// Channel and Version
	std::string version = llformat("%d.%d.%d (%d)",
						LL_VERSION_MAJOR, LL_VERSION_MINOR, LL_VERSION_PATCH, LL_VIEWER_BUILD);

	char* curl_channel = curl_escape(LL_CHANNEL, 0);
	char* curl_version = curl_escape(version.c_str(), 0);
	char* curl_t = curl_escape(LLAppViewer::instance()->getWindowTitle().c_str(), 0);

	oStr << "&channel=" << curl_channel;
	oStr << "&version=" << curl_version;
	oStr << "&t=" << curl_t;
	if(LL_CHANNEL != EMERALD_RELEASE_CHANNEL)
		oStr << "&unsupported=1";

	curl_free(curl_channel);
	curl_free(curl_version);
	curl_free(curl_t);

	// grid=blah code was here. Due to the implementation of the Emerald login manager, sending
	// this information is a very bad idea. Don't do it.

	gViewerWindow->setMenuBackgroundColor(false, !LLViewerLogin::getInstance()->isInProductionGrid());
	gLoginMenuBarView->setBackgroundColor(gMenuBarView->getBackgroundColor());


#if USE_VIEWER_AUTH
	LLURLSimString::sInstance.parse();

	std::string location;
	std::string region;
	std::string password;
	
	if (LLURLSimString::parse())
	{
		std::ostringstream oRegionStr;
		location = "specify";
		oRegionStr << LLURLSimString::sInstance.mSimName << "/" << LLURLSimString::sInstance.mX << "/"
			 << LLURLSimString::sInstance.mY << "/"
			 << LLURLSimString::sInstance.mZ;
		region = oRegionStr.str();
	}
	else
	{
		if (gSavedSettings.getBOOL("LoginLastLocation"))
		{
			location = "last";
		}
		else
		{
			location = "home";
		}
	}
	
	std::string firstname, lastname;

    if(gSavedSettings.getLLSD("UserLoginInfo").size() == 3)
    {
        LLSD cmd_line_login = gSavedSettings.getLLSD("UserLoginInfo");
		firstname = cmd_line_login[0].asString();
		lastname = cmd_line_login[1].asString();
        password = cmd_line_login[2].asString();
    }
    	
	if (firstname.empty())
	{
		firstname = gSavedSettings.getString("FirstName");
	}
//.........这里部分代码省略.........
开发者ID:EmeraldViewer,项目名称:EmeraldViewer,代码行数:101,代码来源:llpanellogin.cpp


示例16: LL_INFOS

// resolve a simstring from a slurl
LLSLURL::LLSLURL(const std::string& slurl)
{
    // by default we go to agni.
    mType = INVALID;
    LL_INFOS("AppInit") << "SLURL: " << slurl << LL_ENDL;
    if(slurl == SIM_LOCATION_HOME)
    {
        mType = HOME_LOCATION;
    }
    else if(slurl.empty() || (slurl == SIM_LOCATION_LAST))
    {

        mType = LAST_LOCATION;
    }
    else
    {
        LLURI slurl_uri;
        // parse the slurl as a uri
        if(slurl.find(':') == std::string::npos)
        {
            // There may be no scheme ('secondlife:' etc.) passed in.  In that case
            // we want to normalize the slurl by putting the appropriate scheme
            // in front of the slurl.  So, we grab the appropriate slurl base
            // from the grid manager which may be http://slurl.com/secondlife/ for maingrid, or
            // https://<hostname>/region/ for Standalone grid (the word region, not the region name)
            // these slurls are typically passed in from the 'starting location' box on the login panel,
            // where the user can type in <regionname>/<x>/<y>/<z>
            std::string fixed_slurl = LLGridManager::getInstance()->getSLURLBase();
            // the slurl that was passed in might have a prepended /, or not.  So,
            // we strip off the prepended '/' so we don't end up with http://slurl.com/secondlife/<region>/<x>/<y>/<z>
            // or some such.

            if(slurl[0] == '/')
            {
                fixed_slurl += slurl.substr(1);
            }
            else
            {
                fixed_slurl += slurl;
            }
            // We then load the slurl into a LLURI form
            slurl_uri = LLURI(fixed_slurl);
        }
        else
        {
            // as we did have a scheme, implying a URI style slurl, we
            // simply parse it as a URI
            slurl_uri = LLURI(slurl);
        }

        LLSD path_array = slurl_uri.pathArray();

        // determine whether it's a maingrid URI or an Standalone/open style URI
        // by looking at the scheme.  If it's a 'secondlife:' slurl scheme or
        // 'sl:' scheme, we know it's maingrid

        // At the end of this if/else block, we'll have determined the grid,
        // and the slurl type (APP or LOCATION)
        if(slurl_uri.scheme() == LLSLURL::SLURL_SECONDLIFE_SCHEME)
        {
            // parse a maingrid style slurl.  We know the grid is maingrid
            // so grab it.
            // A location slurl for maingrid (with the special schemes) can be in the form
            // secondlife://<regionname>/<x>/<y>/<z>
            // or
            // secondlife://<Grid>/secondlife/<region>/<x>/<y>/<z>
            // where if grid is empty, it specifies Agni

            // An app style slurl for maingrid can be
            // secondlife://<Grid>/app/<app parameters>
            // where an empty grid implies Agni

            // we'll start by checking the top of the 'path' which will be
            // either 'app', 'secondlife', or <x>.

            // default to maingrid

            mGrid = MAINGRID;

            if ((path_array[0].asString() == LLSLURL::SLURL_SECONDLIFE_PATH) ||
                    (path_array[0].asString() == LLSLURL::SLURL_APP_PATH))
            {
                // it's in the form secondlife://<grid>/(app|secondlife)
                // so parse the grid name to derive the grid ID
                if (!slurl_uri.hostName().empty())
                {
                    mGrid = LLGridManager::getInstance()->getGridByLabel(slurl_uri.hostName());
                }
                else if(path_array[0].asString() == LLSLURL::SLURL_SECONDLIFE_PATH)
                {
                    // If the slurl is in the form secondlife:///secondlife/<region> form,
                    // then we are in fact on maingrid.
                    mGrid = MAINGRID;
                }
                else if(path_array[0].asString() == LLSLURL::SLURL_APP_PATH)
                {
                    // for app style slurls, where no grid name is specified, assume the currently
                    // selected or logged in grid.
                    mGrid =  LLGridManager::getInstance()->getGrid();
//.........这里部分代码省略.........
开发者ID:WoLf-,项目名称:NaCl-main,代码行数:101,代码来源:llslurl.cpp


示例17: get


//.........这里部分代码省略.........
		if(istr.fail())
		{
			llinfos << "STREAM FAILURE reading binary (notation-style) string."
				<< llendl;
			parse_count = PARSE_FAILURE;
		}
		break;
	}

	case 's':
	{
		std::string value;
		if(parseString(istr, value))
		{
			data = value;
		}
		else
		{
			parse_count = PARSE_FAILURE;
		}
		if(istr.fail())
		{
			llinfos << "STREAM FAILURE reading binary string." << llendl;
			parse_count = PARSE_FAILURE;
		}
		break;
	}

	case 'l':
	{
		std::string value;
		if(parseString(istr, value))
		{
			data = LLURI(value);
		}
		else
		{
			parse_count = PARSE_FAILURE;
		}
		if(istr.fail())
		{
			llinfos << "STREAM FAILURE reading binary link." << llendl;
			parse_count = PARSE_FAILURE;
		}
		break;
	}

	case 'd':
	{
		F64 real = 0.0;
		read(istr, (char*)&real, sizeof(F64));	 /*Flawfinder: ignore*/
		data = LLDate(real);
		if(istr.fail())
		{
			llinfos << "STREAM FAILURE reading binary date." << llendl;
			parse_count = PARSE_FAILURE;
		}
		break;
	}

	case 'b':
	{
		// We probably have a valid raw binary stream. determine
		// the size, and read it.
		U32 size_nbo = 0;
		read(istr, (char*)&size_nbo, sizeof(U32));	/*Flawfinder: ignore*/
开发者ID:greythane,项目名称:slitechat,代码行数:67,代码来源:llsdserialize.cpp


示例18: while


//.........这里部分代码省略.........
	}

	case 'u':
	{
		c = get(istr);
		LLUUID id;
		istr >> id;
		data = id;
		if(istr.fail())
		{
			llinfos << "STREAM FAILURE reading uuid." << llendl;
			parse_count = PARSE_FAILURE;
		}
		break;
	}

	case '\"':
	case '\'':
	case 's':
		if(!parseString(istr, data))
		{
			parse_count = PARSE_FAILURE;
		}
		if(istr.fail())
		{
			llinfos << "STREAM FAILURE reading string." << llendl;
			parse_count = PARSE_FAILURE;
		}
		break;

	case 'l':
	{
		c = get(istr); // pop the 'l'
		c = get(istr); // pop the delimiter
		std::string str;
		int cnt = deserialize_string_delim(istr, str, c);
		if(PARSE_FAILURE == cnt)
		{
			parse_count = PARSE_FAILURE;
		}
		else
		{
			data = LLURI(str);
			account(cnt);
		}
		if(istr.fail())
		{
			llinfos << "STREAM FAILURE reading link." << llendl;
			parse_count = PARSE_FAILURE;
		}
		break;
	}

	case 'd':
	{
		c = get(istr); // pop the 'd'
		c = get(istr); // pop the delimiter
		std::string str;
		int cnt = deserialize_string_delim(istr, str, c);
		if(PARSE_FAILURE == cnt)
		{
			parse_count = PARSE_FAILURE;
		}
		else
		{
			data = LLDate(str);
			account(cnt);
		}
		if(istr.fail())
		{
			llinfos << "STREAM FAILURE reading date." << llendl;
			parse_count = PARSE_FAILURE;
		}
		break;
	}

	case 'b':
		if(!parseBinary(istr, data))
		{
			parse_count = PARSE_FAILURE;
		}
		if(istr.fail())
		{
			llinfos << "STREAM FAILURE reading data." << llendl;
			parse_count = PARSE_FAILURE;
		}
		break;

	default:
		parse_count = PARSE_FAILURE;
		llinfos << "Unrecognized character while parsing: int(" << (int)c
			<< ")" << llendl;
		break;
	}
	if(PARSE_FAILURE == parse_count)
	{
		data.clear();
	}
	return parse_count;
}
开发者ID:greythane,项目名称:slitechat,代码行数:101,代码来源:llsdserialize.cpp


示例19: LLURI

void LLPanelLogin::loadLoginPage()
{
	if (!sInstance) return;
	
	std::ostringstream oStr;

	std::string login_page = LLGridManager::getInstance()->getLoginPage();

	oStr << login_page;
	
	// Use the right delimeter depending on how LLURI parses the URL
	LLURI login_page_uri = LLURI(login_page);
	
	std::string first_query_delimiter = "&";
	if (login_page_uri.queryMap().size() == 0)
	{
		first_query_delimiter = "?";
	}

	// Language
	std::string language = LLUI::getLanguage();
	oStr << first_query_delimiter<<"lang=" << language;
	
	// First Login?
	if (gSavedSettings.getBOOL("FirstLoginThisInstall"))
	{
		oStr << "&firstlogin=TRUE";
	}

	// Channel and Version
	std::string version = llformat("%s (%d)",
								   LLVersionInfo::getShortVersion().c_str(),
								   LLVersionInfo::getBuild());

	char* curl_channel ;
	char* curl_version = curl_escape(version.c_str(), 0);

	if(strcmp(LLVersionInfo::getChannel().c_str(), LL_CHANNEL))
	{
		curl_channel = curl_escape(LLVersionInfo::getChannel().c_str(), 0);
	}
	else //if LL_CHANNEL, direct it to "Second Life Beta Viewer".
	{
		curl_channel = curl_escape("Second Life Beta Viewer", 0);		
	}
	oStr << "&channel=" << curl_channel;
	oStr << "&version=" << curl_version;
	
	curl_free(curl_channel);
	curl_free(curl_version);

	// Grid
	char* curl_grid = curl_escape(LLGridManager::getInstance()->getGridLabel().c_str(), 0);
	oStr << "&grid=" << curl_grid;
	curl_free(curl_grid);
	
	// add OS info
	char * os_info = curl_escape(LLAppViewer::instance()->getOSInfo().getOSStringSimple().c_str(), 0);
	oStr << "&os=" << os_info;
	curl_free(os_info);
	
	gViewerWindow->setMenuBackgroundColor(false, !LLGridManager::getInstance()->isInProductionGrid());
	
	LLMediaCtrl* web_browser = sInstance->getChild<LLMediaCtrl>("login_html");
	if (web_browser->getCurrentNavUrl() != oStr.str())
	{
		web_browser->navigateTo( oStr.str(), "text/html" );
	}
}
开发者ID:Xara,项目名称:kris-clone,代码行数:69,代码来源:llpanellogin.cpp


示例20: LLURI

void LLPanelLogin::loadLoginPage()
{
	if (!sInstance) return;

 	sInstance->updateGridCombo();

	std::string login_page_str = gHippoGridManager->getCurrentGrid()->getLoginPage();
	if (login_page_str.empty())
	{
		sInstance->setSiteIsAlive(false);
		return;
	}
  
	// Use the right delimeter depending on how LLURI parses the URL
	LLURI login_page = LLURI(login_page_str);
	LLSD params(login_page.queryMap());
 
	LL_DEBUGS("AppInit") << "login_page: " << login_page << LL_ENDL;

 	// Language
	params["lang"] = LLUI::getLanguage();
 
 	// First Login?
 	if (gSavedSettings.getBOOL("FirstLoginThisInstall"))
	{
		params["firstlogin"] = "TRUE"; // not bool: server expects string TRUE
 	}
 
	params["version"]= llformat("%d.%d.%d (%d)",
				gVersionMajor, gVersionMinor, gVersionPatch, gVersionBuild);
	params["channel"] = gVersionChannel;

	// Grid

	if (gHippoGridManager->getCurrentGrid()->isSecondLife()) {
		// find second life grid from login URI
		// yes, this is heuristic, but hey, it is just to get the right login page...
		std::string tmp = gHippoGridManager->getCurrentGrid()->getLoginUri();
		int i = tmp.find(".lindenlab.com");
		if (i != std::string::npos) {
			tmp = tmp.substr(0, i);
			i = tmp.rfind('.');
			if (i == std::string::npos)
				i = tmp.rfind('/');
			if (i != std::string::npos) {
				tmp = tmp.substr(i+1);
				params["grid"] = tmp;
			}
		}
	}
	else if (gHippoGridManager->getCurrentGrid()->isOpenSimulator())
	{
		params["grid"] = gHippoGridManager->getCurrentGrid()->getGridNick();
	}
	else if (gHippoGridManager->getCurrentGrid()->getPlatform() == HippoGridInfo::PLATFORM_AURORA)
	{
		params["grid"] = LLViewerLogin::getInstance()->getGridLabel();
	}
	
	// add OS info
	params["os"] = LLAppViewer::instance()->getOSInfo().getOSStringSimple();
		
	// Make an LLURI with this augmented info
	LLURI login_uri(LLURI::buildHTTP(login_page.authority(),
									 login_page.path(),
									 params));
	
	gViewerWindow->setMenuBackgroundColor(false, !LLViewerLogin::getInstance()->isInProductionGrid());
	gLoginMenuBarView->setBackgroundColor(gMenuBarView->getBackgroundColor());

	std::string singularity_splash_uri = gSavedSettings.getString("SingularitySplashPagePrefix");
	if (!singularity_splash_uri.empty())
	{
		params["original_page"] = login_uri.asString();
		login_uri = LLURI::buildHTTP(singularity_splash_uri, gSavedSettings.getString("SingularitySplashPagePath"), params);
	}

	LLMediaCtrl* web_browser = sInstance->getChild<LLMediaCtrl>("login_html");
	if (web_browser->getCurrentNavUrl() != login_uri.asString())
	{
		LL_DEBUGS("AppInit") << "loading:    " << login_uri << LL_ENDL;
		web_browser->navigateTo( login_uri.asString(), "text/html" );
	}
}
开发者ID:sines,项目名称:SingularityViewer,代码行数:84,代码来源:llpanellogin.cpp



注:本文中的LLURI函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ LLVMBuildAnd函数代码示例发布时间:2022-05-30
下一篇:
C++ LLSLURL函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap