示例#1
0
const char* STDCALL ServicePropertyValueString(ServiceProperty aProperty)
{
    // FIXME - no handling of PropertyError
    PropertyString* prop = reinterpret_cast<PropertyString*>(aProperty);
    ASSERT(prop != NULL);
    Brhz buf(prop->Value());
    return buf.Transfer();
}
示例#2
0
uint32_t STDCALL ServicePropertySetValueString(ServiceProperty aProperty, const char* aValue)
{
    PropertyString* prop = reinterpret_cast<PropertyString*>(aProperty);
    ASSERT(prop != NULL);
    Brhz val(aValue);
    if (prop->SetValue(val)) {
        return 1;
    }
    return 0;
}
void CpProxyUpnpOrgConnectionManager1C::PropertySinkProtocolInfo(Brhz& aSinkProtocolInfo) const
{
    PropertyReadLock();
    ASSERT(IsSubscribed());
    aSinkProtocolInfo.Set(iSinkProtocolInfo->Value());
    PropertyReadUnlock();
}
void CpProxyUpnpOrgConnectionManager1C::PropertyCurrentConnectionIDs(Brhz& aCurrentConnectionIDs) const
{
    PropertyReadLock();
    ASSERT(IsSubscribed());
    aCurrentConnectionIDs.Set(iCurrentConnectionIDs->Value());
    PropertyReadUnlock();
}
示例#5
0
void CpProxyAvOpenhomeOrgInfo1C::PropertyCodecName(Brhz& aCodecName) const
{
    PropertyReadLock();
    ASSERT(IsSubscribed());
    aCodecName.Set(iCodecName->Value());
    PropertyReadUnlock();
}
示例#6
0
void CpProxyAvOpenhomeOrgInfo1C::PropertyMetatext(Brhz& aMetatext) const
{
    PropertyReadLock();
    ASSERT(IsSubscribed());
    aMetatext.Set(iMetatext->Value());
    PropertyReadUnlock();
}
示例#7
0
void CpProxyAvOpenhomeOrgInfo1C::PropertyUri(Brhz& aUri) const
{
    PropertyReadLock();
    ASSERT(IsSubscribed());
    aUri.Set(iUri->Value());
    PropertyReadUnlock();
}
void CpProxyAvOpenhomeOrgSender1C::PropertyAttributes(Brhz& aAttributes) const
{
    PropertyReadLock();
    ASSERT(IsSubscribed());
    aAttributes.Set(iAttributes->Value());
    PropertyReadUnlock();
}
void CpProxyAvOpenhomeOrgSender1C::PropertyStatus(Brhz& aStatus) const
{
    PropertyReadLock();
    ASSERT(IsSubscribed());
    aStatus.Set(iStatus->Value());
    PropertyReadUnlock();
}
示例#10
0
void CpProxyAvOpenhomeOrgSender1C::PropertyMetadata(Brhz& aMetadata) const
{
    PropertyReadLock();
    ASSERT(IsSubscribed());
    aMetadata.Set(iMetadata->Value());
    PropertyReadUnlock();
}
示例#11
0
void CpProxyAvOpenhomeOrgSender1C::PropertyPresentationUrl(Brhz& aPresentationUrl) const
{
    PropertyReadLock();
    ASSERT(IsSubscribed());
    aPresentationUrl.Set(iPresentationUrl->Value());
    PropertyReadUnlock();
}
示例#12
0
bool DvProvider::SetPropertyString(PropertyString& aProperty, const Brx& aValue)
{
    if (aProperty.SetValue(aValue)) {
        TryPublishUpdate();
        return true;
    }
    return false;
}
示例#13
0
Property * Sheet::setStringProperty(CellAddress key, const std::string & value)
{
    Property * prop = props.getPropertyByName(key.toString().c_str());
    PropertyString * stringProp = freecad_dynamic_cast<PropertyString>(prop);

    if (!stringProp) {
        if (prop) {
            this->removeDynamicProperty(key.toString().c_str());
            propAddress.erase(prop);
        }
        stringProp = freecad_dynamic_cast<PropertyString>(props.addDynamicProperty("App::PropertyString", key.toString().c_str(), 0, 0, Prop_ReadOnly | Prop_Hidden | Prop_Transient));
    }

    propAddress[stringProp] = key;
    stringProp->setValue(value.c_str());

    return stringProp;
}
示例#14
0
int32_t STDCALL ServicePropertyGetValueString(ServiceProperty aProperty, const char** aData, uint32_t* aLen)
{
    PropertyString* prop = reinterpret_cast<PropertyString*>(aProperty);
    ASSERT(prop != NULL);
    int32_t err = 0;
    try {
        Brhz buf(prop->Value());
        if (buf.Bytes() == 0) {
            *aData = NULL;
            *aLen = 0;
        }
        else {
            *aLen = buf.Bytes();
            *aData = buf.Transfer();
        }
    }
    catch (PropertyError&) {
        err = -1;
    }
    return err;
}
示例#15
0
void DvProviderAvOpenhomeOrgInfo1C::GetPropertyCodecName(Brhz& aValue)
{
    aValue.Set(iPropertyCodecName->Value());
}
void DvProviderLinnCoUkCloud1C::GetPropertyPublicKey(Brhz& aValue)
{
    ASSERT(iPropertyPublicKey != NULL);
    aValue.Set(iPropertyPublicKey->Value());
}
void DvProviderLinnCoUkCloud1C::GetPropertyAssociationStatus(Brhz& aValue)
{
    ASSERT(iPropertyAssociationStatus != NULL);
    aValue.Set(iPropertyAssociationStatus->Value());
}
示例#18
0
void DvProviderUpnpOrgAVTransport1C::GetPropertyLastChange(Brhz& aValue)
{
    ASSERT(iPropertyLastChange != NULL);
    aValue.Set(iPropertyLastChange->Value());
}
void CpProxyLinnCoUkExaktInputs1C::PropertyAssociations(Brhz& aAssociations) const
{
    AutoMutex a(GetPropertyReadLock());
    CheckSubscribed();
    aAssociations.Set(iAssociations->Value());
}
    Var ForInObjectEnumerator::GetCurrentAndMoveNext(PropertyId& propertyId)
    {
        JavascriptEnumerator *pEnumerator = currentEnumerator;
        PropertyRecord const * propRecord;
        PropertyAttributes attributes = PropertyNone;

        while (true)
        {
            propertyId = Constants::NoProperty;
            currentIndex = pEnumerator->GetCurrentAndMoveNext(propertyId, &attributes);
#if ENABLE_COPYONACCESS_ARRAY
            JavascriptLibrary::CheckAndConvertCopyOnAccessNativeIntArray<Var>(currentIndex);
#endif
            if (currentIndex)
            {
                if (firstPrototype == nullptr)
                {
                    // We are calculating correct shadowing for non-enumerable properties of the child object, we will receive
                    // both enumerable and non-enumerable properties from GetCurrentAndMoveNext so we need to check before we simply
                    // return here. If this property is non-enumerable we're going to skip it.
                    if (!(attributes & PropertyEnumerable))
                    {
                        continue;
                    }

                    // There are no prototype that has enumerable properties,
                    // don't need to keep track of the propertyIds we visited.
                    return currentIndex;
                }

                // Property Id does not exist.
                if (propertyId == Constants::NoProperty)
                {
                    if (!JavascriptString::Is(currentIndex)) //This can be undefined
                    {
                        continue;
                    }
                    JavascriptString *pString = JavascriptString::FromVar(currentIndex);
                    if (VirtualTableInfo<Js::PropertyString>::HasVirtualTable(pString))
                    {
                        // If we have a property string, it is assumed that the propertyId is being
                        // kept alive with the object
                        PropertyString * propertyString = (PropertyString *)pString;
                        propertyId = propertyString->GetPropertyRecord()->GetPropertyId();
                    }
                    else
                    {
                        ScriptContext* scriptContext = pString->GetScriptContext();
                        scriptContext->GetOrAddPropertyRecord(pString->GetString(), pString->GetLength(), &propRecord);
                        propertyId = propRecord->GetPropertyId();

                        // We keep the track of what is enumerated using a bit vector of propertyID.
                        // so the propertyId can't be collected until the end of the for in enumerator
                        // Keep a list of the property string.
                        newPropertyStrings.Prepend(GetScriptContext()->GetRecycler(), propRecord);
                    }
                }

                //check for shadowed property
                if (TestAndSetEnumerated(propertyId) //checks if the property is already enumerated or not
                    && (attributes & PropertyEnumerable))
                {
                    return currentIndex;
                }
            }
            else
            {
                if (object == baseObject)
                {
                    if (firstPrototype == nullptr)
                    {
                        return NULL;
                    }
                    object = firstPrototype;
                }
                else
                {
                    //walk the prototype chain
                    object = object->GetPrototype();
                    if ((object == NULL) || (JavascriptOperators::GetTypeId(object) == TypeIds_Null))
                    {
                        return NULL;
                    }
                }

                do
                {
                    if (!GetCurrentEnumerator())
                    {
                        return nullptr;
                    }

                    pEnumerator = currentEnumerator;
                    if (!VirtualTableInfo<Js::NullEnumerator>::HasVirtualTable(pEnumerator))
                    {
                        break;
                    }

                     //walk the prototype chain
                    object = object->GetPrototype();
                    if ((object == NULL) || (JavascriptOperators::GetTypeId(object) == TypeIds_Null))
                    {
                        return NULL;
                    }
                }
                while (true);
            }
        }
    }
    JavascriptString * DynamicObjectPropertyEnumerator::MoveAndGetNextWithCache(PropertyId& propertyId, PropertyAttributes* attributes)
    {
#if ENABLE_TTD
        AssertMsg(!this->scriptContext->GetThreadContext()->IsRuntimeInTTDMode(), "We should always trap out to explicit enumeration in this case");
#endif

        Assert(enumeratedCount <= cachedData->cachedCount);
        JavascriptString* propertyStringName;
        PropertyAttributes propertyAttributes = PropertyNone;
        if (enumeratedCount < cachedData->cachedCount)
        {
            PropertyString * propertyString = cachedData->strings[enumeratedCount];
            propertyStringName = propertyString;
            propertyId = propertyString->GetPropertyId();

#if DBG
            PropertyId tempPropertyId;
            /* JavascriptString * tempPropertyString = */ this->MoveAndGetNextNoCache(tempPropertyId, attributes);

            Assert(tempPropertyId == propertyId);
            Assert(this->objectIndex == cachedData->indexes[enumeratedCount]);
#endif

            this->objectIndex = cachedData->indexes[enumeratedCount];
            propertyAttributes = cachedData->attributes[enumeratedCount];

            enumeratedCount++;
        }
        else if (!cachedData->completed)
        {
            propertyStringName = this->MoveAndGetNextNoCache(propertyId, &propertyAttributes);

            if (propertyStringName)
            {
                PropertyString* propertyString = PropertyString::TryFromVar(propertyStringName);
                if (propertyString != nullptr)
                {
                    Assert(enumeratedCount < this->initialPropertyCount);
                    cachedData->strings[enumeratedCount] = propertyString;
                    cachedData->indexes[enumeratedCount] = this->objectIndex;
                    cachedData->attributes[enumeratedCount] = propertyAttributes;
                    cachedData->cachedCount = ++enumeratedCount;
                }
            }
            else
            {
                cachedData->completed = true;
            }
        }
        else
        {
#if DBG
            PropertyId tempPropertyId;
            Assert(this->MoveAndGetNextNoCache(tempPropertyId, attributes) == nullptr);
#endif

            propertyStringName = nullptr;
        }

        if (attributes != nullptr)
        {
            *attributes = propertyAttributes;
        }

        return propertyStringName;
    }
