Пример #1
0
BaseItem::BasePtr FolderItem::Find(const std::string& path)
{
	size_t startPosition = 0;
	auto position = path.find_first_of("/\\", startPosition);
	auto subStrLength = position - startPosition;
	auto subStr = path.substr(startPosition, subStrLength);
	auto childIt = std::find_if(m_children.cbegin(), m_children.cend(),
		[&subStr](BasePtr child)->bool
		{
			return child->GetName() == subStr;
		}
	);

	if (childIt == m_children.cend())
	{
		return BasePtr();
	}

	if (position == std::string::npos)
	{
		return (*childIt);
	}
	std::string subPath = path.substr(position + 1);
	return (*childIt)->Find(subPath);
}
Пример #2
0
BasePtr Base::create(NodePtr _linkedNode, unsigned int _id)
{
  BasePtr a = BasePtr(new Base(_linkedNode,_id));
  return a;
}
Пример #3
0
// -----------------------------------------------------------------------------
// TSockAddr::CmpPort
// -----------------------------------------------------------------------------
//
TBool TSockAddr::CmpPort(const TSockAddr& anAddr) const
    {
	return (BasePtr()->iFamily==anAddr.BasePtr()->iFamily) 
		&& (BasePtr()->iPort==anAddr.BasePtr()->iPort);
    }
Пример #4
0
// -----------------------------------------------------------------------------
// TSockAddr::SetPort
// -----------------------------------------------------------------------------
//
void TSockAddr::SetPort(TUint aPort)
    {
    BasePtr()->iPort = aPort;
    }
Пример #5
0
// -----------------------------------------------------------------------------
// TSockAddr::Port
// -----------------------------------------------------------------------------
//
TUint TSockAddr::Port() const
    {
    return BasePtr()->iPort;
    }
Пример #6
0
// -----------------------------------------------------------------------------
// TSockAddr::SetFamily
// -----------------------------------------------------------------------------
//
void TSockAddr::SetFamily(TUint aFamily)
    {
	BasePtr()->iFamily = aFamily;
    }
Пример #7
0
// -----------------------------------------------------------------------------
// TSockAddr::Family
// -----------------------------------------------------------------------------
//
TUint TSockAddr::Family() const
    {
    return BasePtr()->iFamily;
    }
Пример #8
0
void MainLoop::End()
{
	next_scene_ = BasePtr();
}