44 lines
1.1 KiB
C++

#pragma once
#include <vector>
#include <string>
#include "../protobuf/stream.pb.h"
#include "../DataManage/RWData.h"
#define MAX_FILE_DIALOG_NAME_BUFFER 1024
struct FileInfoStruct
{
char type;
std::wstring filePath;
std::wstring fileName;
std::wstring ext;
};
enum CALLFUNC {
GetLogicalDrive=0,
ScanDir,
};
class FileDialog
{
public:
FileDialog();
~FileDialog();
public:
void Request(const ReadData& rd, ::stream::ResponseAny** response); //查询路径下的文件、文件夹等
private:
bool ScanDir(std::wstring vPath); //查询路径下的文件、文件夹等
void GetLogicalDrive(::stream::ResponseAny** rsp); //获取盘符等,空格隔开
//void ComposeNewPath(std::vector<std::wstring>::iterator vIter); //组合为一个路径
private:
std::string m_DriverItem; //选中的盘符
std::vector<FileInfoStruct> m_FileList; //当前路径下的文件、文件夹
std::wstring m_SelectedFileName; //选取的文件名
std::wstring m_CurrentPath; //当前的路径
std::vector<std::wstring> m_CurrentPath_Decomposition; //当前路径的文件名集合
std::wstring m_CurrentFilterExt; //文件后缀
};