void CpProxyAvOpenhomeOrgExakt2C::PropertyVersion(Brhz& aVersion) const
{
    AutoMutex a(GetPropertyReadLock());
    CheckSubscribed();
    aVersion.Set(iVersion->Value());
}
void CpProxyAvOpenhomeOrgExakt2C::PropertyConnectionStatus(Brhz& aConnectionStatus) const
{
    AutoMutex a(GetPropertyReadLock());
    CheckSubscribed();
    aConnectionStatus.Set(iConnectionStatus->Value());
}
示例#24
0
void DvProviderAvOpenhomeOrgInfo1C::GetPropertyUri(Brhz& aValue)
{
    aValue.Set(iPropertyUri->Value());
}
示例#25
0
void DvProviderAvOpenhomeOrgRadio1C::GetPropertyTransportState(Brhz& aValue)
{
    ASSERT(iPropertyTransportState != NULL);
    aValue.Set(iPropertyTransportState->Value());
}
示例#26
0
void DvProviderAvOpenhomeOrgRadio1C::GetPropertyUri(Brhz& aValue)
{
    ASSERT(iPropertyUri != NULL);
    aValue.Set(iPropertyUri->Value());
}
示例#27
0
void DvProviderAvOpenhomeOrgRadio1C::GetPropertyMetadata(Brhz& aValue)
{
    ASSERT(iPropertyMetadata != NULL);
    aValue.Set(iPropertyMetadata->Value());
}
示例#28
0
void DvProviderAvOpenhomeOrgInfo1C::GetPropertyMetatext(Brhz& aValue)
{
    aValue.Set(iPropertyMetatext->Value());
}
示例#29
0
void DvProviderAvOpenhomeOrgRadio1C::GetPropertyProtocolInfo(Brhz& aValue)
{
    ASSERT(iPropertyProtocolInfo != NULL);
    aValue.Set(iPropertyProtocolInfo->Value());
}
void CpProxyAvOpenhomeOrgExakt2C::PropertyDeviceList(Brhz& aDeviceList) const
{
    AutoMutex a(GetPropertyReadLock());
    CheckSubscribed();
    aDeviceList.Set(iDeviceList->Value());
}