本文整理汇总了C++中FileObject::GetChild方法的典型用法代码示例。如果您正苦于以下问题:C++ FileObject::GetChild方法的具体用法?C++ FileObject::GetChild怎么用?C++ FileObject::GetChild使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileObject
的用法示例。
在下文中一共展示了FileObject::GetChild方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FindPathObject
FileObject* FTPSession::FindPathObject(const char * filepath) {
if (!filepath)
return NULL;
char tempstr[MAX_PATH];
strcpy(tempstr, filepath);
FileObject * current = m_rootObject;
char * curname = strtok (tempstr, "/");
while(curname) {
if (current->GetChildCount() == 0) //search did not finish, but cannot find child
return NULL;
int i = 0;
int count = current->GetChildCount();
for(i = 0; i < count; i++) {
if ( !strcmp( current->GetChild(i)->GetName(), curname ) ) {
current = current->GetChild(i);
curname = strtok (NULL, "/");
break;
}
}
if (i == count) //none of the children match
return NULL;
}
return current;
}
示例2: OnConnect
int FTPWindow::OnConnect(int code) {
if (code != 0) //automated connect
return 0;
FileObject * root = m_ftpSession->GetRootObject();
m_treeview.AddRoot(root);
FileObject * last = root;
while(last->GetChildCount() > 0) {
last = last->GetChild(0);
}
m_treeview.EnsureObjectVisible(last);
TreeView_Select(m_treeview.GetHWND(), last->GetData(), TVGN_CARET);
m_ftpSession->GetDirectory(last->GetPath());
TCHAR * info = SU::TSprintfNB(TEXT("Connected to %T"), m_ftpSession->GetCurrentProfile()->GetName());
SetInfo(info);
delete [] info;
SetToolbarState();
return 0;
}