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); }
BasePtr Base::create(NodePtr _linkedNode, unsigned int _id) { BasePtr a = BasePtr(new Base(_linkedNode,_id)); return a; }
// ----------------------------------------------------------------------------- // TSockAddr::CmpPort // ----------------------------------------------------------------------------- // TBool TSockAddr::CmpPort(const TSockAddr& anAddr) const { return (BasePtr()->iFamily==anAddr.BasePtr()->iFamily) && (BasePtr()->iPort==anAddr.BasePtr()->iPort); }
// ----------------------------------------------------------------------------- // TSockAddr::SetPort // ----------------------------------------------------------------------------- // void TSockAddr::SetPort(TUint aPort) { BasePtr()->iPort = aPort; }
// ----------------------------------------------------------------------------- // TSockAddr::Port // ----------------------------------------------------------------------------- // TUint TSockAddr::Port() const { return BasePtr()->iPort; }
// ----------------------------------------------------------------------------- // TSockAddr::SetFamily // ----------------------------------------------------------------------------- // void TSockAddr::SetFamily(TUint aFamily) { BasePtr()->iFamily = aFamily; }
// ----------------------------------------------------------------------------- // TSockAddr::Family // ----------------------------------------------------------------------------- // TUint TSockAddr::Family() const { return BasePtr()->iFamily; }
void MainLoop::End() { next_scene_ = BasePtr(); }