Cdroid/apps/uidemo1/fileadapter.h

27 lines
611 B
C
Raw Normal View History

2022-01-21 11:13:32 +08:00
#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;
2022-01-21 11:13:32 +08:00
public:
FileAdapter(const std::string&res):mResource(res){}
2022-01-21 11:13:32 +08:00
View*getView(int position, View* convertView, ViewGroup* parent)override;
int loadFiles(const std::string&path);
static std::string SimplifyPath(const std::string & path);
};
}
#endif