//---------------------------------------------------------------------------- void loadConfigurationInfo() { ctkBasicLocation* configArea = ctkLocationManager::getConfigurationLocation(); if (configArea == NULL) { return; } QUrl location(configArea->getUrl().toString() + ctkLocationManager::CONFIG_FILE); mergeProperties(ctkPluginFrameworkProperties::getProperties(), loadProperties(location)); }
bool CLASS::init( IOService * provider, OSDictionary * properties, IORegistryEntry * dtEntry ) { if ( dtEntry ) { if ( super::init( dtEntry, gIODTPlane ) == false || mergeProperties( properties ) == false ) return false; } else { if ( super::init( properties ) == false ) return false; } fProvider = OSDynamicCast(AppleOnboardPCATARoot, provider); if (fProvider == 0) return false; // Call platform to register the interrupt assigned to each ATA // channel. For PCI interrupts (native mode), each channel will // share the same interrupt vector assigned to the PCI device. // Legacy mode channels will attempt to register IRQ 14 and 15. UInt32 vector = getInterruptVector(); if (provider->callPlatformFunction( "SetDeviceInterrupts", /* waitForFunction */ false, /* nub */ this, /* vectors */ (void *) &vector, /* vectorCount */ (void *) 1, /* exclusive */ (void *) false ) != kIOReturnSuccess) { return false; } setLocation( getChannelNumber() ? "1" : "0" ); return true; }
void ClassInfo::resolveBaseClasses(const Map& baseClasses, const StringList& classnames, ClassInfo& classInfo) { StringList::const_reverse_iterator classnameIt, classnameEnd; for (classnameIt = classnames.rbegin(), classnameEnd = classnames.rend(); classnameIt != classnameEnd; ++classnameIt) { const String& classname = *classnameIt; ClassInfo::Map::const_iterator baseClassIt = baseClasses.find(classname); if (baseClassIt != baseClasses.end()) { const ClassInfo& baseClass = baseClassIt->second; if (!classInfo.hasDescription && baseClass.hasDescription) classInfo.setDescription(baseClass.description); if (!classInfo.hasColor && baseClass.hasColor) classInfo.setColor(baseClass.color); if (!classInfo.hasSize && baseClass.hasSize) classInfo.setSize(baseClass.size); Model::PropertyDefinition::Map::const_iterator propertyIt, propertyEnd; for (propertyIt = baseClass.properties.begin(), propertyEnd = baseClass.properties.end(); propertyIt != propertyEnd; ++propertyIt) { const Model::PropertyDefinition::Ptr baseclassProperty = propertyIt->second; Model::PropertyDefinition::Map::iterator classPropertyIt = classInfo.properties.find(baseclassProperty->name()); if (classPropertyIt != classInfo.properties.end()) { // the class already has a definition for this property, attempt merging them mergeProperties(baseclassProperty.get(), classPropertyIt->second.get()); } else { // the class doesn't have a definition for this property, add the base class property classInfo.properties[baseclassProperty->name()] = baseclassProperty; } } Model::ModelDefinition::List::const_iterator modelIt, modelEnd; for (modelIt = baseClass.models.begin(), modelEnd = baseClass.models.end(); modelIt != modelEnd; ++modelIt) { const Model::ModelDefinition::Ptr model = *modelIt; classInfo.models.push_back(model); } } } }
void PropertiesUtil::loadPropertiesFromFileStream(::std::ifstream& stream, Properties& loadInto, bool shouldOverride) { mergeProperties(loadInto, readPropertiesFromFileStream(stream), shouldOverride); }
bool IOFireWireUserClientIniter::start( IOService* provider) { //IOLog( "IOFireWireUserClientIniter<0x%08lx>::start - provider = 0x%08lx\n", this, provider ); if( provider == NULL ) { return false; } fProvider = provider ; fProvider->retain(); OSObject* dictObj = getProperty("IOProviderMergeProperties"); OSDictionary * merge_properties = OSDynamicCast(OSDictionary, dictObj); if( merge_properties != NULL ) { merge_properties = dictionaryDeepCopy( merge_properties ); } if ( !merge_properties ) { IOLog("%s %u: couldn't get merge_properties\n", __FILE__, __LINE__ ) ; return false; } // // make sure the user client class object is an OSSymbol // OSObject * userClientClassObject = merge_properties->getObject( gIOUserClientClassKey ); if( OSDynamicCast(OSString, userClientClassObject) != NULL ) { // if the the user client class object is an OSString, turn it into an OSSymbol const OSSymbol * userClientClassSymbol = OSSymbol::withString((const OSString *) userClientClassObject); if( userClientClassSymbol != NULL ) { merge_properties->setObject(gIOUserClientClassKey, (OSObject *) userClientClassSymbol); userClientClassSymbol->release(); } } else if( OSDynamicCast(OSSymbol, userClientClassObject) == NULL ) { // if its not an OSString or an OSymbol remove it from the merge properties merge_properties->removeObject(gIOUserClientClassKey); } // serialize all firwire user client initers IORecursiveLockLock( sIniterLock ); mergeProperties( fProvider, merge_properties ); IORecursiveLockUnlock( sIniterLock ); merge_properties->release(); //IOLog( "IOFireWireUserClientIniter<0x%08lx>::start - return\n", this ); return true ; }