mirror of
https://git.mirrors.martin98.com/https://github.com/luc-github/ESP3D.git
synced 2025-10-16 07:31:28 +08:00
code cleaning
This commit is contained in:
parent
800f6a85b7
commit
bead8ba2d8
@ -245,25 +245,10 @@ ESP_SDFile::ESP_SDFile(void* handle, bool isdir, bool iswritemode, const char *
|
||||
char tmp[255];
|
||||
tSDFile_handle[i].getName(tmp,254);
|
||||
_filename = tmp;
|
||||
//if root
|
||||
if (_filename == "/") {
|
||||
_filename = "/.";
|
||||
}
|
||||
if (_isdir) {
|
||||
if (_filename[_filename.length()-1] != '.') {
|
||||
if (_filename[_filename.length()-2] != '/') {
|
||||
_filename+="/";
|
||||
}
|
||||
_filename+=".";
|
||||
}
|
||||
}
|
||||
//name
|
||||
if (_filename == "/.") {
|
||||
_name = "/";
|
||||
} else {
|
||||
_name = _filename;
|
||||
if (_name.endsWith("/.")) {
|
||||
_name.remove( _name.length() - 2,2);
|
||||
if (_name.endsWith("/")) {
|
||||
_name.remove( _name.length() - 1,1);
|
||||
_isfakedir = true;
|
||||
_isdir = true;
|
||||
}
|
||||
@ -274,7 +259,6 @@ ESP_SDFile::ESP_SDFile(void* handle, bool isdir, bool iswritemode, const char *
|
||||
if (pos != -1) {
|
||||
_name.remove( 0, pos+1);
|
||||
}
|
||||
}
|
||||
//size
|
||||
_size = tSDFile_handle[i].size();
|
||||
//time
|
||||
|
Loading…
x
Reference in New Issue
Block a user