本文整理汇总了C++中FileObject::GetData方法的典型用法代码示例。如果您正苦于以下问题:C++ FileObject::GetData方法的具体用法?C++ FileObject::GetData怎么用?C++ FileObject::GetData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileObject
的用法示例。
在下文中一共展示了FileObject::GetData方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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;
}
示例2: OnDragOver
HRESULT FTPWindow::OnDragOver(DWORD /*grfKeyState*/, POINTL pt, LPDWORD pdwEffect) {
FileObject * fo = m_treeview.GetItemByPoint(pt);
if (fo && fo->isDir()) {
*pdwEffect = DROPEFFECT_COPY;
TreeView_Select(m_treeview.GetHWND(), fo->GetData(), TVGN_DROPHILITE);
m_currentDropObject = fo;
return S_OK;
} else {
TreeView_Select(m_treeview.GetHWND(), NULL, TVGN_DROPHILITE);
m_currentDropObject = NULL;
}
return S_OK;
}
示例3: GetDirectoryHierarchy
int FTPSession::GetDirectoryHierarchy(const char * inputDir) {
if (!m_running)
return -1;
char *pathEntry;
char* dir = SU::strdup(inputDir);
// We will store the parent directory paths to be
// examined in the below vector.
std::vector<char*> parentDirs;
int childCount;
char currentPath[MAX_PATH];
FileObject* currentFileObj = m_rootObject;
strcpy( currentPath, "/" );
// Split the entries based on '/' and append the
// previous directory name to get the full path.
pathEntry = strtok (dir,"/");
while(pathEntry != NULL) {
if (currentFileObj) {
childCount = currentFileObj->GetChildCount();
currentFileObj = currentFileObj->GetChildByName(pathEntry);
if (currentFileObj) {
HTREEITEM hti = (HTREEITEM)(currentFileObj->GetData());
if (hti) {
sprintf(currentPath,"%s%s/", currentPath, pathEntry);
pathEntry = strtok (NULL,"/");
continue;
}
}
// Cannot find the child. Check if it is because I have no
// information about the child, or that I cannot find the child.
if (!currentFileObj) {
// If I have child data, but I cannot find the child, then
// I will stop here and will not queue the operation.
if (childCount)
return 1;
}
}
if (!parentDirs.size()) {
parentDirs.push_back(SU::strdup(currentPath));
}
sprintf(currentPath,"%s%s/", currentPath, pathEntry);
parentDirs.push_back(SU::strdup(currentPath));
pathEntry = strtok (NULL,"/");
}
// If there is some parent directories to be examined,
// remove the last directory because this is same as
// the input directory.
if (parentDirs.size())
parentDirs.pop_back();
QueueGetDir * dirop = new QueueGetDir(m_hNotify, inputDir, parentDirs);
m_mainQueue->AddQueueOp(dirop);
return 0;
}