Ejemplo n.º 1
0
//-----------------------------------------------------------------------------
// LogicalGroup::getDataItem
//-----------------------------------------------------------------------------
IDataItemPtr LogicalGroup::getDataItem(const std::string& keypath)
{
  if( m_dataset_ptr != NULL )
  {
    yat::String path = keypath;
    
    std::vector<yat::String> keys;
    path.replace( "::", "/" );
    path.split( '/', &keys );
    
    LogicalGroupPtr tmp = m_dataset_ptr->getLogicalRoot();
    
    for( unsigned int i = 0; i < keys.size() - 1 && ! tmp.is_null(); i++ )
    {
       tmp = tmp->getGroup( KeyPtr( new Key( keys[i], Key::GROUP ) ) );
    }
    
    if( tmp )
    {
      return tmp->getDataItem( KeyPtr( new Key( keys[ keys.size() - 1 ], Key::ITEM ) ) );
    }
    else
    {
      return NULL;
    }
  }
  return NULL;
}
Ejemplo n.º 2
0
 KeyPtr Properties::getKey( const KeySetIterConst& setIterator ) const
 {
     if( setIterator != myKeySet.cend() )
     {
         return *setIterator;
     }
     return KeyPtr();
 }
Ejemplo n.º 3
0
//-----------------------------------------------------------------------------
// LogicalGroup::getKeys
//-----------------------------------------------------------------------------
std::list<KeyPtr> LogicalGroup::getKeys()
{
  CDMA_FUNCTION_TRACE("LogicalGroup::getKeys");
  std::list< KeyPtr > result;

  // Get children keys' names
  yat::String key = m_key_ptr.is_null() ? "" : m_key_ptr->getName();
  if( m_listkey_ptr.is_null() )
  {
    m_listkey_ptr = m_dictionary_ptr->getKeys( key );
  }
  for( StringList::iterator itChildren = m_listkey_ptr->begin(); itChildren != m_listkey_ptr->end(); itChildren++ )
  {
    result.push_back( KeyPtr(new Key( *itChildren, m_dictionary_ptr->getKeyType(*itChildren)) ) );
  }
  return result;
}
Ejemplo n.º 4
0
 const Registry::Key::KeysPoolPtr Registry::Key::GetChildKeys() const
 {
   KeysPoolPtr RetPool(new KeysPool);
   for (RefObjQIPtr<IFaces::INamedVariable> Var = Keys.First() ;
     Var.Get() ; Var = Keys.Next())
   {
     RefObjPtr<IFaces::IVariant> Value;
     if (Var->Get(Value.GetPPtr()) != IFaces::retOk)
       throw RegistryException("Can't get value");
     if (Value->GetType() != IFaces::IVariant::vtIBase)
       throw RegistryException("Unknown child item");
     RefObjPtr<IFaces::IBase> ChildItem;
     if (Value->GetValue(reinterpret_cast<void**>(ChildItem.GetPPtr())) != IFaces::retOk)
       throw RegistryException("Can't get child enum");
     RefObjQIPtr<IFaces::IEnum> Enum(ChildItem);
     if (!Enum.Get())
       throw RegistryException("Unknown child item");
     RetPool->push_back(KeyPtr(new Key(IFacesImpl::IEnumHelper(Enum), Var->GetName())));
   }
   return RetPool;
 }
Ejemplo n.º 5
0
//-----------------------------------------------------------------------------
// LogicalGroup::getGroup
//-----------------------------------------------------------------------------
LogicalGroupPtr LogicalGroup::getGroup(const std::string& keypath)
{
  // TODO if path starts with ':' then consider it as absolute path else as a relative path
  if( m_dataset_ptr != NULL )
  {
    yat::String path = keypath;
    
    std::vector<yat::String> keys;
    path.replace( "/", ":" );
    path.split( ':', &keys );
    
    LogicalGroupPtr tmp = m_dataset_ptr->getLogicalRoot();

    for( unsigned int i = 0; i < keys.size() && ! tmp.is_null(); i++ )
    {
       tmp = tmp->getGroup( KeyPtr( new Key( keys[i], Key::GROUP ) ) );
    }
    
    return tmp;
  }
  return NULL;
}
Ejemplo n.º 6
0
//-----------------------------------------------------------------------------
// LogicalGroup::getDataItemList
//-----------------------------------------------------------------------------
DataItemList LogicalGroup::getDataItemList(const std::string& keyword)
{
  return getDataItemList( KeyPtr( new Key( keyword, Key::ITEM ) ) );
}