Cdroid/apps/uidemo/fileadapter.h

27 lines
611 B
C++
Executable File

#ifndef __FILE_ADAPTER_H__
#define __FILE_ADAPTER_H__
#include <widget/adapter.h>
namespace cdroid{
class FileItem{
public:
bool isDir;
size_t fileSize;
std::string fileName;
std::string fullpath;
FileItem();
FileItem(const FileItem&o);
};
class FileAdapter:public ArrayAdapter<FileItem>{
private:
std::string mResource;
public:
FileAdapter(const std::string&res):mResource(res){}
View*getView(int position, View* convertView, ViewGroup* parent)override;
int loadFiles(const std::string&path);
static std::string SimplifyPath(const std::string & path);
};
}
#endif