这篇教程C++ GetAttributes函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中GetAttributes函数的典型用法代码示例。如果您正苦于以下问题:C++ GetAttributes函数的具体用法?C++ GetAttributes怎么用?C++ GetAttributes使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了GetAttributes函数的25个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: mainint main(void){ Attributes attr; WORD result; printf("/f/t/tANSI Terminal Emulation Test/n"); printf( "/t/t============================/n/n/n"); setvbuf(stdin, NULL, _IONBF, 0); if ((result = GetAttributes(Heliosno(stdout), &attr)) < 0) { printf("Failed to get stdout attributes : %lx. Exiting./n", result); exit((int)result); } printf("Window size : %d rows, %d columns./n/n", attr.Min, attr.Time); rows = attr.Min; cols = attr.Time; AddAttribute(&attr, ConsoleRawOutput); RemoveAttribute(&attr, ConsolePause); RemoveAttribute(&attr, ConsoleEcho); if ((result = SetAttributes(Heliosno(stdout), &attr)) < 0) { printf("Failed to set stdout attributes : %lx. Exiting./n", result); exit((int)result); } if ((result = GetAttributes(Heliosno(stdin), &attr)) < 0) { printf("Failed to get stdin attributes : %lx. Exiting./n", result); exit((int)result); } AddAttribute(&attr, ConsoleRawInput); RemoveAttribute(&attr, ConsolePause); RemoveAttribute(&attr, ConsoleEcho); if ((result = SetAttributes(Heliosno(stdin), &attr)) < 0) { printf("Failed to set stdin attributes : %lx. Exiting./n", result); exit((int) result); } wait_for_user(); main_menu(); printf("/r/n/n/n");}
开发者ID:axelmuhr,项目名称:Helios-NG,代码行数:42,
示例2: EntityExistsstatic bool EntityExists(const char* Path, u32 SubdirValue){ if (!Exists(Path)) return false; auto MaybeAttributes = GetAttributes(Path); if (!MaybeAttributes.has_value()) return false; return (MaybeAttributes.value().Attributes & Attributes::Subdir) == SubdirValue;}
开发者ID:Asunaya,项目名称:RefinedGunz,代码行数:11,
示例3: BasicTool BasicTool( N_BOOMERANG, fBasicSpeed, pfLocationRatio, fHeadingInDegrees, pfDimensions, pRasterGraphicName, deviceResources){ if (pRasterGraphicName != nullptr) // Raster graphics { m_pRenderable = new RasterGraphic(pRasterGraphicName, deviceResources);#ifdef SHOW_RAW_MASK_ZONES m_pRawMask = new VirtualMask(MaskTemplateRepository::GetInstance()->Get(pRasterGraphicName));#endif // SHOW_RAW_MASK_ZONES m_pActualMask = new VirtualMask(MaskTemplateRepository::GetInstance()->Get(pRasterGraphicName)); } list<int> listAttributes; // A_LOCATION is part of Space. listAttributes.push_back(A_STRENGTH); listAttributes.push_back(A_BEING); listAttributes.push_back(A_ROTATION); m_pAttributes->AddAttributes(&listAttributes); int nStrength = 5; GetAttributes()->Modify(A_STRENGTH, A_STRENGTH_VALUE, &nStrength); bool bState = true; GetAttributes()->Modify(A_BEING, A_BEING_VALUE, &bState); float fRotation = 0.f; GetAttributes()->Modify(A_ROTATION, A_ROTATION_VALUE, &fRotation); m_nState = BOOMERANG_AWAY; m_fAngle_degrees = 0.0f;}
开发者ID:orchidwarestudios,项目名称:orchis-isle-uwp,代码行数:41,
示例4: GetAttributesbool UGAAbilityBase::CheckAbilityAttributeCost(){ for (int32 Idx = 0; Idx < AbilityAttributeCost.Num(); Idx++) { float ModValue = AbilityAttributeCost[Idx].GetSpecData()->AtributeModifier.Magnitude.GetFloatValue(DefaultContext); FGAAttribute Attribute = AbilityAttributeCost[Idx].GetSpecData()->AtributeModifier.Attribute; float AttributeVal = GetAttributes()->GetFloatValue(Attribute); if (ModValue > AttributeVal) return false; } return true;}
开发者ID:iniside,项目名称:ActionRPGGame,代码行数:12,
示例5: GetAttributes//---------------------------------------------------------------------------// get the style attributes of the first character of the text//TFontStyles __fastcall TTaeTextAttributes::GetStyle(void){ TCharFormat Format; TFontStyles Result; GetAttributes(Format); if (Format.dwEffects & CFE_BOLD) Result = Result << fsBold; if (Format.dwEffects & CFE_ITALIC) Result = Result << fsItalic; if (Format.dwEffects & CFE_UNDERLINE) Result = Result << fsUnderline; if (Format.dwEffects & CFE_STRIKEOUT) Result = Result << fsStrikeOut; return Result;}
开发者ID:dxzl,项目名称:tae-richedit,代码行数:15,
示例6: GetAttributesbool wxXmlNode::HasAttribute(const wxString& attrName) const{ wxXmlAttribute *attr = GetAttributes(); while (attr) { if (attr->GetName() == attrName) return true; attr = attr->GetNext(); } return false;}
开发者ID:EEmmanuel7,项目名称:wxWidgets,代码行数:12,
示例7: GetAttributesbool wxRichTextBackgroundPage::TransferDataToWindow(){ wxRichTextAttr* attr = GetAttributes(); if (!attr->HasBackgroundColour()) { m_backgroundColourCheckBox->SetValue(false); m_backgroundColourSwatch->SetColour(*wxWHITE); } else { m_backgroundColourCheckBox->SetValue(true); m_backgroundColourSwatch->SetColour(attr->GetBackgroundColour()); } m_useShadow->SetValue(attr->GetTextBoxAttr().GetShadow().IsValid()); wxArrayInt units; units.Add(wxTEXT_ATTR_UNITS_PIXELS); units.Add(wxTEXT_ATTR_UNITS_TENTHS_MM); units.Add(wxTEXT_ATTR_UNITS_HUNDREDTHS_POINT); wxArrayInt percentUnits; percentUnits.Add(wxTEXT_ATTR_UNITS_PERCENTAGE); if (!attr->GetTextBoxAttr().GetShadow().GetOffsetX().IsValid()) attr->GetTextBoxAttr().GetShadow().GetOffsetX().SetValue(0, wxTEXT_ATTR_UNITS_PIXELS); if (!attr->GetTextBoxAttr().GetShadow().GetOffsetY().IsValid()) attr->GetTextBoxAttr().GetShadow().GetOffsetY().SetValue(0, wxTEXT_ATTR_UNITS_PIXELS); wxRichTextFormattingDialog::SetDimensionValue(attr->GetTextBoxAttr().GetShadow().GetOffsetX(), m_offsetX, m_unitsHorizontalOffset, NULL, & units); wxRichTextFormattingDialog::SetDimensionValue(attr->GetTextBoxAttr().GetShadow().GetOffsetY(), m_offsetY, m_unitsVerticalOffset, NULL, & units); wxRichTextFormattingDialog::SetDimensionValue(attr->GetTextBoxAttr().GetShadow().GetSpread(), m_spread, m_unitsShadowSpread, m_useShadowSpread, & units); wxRichTextFormattingDialog::SetDimensionValue(attr->GetTextBoxAttr().GetShadow().GetBlurDistance(), m_blurDistance, m_unitsBlurDistance, m_useBlurDistance, & units); wxRichTextFormattingDialog::SetDimensionValue(attr->GetTextBoxAttr().GetShadow().GetOpacity(), m_opacity, NULL, m_useShadowOpacity, & percentUnits); if (!attr->GetTextBoxAttr().GetShadow().HasColour() || !attr->GetTextBoxAttr().GetShadow().IsValid()) { m_shadowColourCheckBox->SetValue(false); m_shadowColourSwatch->SetColour(*wxWHITE); } else { m_shadowColourCheckBox->SetValue(true); m_shadowColourSwatch->SetColour(attr->GetTextBoxAttr().GetShadow().GetColour()); } return true;}
开发者ID:AaronDP,项目名称:wxWidgets,代码行数:53,
示例8: IsHiddenVError XWinFolder::IsHidden(bool &outIsHidden){ VError err; DWORD outAttrb; err=GetAttributes(&outAttrb); if(err==VE_OK) { outIsHidden= (outAttrb & FILE_ATTRIBUTE_HIDDEN) == FILE_ATTRIBUTE_HIDDEN; } return err;}
开发者ID:sanyaade-mobiledev,项目名称:core-XToolbox,代码行数:12,
示例9: GetAttributes int VertexBuffer::GetVertexSize() { vector<VertexAttribute> attribs = GetAttributes(); int total_size = 0; for(unsigned int i = 0; i < attribs.size(); ++i) { VertexAttribute attrib = attribs[i]; if(attrib.type == Float) total_size += sizeof(float) * attrib.n_per_vertex; } return total_size; }
开发者ID:alubitz,项目名称:cibraryengine,代码行数:14,
示例10: GetAttributesbool wxRichTextBackgroundPage::TransferDataFromWindow(){ wxRichTextAttr* attr = GetAttributes(); if (m_backgroundColourCheckBox->GetValue()) { attr->SetBackgroundColour(m_backgroundColourSwatch->GetColour()); } else { attr->SetFlags(attr->GetFlags() & ~wxTEXT_ATTR_BACKGROUND_COLOUR); } return true;}
开发者ID:beanhome,项目名称:dev,代码行数:14,
示例11: GetAttributesvoid Context::CopyBaseAttributes(StringHash baseType, StringHash derivedType){ const Vector<AttributeInfo>* baseAttributes = GetAttributes(baseType); if (baseAttributes) { for (unsigned i = 0; i < baseAttributes->Size(); ++i) { const AttributeInfo& attr = baseAttributes->At(i); attributes_[derivedType].Push(attr); if (attr.mode_ & AM_NET) networkAttributes_[derivedType].Push(attr); } }}
开发者ID:janfrost,项目名称:Urho3D,代码行数:14,
示例12: GetAttributesbool EC_DynamicComponent::ContainSameAttributes(const EC_DynamicComponent &comp) const{ AttributeVector myAttributeVector = GetAttributes(); AttributeVector attributeVector = comp.GetAttributes(); if(attributeVector.size() != myAttributeVector.size()) return false; if(attributeVector.empty() && myAttributeVector.empty()) return true; std::sort(myAttributeVector.begin(), myAttributeVector.end(), &CmpAttributeByName); std::sort(attributeVector.begin(), attributeVector.end(), &CmpAttributeByName); AttributeVector::const_iterator iter1 = myAttributeVector.begin(); AttributeVector::const_iterator iter2 = attributeVector.begin(); while(iter1 != myAttributeVector.end() && iter2 != attributeVector.end()) { // Compare attribute names and type and if they mach continue iteration if not components aren't exactly the same. if((*iter1)->GetNameString() == (*iter2)->GetNameString() && (*iter1)->TypeName() == (*iter2)->TypeName()) { if(iter1 != myAttributeVector.end()) iter1++; if(iter2 != attributeVector.end()) iter2++; } else { return false; } } return true; /*// Get both attributes and check if they are holding exact number of attributes. AttributeVector myAttributeVector = GetAttributes(); AttributeVector attributeVector = comp.GetAttributes(); if(attributeVector.size() != myAttributeVector.size()) return false; // Compare that every attribute is same in both components. QSet<IAttribute*> myAttributeSet; QSet<IAttribute*> attributeSet; for(uint i = 0; i < myAttributeSet.size(); i++) { attributeSet.insert(myAttributeVector[i]); myAttributeSet.insert(attributeVector[i]); } if(attributeSet != myAttributeSet) return false; return true;*/}
开发者ID:A-K,项目名称:naali,代码行数:50,
示例13: TransferDataFromWindowbool wxRichTextMarginsPage::TransferDataFromWindow(){ // Margins wxRichTextFormattingDialog::GetDimensionValue(GetAttributes()->GetTextBoxAttr().GetMargins().GetLeft(), m_marginLeft, m_unitsMarginLeft, m_leftMarginCheckbox); wxRichTextFormattingDialog::GetDimensionValue(GetAttributes()->GetTextBoxAttr().GetMargins().GetTop(), m_marginTop, m_unitsMarginTop, m_topMarginCheckbox); wxRichTextFormattingDialog::GetDimensionValue(GetAttributes()->GetTextBoxAttr().GetMargins().GetRight(), m_marginRight, m_unitsMarginRight, m_rightMarginCheckbox); wxRichTextFormattingDialog::GetDimensionValue(GetAttributes()->GetTextBoxAttr().GetMargins().GetBottom(), m_marginBottom, m_unitsMarginBottom, m_bottomMarginCheckbox); // Padding wxRichTextFormattingDialog::GetDimensionValue(GetAttributes()->GetTextBoxAttr().GetPadding().GetLeft(), m_paddingLeft, m_unitsPaddingLeft, m_leftPaddingCheckbox); wxRichTextFormattingDialog::GetDimensionValue(GetAttributes()->GetTextBoxAttr().GetPadding().GetTop(), m_paddingTop, m_unitsPaddingTop, m_topPaddingCheckbox); wxRichTextFormattingDialog::GetDimensionValue(GetAttributes()->GetTextBoxAttr().GetPadding().GetRight(), m_paddingRight, m_unitsPaddingRight, m_rightPaddingCheckbox); wxRichTextFormattingDialog::GetDimensionValue(GetAttributes()->GetTextBoxAttr().GetPadding().GetBottom(), m_paddingBottom, m_unitsPaddingBottom, m_bottomPaddingCheckbox); return true;}
开发者ID:idobatter,项目名称:wxWidgets,代码行数:16,
示例14: GetAttribute///////////////////////////////////////////////////////////////////////////////// finden eines Attributes einer ObjektklasseHRESULT CArcViewAttributes::GetAttribute (INT_PTR lIdent, INT_PTR lMCode, os_string *pAttrName){CArcViewLayerAttributes *pAttrMap = NULL; if (S_OK == GetAttributes (lIdent, &pAttrMap)) { CArcViewLayerAttributes::iterator it = pAttrMap -> find (lMCode); if (it != pAttrMap -> end()) { if (NULL != pAttrName) *pAttrName = (*it).second.GetName(); return S_OK; } } return S_FALSE;}
开发者ID:hkaiser,项目名称:TRiAS,代码行数:17,
示例15: matHandle/* @method CreateSparse @discussion Create a SparseMatrix, based on the XML attributes. The object is returned by value. @throws KII_invalid_argument @param matElement pointer to Matrix XML element @result The SparseMatrix object.*/SparseMatrix MatrixFactory::CreateSparse(TiXmlElement* matElement){ string type; string init; int rows, columns; FLOAT multiplier; TiXmlHandle matHandle(matElement); GetAttributes(matElement, type, init, rows, columns, multiplier);#ifdef MDEBUG cerr << "Creating SparseMatrix with attributes: " << type << ", " << init << ", " << rows << "X" << columns << ", " << multiplier << endl;#endif if (type == "diag") { if (init == "none") { // a string of values is present & passed TiXmlText* valuesNode = matHandle.FirstChild().Text(); if (valuesNode == NULL) throw KII_invalid_argument("Contents not specified for Sparese Matrix with init='none'."); const char* values = valuesNode->Value();#ifdef MDEBUG cerr << "/tData present for initialization: " << values << endl;#endif return SparseMatrix(rows, columns, multiplier, values); } else if (init == "const") { // No string of values or XML row data if (multiplier == 0.0) return SparseMatrix(rows, columns); else throw KII_invalid_argument("A sparse matrix can only be initialized to zero with const XML init"); } else throw KII_invalid_argument("Invalid init for sparse matrix"); } else if (type == "sparse") { if (init == "none") // a sequence of row data nodes is present & passed return SparseMatrix(rows, columns, multiplier, matElement); else if (init == "const") { // No row data if (multiplier == 0.0) return SparseMatrix(rows, columns); else throw KII_invalid_argument("A sparse matrix can only be initialized to zero with const XML init"); } else throw KII_invalid_argument("A sparse matrix can only be initialized to zero with const XML init"); } // If we get here, then something is really wrong throw KII_invalid_argument("Invalid type specified for sparse matrix.");}
开发者ID:Seanb19,项目名称:BrainGrid,代码行数:56,
示例16: main// Mainint main () { char opentag[MAX_BUF]; Init(); // get the first tag name manually Match('<'); strncpy(opentag, tag(), MAX_BUF); GetAttributes(); if (Look == '/'){ Match('/'); Match('>'); } else { Match('>'); xml(opentag); }}
开发者ID:BuckRogers1965,项目名称:Examples,代码行数:19,
示例17: wxCHECK_MSGbool wxXmlNode::GetAttribute(const wxString& attrName, wxString *value) const{ wxCHECK_MSG( value, false, "value argument must not be NULL" ); wxXmlAttribute *attr = GetAttributes(); while (attr) { if (attr->GetName() == attrName) { *value = attr->GetValue(); return true; } attr = attr->GetNext(); } return false;}
开发者ID:EEmmanuel7,项目名称:wxWidgets,代码行数:18,
示例18: GetAttributes/// Transfer data from/to windowbool wxRichTextTabsPage::TransferDataFromWindow(){ wxPanel::TransferDataFromWindow(); wxRichTextAttr* attr = GetAttributes(); if (m_tabsPresent) { wxArrayInt tabs; size_t i; for (i = 0; i < m_tabListCtrl->GetCount(); i++) { tabs.Add(wxAtoi(m_tabListCtrl->GetString(i))); } attr->SetTabs(tabs); } return true;}
开发者ID:AaronDP,项目名称:wxWidgets,代码行数:19,
示例19: GetAttributesstd::vector<int>* Observation::GetCollidingAttributes(Observation *t_observation){ std::vector<int>* returnedValue; int observationCount = GetAttributes().size(); if (observationCount != t_observation->GetAttributes().size()) return returnedValue; //sprawdzenie decyzji if ((this->GetAttributes())[observationCount - 1] == (t_observation->GetAttributes())[observationCount - 1]) return returnedValue; for (int i = 0; i < observationCount; i++) { if ((this->GetAttributes())[i] == (t_observation->GetAttributes())[i]) returnedValue->push_back(i); } return returnedValue;}
开发者ID:Wilczek770,项目名称:SI01_cpp,代码行数:19,
示例20: GetAttributes// ---------------------------------------------------------------------------// ---------------------------------------------------------------------------//void CPosModulesSettings::CopyAttributesL( const CPosModulesSettings& aSource ) { CPosModuleIdList* list = aSource.GetInstalledListLC(); for (int i = 0; i < list->Count(); ++i) { TUid moduleId = (*list)[i]; TPosModuleAttributes attrSource, attrTarget; aSource.GetAttributes( moduleId, attrSource ); TInt err = GetAttributes( moduleId, attrTarget ); if ( !err ) { attrTarget.iAvailable = attrSource.iAvailable; attrTarget.iCost = attrSource.iCost; // visibility not copied SetAttributesL( moduleId, attrTarget ); } } CleanupStack::PopAndDestroy( list ); }
开发者ID:kuailexs,项目名称:symbiandump-os1,代码行数:22,
示例21: TItemPosvoid CItem::UpdatePacket(){ if (!m_pOwner || !m_pOwner->GetDesc()) return; TPacketGCItemUpdate pack; pack.header = HEADER_GC_ITEM_UPDATE; pack.Cell = TItemPos(GetWindow(), m_wCell); pack.count = m_dwCount; for (int i = 0; i < ITEM_SOCKET_MAX_NUM; ++i) pack.alSockets[i] = m_alSockets[i]; thecore_memcpy(pack.aAttr, GetAttributes(), sizeof(pack.aAttr)); sys_log(2, "UpdatePacket %s -> %s", GetName(), m_pOwner->GetName()); m_pOwner->GetDesc()->Packet(&pack, sizeof(pack));}
开发者ID:ronniwe,项目名称:Varios,代码行数:19,
示例22: URHO3D_LOGWARNINGvoid Context::CopyBaseAttributes(StringHash baseType, StringHash derivedType){ // Prevent endless loop if mistakenly copying attributes from same class as derived if (baseType == derivedType) { URHO3D_LOGWARNING("Attempt to copy base attributes to itself for class " + GetTypeName(baseType)); return; } const Vector<AttributeInfo>* baseAttributes = GetAttributes(baseType); if (baseAttributes) { for (unsigned i = 0; i < baseAttributes->Size(); ++i) { const AttributeInfo& attr = baseAttributes->At(i); attributes_[derivedType].Push(attr); if (attr.mode_ & AM_NET) networkAttributes_[derivedType].Push(attr); } }}
开发者ID:FeodorFitsner,项目名称:Urho3D,代码行数:21,
示例23: GetInstalledListLC// ---------------------------------------------------------------------------// ---------------------------------------------------------------------------//void CPosModulesSettings::SearchNewOldOrChangedL( const CPosModulesSettings& aOldSettings, RArray<TPosModulesEvent>& aEvents ) const { CPosModuleIdList* currentList = GetInstalledListLC(); CPosModuleIdList* oldList = aOldSettings.GetInstalledListLC(); // Search removed for ( TInt i = 0; i < oldList->Count(); i++ ) { TPositionModuleId id = (*oldList)[i]; if ( currentList->Find( id ) == KErrNotFound ) { AddEventL( id, EPosModulesEventModuleRemoved, aEvents ); } } // Search installed or changed for ( TInt i = 0; i < currentList->Count(); i++ ) { TPositionModuleId id = (*currentList)[i]; TPosModuleAttributes current; GetAttributes( id, current ); TPosModuleAttributes old; if ( aOldSettings.GetAttributes( id, old ) == KErrNotFound ) { AddEventL( id, EPosModulesEventModuleInstalled, aEvents ); } else { ComparePropertiesL( id, current, old, aEvents ); } } CleanupStack::PopAndDestroy( oldList ); CleanupStack::PopAndDestroy( currentList ); }
开发者ID:kuailexs,项目名称:symbiandump-os1,代码行数:43,
示例24: xml// <xml></xml>void xml (char * c) { char opentag[MAX_BUF]; // loop until we get the ending tag while (1){ if (Look!='<'){ // consume the stuff between the tags emptytag(); } else { // we found the start of a tag, consume it Match('<'); if (Look != '/') { // if we are an open tag strncpy(opentag, tag(), MAX_BUF); GetAttributes(); if (Look == '/'){ // self closing tag Match ('/'); Match ('>'); } else { // we just went in one more level // call yourself recursively // with the name of the closing tag to look for Match ('>'); xml (opentag); } } else { // else we are a closing tag Match('/'); // see if the close tag matches the open tag that was passed into the funtion. if (strcmp(c, tag())) { Expected("Matching Close Tag"); } Match('>'); return; } } }}
开发者ID:BuckRogers1965,项目名称:Examples,代码行数:41,
示例25: FormatContentsvoid XNODE::FormatContents( OUTPUTFORMATTER* out, int nestLevel ){ // output attributes first if they exist for( XATTR* attr = (XATTR*) GetAttributes(); attr; attr = (XATTR*) attr->GetNext() ) { out->Print( 0, " (%s %s)", TO_UTF8( attr->GetName() ), out->Quotew( attr->GetValue() ).c_str() ); } // we only expect to have used one of two types here: switch( GetType() ) { case wxXML_ELEMENT_NODE: // output children if they exist. for( XNODE* kid = (XNODE*) GetChildren(); kid; kid = (XNODE*) kid->GetNext() ) { if( kid->GetType() != wxXML_TEXT_NODE ) { if( kid == GetChildren() ) out->Print( 0, "/n" ); kid->Format( out, nestLevel+1 ); } else { kid->Format( out, 0 ); } } break; case wxXML_TEXT_NODE: out->Print( 0, " %s", out->Quotew( GetContent() ).c_str() ); break; default: ; // not supported }}
开发者ID:KiCad,项目名称:kicad-source-mirror,代码行数:39,
注:本文中的GetAttributes函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ GetAuctionOutBid函数代码示例 C++ GetAttackerTeam函数代码示例 |