//static void LLFloaterReg::registerControlVariables() { // Iterate through alll registered instance names and register rect and visibility control variables for (build_map_t::iterator iter = sBuildMap.begin(); iter != sBuildMap.end(); ++iter) { const std::string& name = iter->first; // <FS:Zi> Save rects even when the floater wasn't opened this session // if (LLFloater::getControlGroup()->controlExists(getRectControlName(name))) // </FS:Zi> if (!LLFloater::getControlGroup()->controlExists(getRectControlName(name))) { declareRectControl(name); } // <FS:Zi> Save rects even when the floater wasn't opened this session // if (LLFloater::getControlGroup()->controlExists(getVisibilityControlName(name))) // </FS:Zi> if (!LLFloater::getControlGroup()->controlExists(getVisibilityControlName(name))) { declareVisibilityControl(name); } } const LLSD& exclude_list = LLUI::sSettingGroups["config"]->getLLSD("always_showable_floaters"); for (LLSD::array_const_iterator iter = exclude_list.beginArray(); iter != exclude_list.endArray(); iter++) { sAlwaysShowableList.insert(iter->asString()); } }
// 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; }
std::string LLSLURL::getSLURLString() const { switch(mType) { case HOME_LOCATION: return SIM_LOCATION_HOME; case LAST_LOCATION: return SIM_LOCATION_LAST; case LOCATION: { // lookup the grid S32 x = llround( (F32)mPosition[VX] ); S32 y = llround( (F32)mPosition[VY] ); S32 z = llround( (F32)mPosition[VZ] ); std::string ret = LLGridManager::getInstance()->getSLURLBase(mGrid); // <FS:CR> std::string region = mRegion; std::size_t pos; pos = region.find(mGrid); if (pos != std::string::npos) { region.erase(pos, pos + mGrid.length() + 1); } // </FS:CR> // ret.append(LLURI::escape(mRegion)); // ret.append(llformat("/%d/%d/%d",x,y,z)); // [RLVa:KB] - Checked: 2010-04-05 (RLVa-1.2.0d) | Added: RLVa-1.2.0d ret.append( ( ((!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) || (!RlvUtil::isNearbyRegion(region))) ? (LLURI::escape(region) + llformat("/%d/%d/%d",x,y,z)) : RlvStrings::getString(RLV_STRING_HIDDEN_REGION) )); // [/RLVa:KB] LL_DEBUGS("SLURL") << "Location: " << ret << LL_ENDL; return ret; } case APP: { std::ostringstream app_url; app_url << LLGridManager::getInstance()->getAppSLURLBase() << "/" << mAppCmd; for(LLSD::array_const_iterator i = mAppPath.beginArray(); i != mAppPath.endArray(); i++) { app_url << "/" << i->asString(); } if(mAppQuery.length() > 0) { app_url << "?" << mAppQuery; } return app_url.str(); } default: LL_WARNS("AppInit") << "Unexpected SLURL type for SLURL string" << (int)mType << LL_ENDL; return std::string(); } }
void LLViewerLogin::getLoginURIs(std::vector<std::string>& uris) const { // return the login uri set on the command line. LLControlVariable* c = gSavedSettings.getControl("CmdLineLoginURI"); if(c && !LLStartUp::shouldAutoLogin()) { LLSD v = c->getValue(); if(v.isArray()) { for(LLSD::array_const_iterator itr = v.beginArray(); itr != v.endArray(); ++itr) { std::string uri = itr->asString(); if(!uri.empty()) { uris.push_back(uri); } } } else { std::string uri = v.asString(); if(!uri.empty()) { uris.push_back(uri); } } } // If there was no command line uri... if(uris.empty()) { uris.push_back(gHippoGridManager->getConnectedGrid()->getLoginUri()); /* // If its a known grid choice, get the uri from the table, // else try the grid name. if(mGridChoice > GRID_INFO_NONE && mGridChoice < GRID_INFO_OTHER) { uris.push_back(gGridInfo[mGridChoice].mLoginURI); } else { uris.push_back(mGridName); } */ } }
void LLFloaterAutoReplaceSettings::updateListNames() { mListNames->deleteAllItems(); // start from scratch LLSD listNames = mSettings.getListNames(); // Array of Strings for ( LLSD::array_const_iterator entry = listNames.beginArray(), end = listNames.endArray(); entry != end; ++entry ) { const std::string& listName = entry->asString(); mListNames->addSimpleElement(listName); } if (!mSelectedListName.empty()) { mListNames->setSelectedByValue( LLSD(mSelectedListName), true ); } }
virtual void uploadComplete(const LLSD& content) { // Bytecode save completed if (content["compiled"]) { mSupplier->log("Compilation succeeded"); llinfos << "Compiled!" << llendl; } else { LLSD compile_errors = content["errors"]; for(LLSD::array_const_iterator line = compile_errors.beginArray(); line < compile_errors.endArray(); line++) { mSupplier->log(line->asString()); llinfos << content["errors"] << llendl; } } LLUpdateTaskInventoryResponder::uploadComplete(content); }
virtual void uploadComplete(const LLSD& content) { // Bytecode save completed if (content["compiled"]) { mSupplier->log("Compilation succeeded"); LL_INFOS() << "Compiled!" << LL_ENDL; } else { LLSD compile_errors = content["errors"]; for(LLSD::array_const_iterator line = compile_errors.beginArray(); line < compile_errors.endArray(); line++) { std::string str = line->asString(); str.erase(std::remove(str.begin(), str.end(), '\n'), str.end()); mSupplier->log(str); LL_INFOS() << content["errors"] << LL_ENDL; } } LLUpdateTaskInventoryResponder::uploadComplete(content); }
std::string LLSLURL::getSLURLString() const { switch(mType) { case HOME_LOCATION: return SIM_LOCATION_HOME; case LAST_LOCATION: return SIM_LOCATION_LAST; case LOCATION: { // lookup the grid S32 x = llround( (F32)mPosition[VX] ); S32 y = llround( (F32)mPosition[VY] ); S32 z = llround( (F32)mPosition[VZ] ); return LLGridManager::getInstance()->getSLURLBase(mGrid) + LLURI::escape(mRegion) + llformat("/%d/%d/%d",x,y,z); } case APP: { std::ostringstream app_url; app_url << LLGridManager::getInstance()->getAppSLURLBase() << "/" << mAppCmd; for(LLSD::array_const_iterator i = mAppPath.beginArray(); i != mAppPath.endArray(); i++) { app_url << "/" << i->asString(); } if(mAppQuery.length() > 0) { app_url << "?" << mAppQuery; } return app_url.str(); } default: LL_WARNS("AppInit") << "Unexpected SLURL type for SLURL string" << (int)mType << LL_ENDL; return std::string(); } }
// 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) { LL_DEBUGS() << "PATH: inserting " << it->asString() << LL_ENDL; result.mEscapedPath += "/" + escapePathComponent(it->asString()); } } else if (path.isString()) { std::string pathstr(path); // Trailing slash is significant in HTTP land. If caller specified, // make a point of preserving. std::string last_slash; std::string::size_type len(pathstr.length()); if (len && pathstr[len-1] == '/') { last_slash = "/"; } // Escape every individual path component, recombining with slashes. for (boost::split_iterator<std::string::const_iterator> ti(pathstr, boost::first_finder("/")), tend; ti != tend; ++ti) { // Eliminate a leading slash or duplicate slashes anywhere. (Extra // slashes show up here as empty components.) This test also // eliminates a trailing slash, hence last_slash above. if (! ti->empty()) { result.mEscapedPath += "/" + escapePathComponent(std::string(ti->begin(), ti->end())); } } // Reinstate trailing slash, if any. result.mEscapedPath += last_slash; } else if(path.isUndefined()) { // do nothing } else { LL_WARNS() << "Valid path arguments to buildHTTP are array, string, or undef, you passed type" << path.type() << LL_ENDL; } result.mEscapedOpaque = "//" + result.mEscapedAuthority + result.mEscapedPath; return result; }