本文整理汇总了C++中LLString类的典型用法代码示例。如果您正苦于以下问题:C++ LLString类的具体用法?C++ LLString怎么用?C++ LLString使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了LLString类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: childGetValue
void LLPanelRequestTools::refresh()
{
std::string buffer = childGetValue("destination");
LLCtrlListInterface *list = childGetListInterface("destination");
if (!list) return;
list->operateOnAll(LLCtrlListInterface::OP_DELETE);
list->addSimpleElement(SELECTION);
list->addSimpleElement(AGENT_REGION);
for (LLWorld::region_list_t::iterator iter = gWorldp->mActiveRegionList.begin();
iter != gWorldp->mActiveRegionList.end(); ++iter)
{
LLViewerRegion* regionp = *iter;
LLString name = regionp->getName();
//MK
if (RRenabled && gAgent.mRRInterface.mContainsShowloc)
{
name = "(Hidden)";
}
//mk
if (!name.empty())
{
list->addSimpleElement(name);
}
}
if(!buffer.empty())
{
list->selectByValue(buffer);
}
else
{
list->selectByValue(SELECTION);
}
}
示例2: handleEvent
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
{
LLString size = userdata.asString();
S32 width, height;
sscanf(size.c_str(), "%d,%d", &width, &height);
LLViewerWindow::movieSize(width, height);
return true;
}
示例3: name
LLView* LLSpinCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory)
{
LLString name("spinner");
node->getAttributeString("name", name);
LLString label;
node->getAttributeString("label", label);
LLRect rect;
createRect(node, rect, parent, LLRect());
LLFontGL* font = LLView::selectFont(node);
F32 initial_value = 0.f;
node->getAttributeF32("initial_val", initial_value);
F32 min_value = 0.f;
node->getAttributeF32("min_val", min_value);
F32 max_value = 1.f;
node->getAttributeF32("max_val", max_value);
F32 increment = 0.1f;
node->getAttributeF32("increment", increment);
U32 precision = 3;
node->getAttributeU32("decimal_digits", precision);
S32 label_width = llmin(40, rect.getWidth() - 40);
node->getAttributeS32("label_width", label_width);
LLUICtrlCallback callback = NULL;
if(label.empty())
{
label.assign( node->getValue() );
}
LLSpinCtrl* spinner = new LLSpinCtrl(name,
rect,
label,
font,
callback,
NULL,
initial_value,
min_value,
max_value,
increment,
"",
label_width);
spinner->setPrecision(precision);
spinner->initFromXML(node, parent);
return spinner;
}
示例4: childGetValue
// virtual
void LLPanelDirPlaces::performQuery()
{
LLString name = childGetValue("name").asString();
if (name.length() < mMinSearchChars)
{
return;
}
LLString catstring = childGetValue("Category").asString();
// Because LLParcel::C_ANY is -1, must do special check
S32 category = 0;
if (catstring == "any")
{
category = LLParcel::C_ANY;
}
else
{
category = LLParcel::getCategoryFromString(catstring.c_str());
}
U32 flags = 0x0;
bool adult_enabled = gAgent.canAccessAdult();
bool mature_enabled = gAgent.canAccessMature();
if (gSavedSettings.getBOOL("ShowPGSims") ||
(!adult_enabled && !mature_enabled)) // if they can't have either of the others checked, force this one true
{
flags |= DFQ_INC_PG;
}
if( gSavedSettings.getBOOL("ShowMatureSims") && mature_enabled)
{
flags |= DFQ_INC_MATURE;
}
if( gSavedSettings.getBOOL("ShowAdultSims") && adult_enabled)
{
flags |= DFQ_INC_ADULT;
}
// Pack old query flag in case we are talking to an old server
if ( ((flags & DFQ_INC_PG) == DFQ_INC_PG) && !((flags & DFQ_INC_MATURE) == DFQ_INC_MATURE) )
{
flags |= DFQ_PG_PARCELS_ONLY;
}
if (0x0 == flags)
{
LLNotifyBox::showXml("NoContentToSearch");
return;
}
queryCore(name, category, flags);
}
示例5: get_warn_name
static LLString get_warn_name(const LLString& name)
{
LLString warnname = "Warn" + name;
for (LLString::iterator iter = warnname.begin(); iter != warnname.end(); ++iter)
{
char c = *iter;
if (!isalnum(c))
{
*iter = '_';
}
}
return warnname;
}
示例6: m1
LLXMLNode *LLInventoryItem::exportFileXML(BOOL include_asset_key) const
{
LLMemType m1(LLMemType::MTYPE_INVENTORY);
LLXMLNode *ret = new LLXMLNode("item", FALSE);
ret->createChild("uuid", TRUE)->setUUIDValue(1, &mUUID);
ret->createChild("parent_uuid", TRUE)->setUUIDValue(1, &mParentUUID);
mPermissions.exportFileXML()->setParent(ret);
// Check for permissions to see the asset id, and if so write it
// out as an asset id. Otherwise, apply our cheesy encryption.
if(include_asset_key)
{
U32 mask = mPermissions.getMaskBase();
if(((mask & PERM_ITEM_UNRESTRICTED) == PERM_ITEM_UNRESTRICTED)
|| (mAssetUUID.isNull()))
{
ret->createChild("asset_id", FALSE)->setUUIDValue(1, &mAssetUUID);
}
else
{
LLUUID shadow_id(mAssetUUID);
LLXORCipher cipher(MAGIC_ID.mData, UUID_BYTES);
cipher.encrypt(shadow_id.mData, UUID_BYTES);
ret->createChild("shadow_id", FALSE)->setUUIDValue(1, &shadow_id);
}
}
LLString type_str = LLAssetType::lookup(mType);
LLString inv_type_str = LLInventoryType::lookup(mInventoryType);
ret->createChild("asset_type", FALSE)->setStringValue(1, &type_str);
ret->createChild("inventory_type", FALSE)->setStringValue(1, &inv_type_str);
S32 tmp_flags = (S32) mFlags;
ret->createChild("flags", FALSE)->setByteValue(4, (U8*)(&tmp_flags), LLXMLNode::ENCODING_HEX);
mSaleInfo.exportFileXML()->setParent(ret);
LLString temp;
temp.assign(mName);
ret->createChild("name", FALSE)->setStringValue(1, &temp);
temp.assign(mDescription);
ret->createChild("description", FALSE)->setStringValue(1, &temp);
ret->createChild("creation_date", FALSE)->setIntValue(1, &mCreationDate);
return ret;
}
示例7: loadFile
// Reads a .tga file and creates an LLImageTGA with its data.
bool LLImageTGA::loadFile( const LLString& path )
{
S32 len = path.size();
if( len < 5 )
{
return false;
}
LLString extension = path.substr( len - 4, 4 );
LLString::toLower(extension);
if( ".tga" != extension )
{
return false;
}
FILE* file = LLFile::fopen(path.c_str(), "rb"); /* Flawfinder: ignore */
if( !file )
{
llwarns << "Couldn't open file " << path << llendl;
return false;
}
S32 file_size = 0;
if (!fseek(file, 0, SEEK_END))
{
file_size = ftell(file);
fseek(file, 0, SEEK_SET);
}
U8* buffer = allocateData(file_size);
S32 bytes_read = fread(buffer, 1, file_size, file);
if( bytes_read != file_size )
{
deleteData();
llwarns << "Couldn't read file " << path << llendl;
return false;
}
fclose( file );
if( !updateData() )
{
llwarns << "Couldn't decode file " << path << llendl;
deleteData();
return false;
}
return true;
}
示例8: startRequest
BOOL LLAsyncHostByName::startRequest( const LLString& domain_name, LLAsyncHostByNameCallback callback, void* userdata )
{
if( isPendingRequest() )
{
llwarns << "LLAsyncHostByName::startRequest() cancelled existing request." << llendl;
cancelPendingRequest();
}
mCallback = callback;
mUserdata = userdata;
memset(mOutputBuffer, 0, sizeof( mOutputBuffer ) );
mDomainName = domain_name;
mRequestHandle = WSAAsyncGetHostByName(
(HWND)gViewerWindow->getPlatformWindow(),
LL_WM_HOST_RESOLVED,
domain_name.c_str(),
mOutputBuffer,
sizeof( mOutputBuffer ) );
if( !mRequestHandle )
{
llwarns << "LLAsyncHostByName::startRequest() failed: " << WSAGetLastError() << llendl;
return FALSE;
}
return TRUE;
}
示例9: locale
void LLSpinCtrl::updateEditor()
{
LLLocale locale(LLLocale::USER_LOCALE);
// Don't display very small negative values as -0.000
F32 displayed_value = clamp_precision((F32)getValue().asReal(), mPrecision);
// if( S32( displayed_value * pow( 10, mPrecision ) ) == 0 )
// {
// displayed_value = 0.f;
// }
LLString format = llformat("%%.%df", mPrecision);
LLString text = llformat(format.c_str(), displayed_value);
mEditor->setText( text );
}
示例10:
LLSpeaker::LLSpeaker(const LLUUID& id, const LLString& name, const ESpeakerType type) :
mStatus(LLSpeaker::STATUS_TEXT_ONLY),
mLastSpokeTime(0.f),
mSpeechVolume(0.f),
mHasSpoken(FALSE),
mDotColor(LLColor4::white),
mID(id),
mTyping(FALSE),
mSortIndex(0),
mType(type),
mIsModerator(FALSE),
mModeratorMutedVoice(FALSE),
mModeratorMutedText(FALSE)
{
mHandle.init();
sSpeakers.insert(std::make_pair(mHandle, this));
if (name.empty() && type == SPEAKER_AGENT)
{
lookupName();
}
else
{
mDisplayName = name;
}
gVoiceClient->setUserVolume(id, gMuteListp->getSavedResidentVolume(id));
mActivityTimer.resetWithExpiry(SPEAKER_TIMEOUT);
}
示例11: find_avatar
void LLFloaterAvatarTextures::refresh()
{
LLVOAvatar *avatarp = find_avatar(mID);
if (avatarp)
{
char firstname[DB_FIRST_NAME_BUF_SIZE]; /*Flawfinder: ignore*/
char lastname[DB_LAST_NAME_BUF_SIZE]; /*Flawfinder: ignore*/
if (gCacheName->getName(avatarp->getID(), firstname, lastname))
{
LLString name;
name.assign( firstname );
name.append( " " );
name.append( lastname );
setTitle(mTitle + ": " + name);
}
update_texture_ctrl(avatarp, mBakedHead, LLVOAvatar::TEX_HEAD_BAKED);
update_texture_ctrl(avatarp, mBakedEyes, LLVOAvatar::TEX_EYES_BAKED);
update_texture_ctrl(avatarp, mBakedUpper, LLVOAvatar::TEX_UPPER_BAKED);
update_texture_ctrl(avatarp, mBakedLower, LLVOAvatar::TEX_LOWER_BAKED);
update_texture_ctrl(avatarp, mBakedSkirt, LLVOAvatar::TEX_SKIRT_BAKED);
update_texture_ctrl(avatarp, mMakeup, LLVOAvatar::TEX_HEAD_BODYPAINT);
update_texture_ctrl(avatarp, mHair, LLVOAvatar::TEX_HAIR);
update_texture_ctrl(avatarp, mEye, LLVOAvatar::TEX_EYES_IRIS);
update_texture_ctrl(avatarp, mShirt, LLVOAvatar::TEX_UPPER_SHIRT);
update_texture_ctrl(avatarp, mUpperTattoo, LLVOAvatar::TEX_UPPER_BODYPAINT);
update_texture_ctrl(avatarp, mUpperJacket, LLVOAvatar::TEX_UPPER_JACKET);
update_texture_ctrl(avatarp, mGloves, LLVOAvatar::TEX_UPPER_GLOVES);
update_texture_ctrl(avatarp, mUndershirt, LLVOAvatar::TEX_UPPER_UNDERSHIRT);
update_texture_ctrl(avatarp, mPants, LLVOAvatar::TEX_LOWER_PANTS);
update_texture_ctrl(avatarp, mLowerTattoo, LLVOAvatar::TEX_LOWER_BODYPAINT);
update_texture_ctrl(avatarp, mShoes, LLVOAvatar::TEX_LOWER_SHOES);
update_texture_ctrl(avatarp, mSocks, LLVOAvatar::TEX_LOWER_SOCKS);
update_texture_ctrl(avatarp, mJacket, LLVOAvatar::TEX_LOWER_JACKET);
update_texture_ctrl(avatarp, mUnderpants, LLVOAvatar::TEX_LOWER_UNDERPANTS);
update_texture_ctrl(avatarp, mSkirt, LLVOAvatar::TEX_SKIRT);
}
else
{
setTitle(mTitle + ": INVALID AVATAR (" + mID.asString() + ")");
}
}
示例12: llassert
void LLSpinCtrl::onEditorCommit( LLUICtrl* caller, void *userdata )
{
BOOL success = FALSE;
LLSpinCtrl* self = (LLSpinCtrl*) userdata;
llassert( caller == self->mEditor );
LLString text = self->mEditor->getText();
if( LLLineEditor::postvalidateFloat( text ) )
{
LLLocale locale(LLLocale::USER_LOCALE);
F32 val = (F32) atof(text.c_str());
if (val < self->mMinValue) val = self->mMinValue;
if (val > self->mMaxValue) val = self->mMaxValue;
if( self->mValidateCallback )
{
F32 saved_val = self->mValue;
self->mValue = val;
if( self->mValidateCallback( self, self->mCallbackUserData ) )
{
success = TRUE;
self->onCommit();
}
else
{
self->mValue = saved_val;
}
}
else
{
self->mValue = val;
self->onCommit();
success = TRUE;
}
}
self->updateEditor();
if( !success )
{
self->reportInvalidData();
}
}
示例13: requestFriendship
// static
void LLFloaterFriends::requestFriendship(const LLUUID& target_id, const LLString& target_name)
{
// HACK: folder id stored as "message"
LLUUID calling_card_folder_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_CALLINGCARD);
std::string message = calling_card_folder_id.asString();
send_improved_im(target_id,
target_name.c_str(),
message.c_str(),
IM_ONLINE,
IM_FRIENDSHIP_OFFERED);
}
示例14: setImageOverlay
void LLButton::setImageOverlay(const LLString &image_name, LLFontGL::HAlign alignment, const LLColor4& color)
{
if (image_name.empty())
{
mImageOverlay = NULL;
}
else
{
mImageOverlay = LLUI::getUIImageByName(image_name);
mImageOverlayAlignment = alignment;
mImageOverlayColor = color;
}
}
示例15: addImageAttributeToXML
void LLButton::addImageAttributeToXML(LLXMLNodePtr node,
const LLString& image_name,
const LLUUID& image_id,
const LLString& xml_tag_name) const
{
if( !image_name.empty() )
{
node->createChild(xml_tag_name, TRUE)->setStringValue(image_name);
}
else if( image_id != LLUUID::null )
{
node->createChild(xml_tag_name + "_id", TRUE)->setUUIDValue(image_id);
}
}