Add consts
This commit is contained in:
parent
a50ae5d93f
commit
46528b1f29
@ -57,7 +57,7 @@ const char *FSLib::Directory::path() const {
|
|||||||
return dir_path.c_str();
|
return dir_path.c_str();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string FSLib::Directory::Iterator::operator*() {
|
char const *FSLib::Directory::Iterator::operator*() const {
|
||||||
return current_entry->d_name;
|
return current_entry->d_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -65,8 +65,8 @@ FSLib::Directory::Iterator &FSLib::Directory::Iterator::operator++() {
|
|||||||
if( current_entry == nullptr )
|
if( current_entry == nullptr )
|
||||||
return *this;
|
return *this;
|
||||||
current_entry = readdir(d);
|
current_entry = readdir(d);
|
||||||
if( current_entry != nullptr && (!strcmp(current_entry->d_name, ".") || !strcmp(current_entry->d_name, "..")) )
|
if( current_entry != nullptr && ( !strcmp(current_entry->d_name, ".") || !strcmp(current_entry->d_name, "..") ) )
|
||||||
operator++();
|
return operator++();
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -76,10 +76,10 @@ FSLib::Directory::Iterator FSLib::Directory::Iterator::operator++(int) {
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FSLib::Directory::Iterator::operator==(const Iterator &i_other) {
|
bool FSLib::Directory::Iterator::operator==(const Iterator &i_other) const {
|
||||||
return i_other.current_entry == current_entry;
|
return i_other.current_entry == current_entry;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FSLib::Directory::Iterator::operator!=(const Iterator &i_other) {
|
bool FSLib::Directory::Iterator::operator!=(const Iterator &i_other) const {
|
||||||
return i_other.current_entry != current_entry;
|
return i_other.current_entry != current_entry;
|
||||||
}
|
}
|
||||||
|
@ -36,15 +36,15 @@ namespace FSLib{
|
|||||||
closedir(d);
|
closedir(d);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string operator*();
|
char const *operator*() const;
|
||||||
|
|
||||||
Iterator &operator++();
|
Iterator &operator++();
|
||||||
|
|
||||||
Iterator operator++(int);
|
Iterator operator++(int);
|
||||||
|
|
||||||
bool operator==(const Iterator &i_other);
|
bool operator==(const Iterator &i_other) const;
|
||||||
|
|
||||||
bool operator!=(const Iterator &i_other);
|
bool operator!=(const Iterator &i_other) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DIR *d;
|
DIR *d;
|
||||||
|
Loading…
Reference in New Issue
Block a user