@@ -46,11 +46,11 @@ class PathUtils
4646 static const char dir_sep;
4747
4848 // / String used to point to current directory
49- static const char * curr_dir_link;
49+ static const char * const curr_dir_link;
5050 static const size_t curr_dir_link_len;
5151
5252 // / String used to point to parent directory
53- static const char * up_dir_link;
53+ static const char * const up_dir_link;
5454 static const size_t up_dir_link_len;
5555
5656 // / The directory list separator for the platform.
@@ -78,6 +78,13 @@ class PathUtils
7878 // Destructor provided for memory cleanup
7979 virtual ~DirIterator () {}
8080
81+ // Default constructor is not allowed
82+ DirIterator () = delete ;
83+ // Copy constructor is not allowed
84+ DirIterator (const DirIterator&) = delete ;
85+ // Assignment operator is not allowed
86+ const DirIterator& operator =(const DirIterator&) = delete ;
87+
8188 // The prefix increment operator (++itr) advances the iteration by
8289 // one and returns a reference to itself to allow cascading operations
8390 virtual const DirIterator& operator ++() = 0 ;
@@ -86,24 +93,16 @@ class PathUtils
8693 // item in the iteration. This path is prefixed with the path of
8794 // the directory. If the last element of the path is wanted use
8895 // PathUtils::splitLastComponent on the result of this function.
89- virtual const Firebird::PathName& operator *() = 0 ;
96+ virtual const Firebird::PathName& operator *() noexcept = 0 ;
9097
9198 // Tests if the iterator has reached the end of the iteration.
9299 // It is implemented in such a way to make the following loop work correctly:
93100 // for (DirIterator *itr = PathUtils::newDirIterator(); *itr; ++(*itr))
94- virtual operator bool () = 0;
101+ virtual operator bool () noexcept = 0;
95102
96103 protected:
97104 // Stores the path to the directory as given in the constructor
98105 const Firebird::PathName dirPrefix;
99-
100- private:
101- // Default constructor is not allowed
102- DirIterator ();
103- // Copy constructor is not allowed
104- DirIterator (const DirIterator&);
105- // Assignment operator is not allowed
106- const DirIterator& operator =(const DirIterator&);
107106 };
108107
109108 /* * isRelative returns true if the given path is relative, and false if not.
@@ -141,9 +140,9 @@ class PathUtils
141140 static void ensureSeparator (Firebird::PathName& in_out);
142141
143142 // Ensure the path separators are correct for the current platform
144- static void fixupSeparators (char * path);
143+ static void fixupSeparators (char * path) noexcept ;
145144
146- static void fixupSeparators (Firebird::PathName& path)
145+ static void fixupSeparators (Firebird::PathName& path) noexcept
147146 {
148147 fixupSeparators (path.begin ());
149148 }
0 commit comments