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

C++ GetAttributes函数代码示例

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

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



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

示例1: main

int 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,代码来源:ansitest.c


示例2: EntityExists

static 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,代码来源:MFile.cpp


示例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,代码来源:Boomerang.cpp


示例4: GetAttributes

bool 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,代码来源:GAAbilityBase.cpp


示例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,代码来源:TaeAttrib.cpp


示例6: GetAttributes

bool 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,代码来源:xml.cpp


示例7: GetAttributes

bool 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,代码来源:richtextbackgroundpage.cpp


示例8: IsHidden

VError 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,代码来源:XWinFolder.cpp


示例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,代码来源:VertexBuffer.cpp


示例10: GetAttributes

bool 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,代码来源:richtextbackgroundpage.cpp


示例11: GetAttributes

void 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,代码来源:Context.cpp


示例12: GetAttributes

bool 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,代码来源:EC_DynamicComponent.cpp


示例13: TransferDataFromWindow

bool 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,代码来源:richtextmarginspage.cpp


示例14: GetAttribute

///////////////////////////////////////////////////////////////////////////////
// finden eines Attributes einer Objektklasse
HRESULT 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,代码来源:ArcViewAttribute.cpp


示例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,代码来源:MatrixFactory.cpp


示例16: main

// Main
int 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,代码来源:xml.c


示例17: wxCHECK_MSG

bool 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,代码来源:xml.cpp


示例18: GetAttributes

/// Transfer data from/to window
bool 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,代码来源:richtexttabspage.cpp


示例19: GetAttributes

std::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,代码来源:Observation.cpp


示例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,代码来源:epos_cposmodulessettings.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ GetAuctionOutBid函数代码示例发布时间:2022-05-30
下一篇:
C++ GetAttackerTeam函数代码示例发布时间: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