Mario: formatting

This commit is contained in:
2022-07-21 20:17:24 +02:00
parent 6558329547
commit 58fd1a37a8
9 changed files with 373 additions and 302 deletions
+25 -25
View File
@@ -24,55 +24,55 @@ using char_t = char;
namespace FSLib {
bool exists( const string &path );
bool isDirectory( const string &path );
bool rename( const string &file_a, const string &file_b );
bool deleteFile( const string &file );
string canonical( const string &path );
bool createDirectoryFull( const string &path );
string getContainingDirectory( const string &path );
string getFileName( const string &path );
string getFileExtension( const string &path );
bool exists(const string &path);
bool isDirectory(const string &path);
bool rename(const string &file_a, const string &file_b);
bool deleteFile(const string &file);
string canonical(const string &path);
bool createDirectoryFull(const string &path);
string getContainingDirectory(const string &path);
string getFileName(const string &path);
string getFileExtension(const string &path);
extern char dir_divisor;
class Directory {
public:
Directory() = delete;
explicit Directory( const string &path_ );
explicit Directory( const Directory &d ) = default;
explicit Directory( Directory &&d ) = default;
explicit Directory(const string &path_);
explicit Directory(const Directory &d) = default;
explicit Directory(Directory &&d) = default;
class Iterator {
public:
explicit Iterator( const Directory &d_ );
explicit Iterator(const Directory &d_);
~Iterator();
#ifdef _WIN32
explicit Iterator( bool ended_ );
explicit Iterator(bool ended_);
#else
Iterator( const Directory &d_, const struct dirent *current_entry_ );
Iterator(const Directory &d_, const struct dirent *current_entry_);
#endif
Iterator() = delete;
Iterator( const Iterator &i ) = default;
Iterator(const Iterator &i) = default;
Iterator( Iterator &&i ) = default;
Iterator(Iterator &&i) = default;
char_t const *operator*() const;
Iterator &operator++();
bool operator==( const Iterator &i_other ) const;
bool operator==(const Iterator &i_other) const;
Iterator operator++( int ) {
Iterator ret( *this );
Iterator operator++(int) {
Iterator ret(*this);
operator++();
return ret;
}
bool operator!=( const Iterator &i_other ) const {
return !( i_other == *this );
bool operator!=(const Iterator &i_other) const {
return !(i_other == *this);
}
private:
@@ -94,11 +94,11 @@ public:
const_iterator end() const;
iterator begin() {
return Iterator( *this );
return Iterator(*this);
}
const_iterator begin() const {
return Iterator( *this );
return Iterator(*this);
}
const_iterator cbegin() const {
@@ -115,7 +115,7 @@ public:
#ifdef _WIN32
const char_t *validPath() const {
return dir_path.substr( 0, dir_path.length() - 2 ).c_str();
return dir_path.substr(0, dir_path.length() - 2).c_str();
}
#endif