Example #1
0
File: node.cpp Project: halbbob/dff
std::list<std::string>*		Node::compatibleModules(void)
{
  list<std::string>*			result;
  Variant*				dtypesptr;
  Attributes				dtypes;
  ConfigManager*			cm;
  std::map<std::string, Constant*>	constants;
  std::string				ext;

  result = NULL;
  if ((cm = ConfigManager::Get()) != NULL)
    {
      result = new list<std::string>;
      constants = cm->constantsByName("mime-type");
      if (!constants.empty() && ((dtypesptr = this->dataType()) != NULL))
	{
	  dtypes = dtypesptr->value<Attributes >();
	  if (!dtypes.empty())
	    this->__compatibleModulesByType(constants, dtypes, result);
	  delete dtypesptr;
	}
      ext = this->extension();
      if (!ext.empty())
	{
	  constants = cm->constantsByName("extension-type");
	  if (!constants.empty())
	    this->__compatibleModulesByExtension(constants, ext, result);
	}
    }
  return result;
}