Beispiel #1
0
void writeStrAttribute(H5::Group &location, const std::string &name,
                       const std::string &value) {
  StrType attrType(0, H5T_VARIABLE);
  DataSpace attrSpace(H5S_SCALAR);
  auto groupAttr = location.createAttribute(name, attrType, attrSpace);
  groupAttr.write(attrType, value);
}
Beispiel #2
0
void CBookmarksView::OpenAttribute(std::_tstring line, int column, std::_tstring module, std::_tstring attribute, std::_tstring attributeType)
{
    std::_tstring attrType(attributeType);
    IAttributeType *type = CreateIAttributeType(attrType);

    int row = boost::lexical_cast<int>(line);
    std::wstring m(module);
    std::wstring a(attribute);

    GetIMainFrame()->OpenAttribute(m, a, type, row, column);
}
XSDOper *XSDOperationFactory::getBaseRef()
{
    XSDOper *oper = new XSDOper();
    addAnnotation(oper);
    QPair<QString, QString> attrName(IO_ELEMENT_ATTR_NAME, XSDOperationParameters::TokenName);
    oper->attributesToAdd << attrName;
    QPair<QString, QString> attrType(IO_ELEMENT_ATTR_TYPE, XSDOperationParameters::TokenType);
    oper->attributesToAdd << attrType;
    oper->attributesToRemove << IO_ELEMENT_ATTR_REF;
    return oper;
}
// -----------------------------------------------------------------------------
// CNATFWUNSAFMessageFactory::DecodeL
// Mandatory UNSAF attributes must be understood. Optional attributes are
// ignored when not understood.
// -----------------------------------------------------------------------------
//
EXPORT_C CNATFWUNSAFMessage* CNATFWUNSAFMessageFactory::DecodeL(
    const TDesC8& aNATFWUNSAFMessage) const
    {
    __TEST_INVARIANT;

    CNATFWUNSAFMessage* msg = DecodeHeaderLC(aNATFWUNSAFMessage);

    NATFWUNSAF_BYTESTREAMLOG("CNATFWUNSAFMessageFactory::DecodeL data",
        aNATFWUNSAFMessage);

    TInt msgLengthExcludingHeader = MessageLength(aNATFWUNSAFMessage);
    TInt pos(0);

    while (pos < msgLengthExcludingHeader)
        {
        TPtrC8 msgBody = aNATFWUNSAFMessage.Mid(
            CNATFWUNSAFMessage::EHeaderSize + pos);

        //Can't use the enum, as attribute type could have an unrecognized
        //value
        TUint16 attrType(0);
        TUint16 attrTotalLength(0); //includes type, length, value

        CNATFWUNSAFAttribute::ParseTypeAndLengthL(msgBody, attrType,
            attrTotalLength);
        TDecodeFnPtr decodeFn = iAttributeLookupTable->Find(attrType);

        if (decodeFn)
            {
            //After detecting this is a known attribute, check it is allowed to
            //be present in this msgType, if not, ignore it w/o decoding.
            if (msg->IsAllowed(attrType))
                {
                CNATFWUNSAFAttribute* attr = (*decodeFn)(msgBody);
                CleanupStack::PushL(attr);
                msg->AddAttributeL(attr);
                CleanupStack::Pop(attr);
                }
            }
        else
            {
            if (CNATFWUNSAFAttribute::IsMandatory(attrType))
                {
                msg->UnknownMandatoryAttributeFound();
                }
            }

        pos += attrTotalLength;
        }

    CleanupStack::Pop(msg);
    return msg;
    }
Beispiel #5
0
std::string AAttribute::attrTypeStr() const
{
	std::string r("unknown");
	switch (attrType()) {
		case aNumeric:
			r = "numeric";
			break;
		case aEnum:
			r = "enum";
			break;
		case aString:
			r = "string";
			break;
		case aCompound:
			r = "compound";
			break;
		default:
			break;
	}
	return r;
}
void AstAttrOf::dump(ostream& str) {
    this->AstNode::dump(str);
    str<<" ["<<attrType().ascii()<<"]";
}
Beispiel #7
0
bool AAttribute::isCompound() const
{ return attrType() == aCompound; }
Beispiel #8
0
bool AAttribute::isString() const
{ return attrType() == aString; }
Beispiel #9
0
bool AAttribute::isEnum() const
{ return attrType() == aEnum; }
Beispiel #10
0
bool AAttribute::isNumeric() const
{ return attrType() == aNumeric; }