| 155 | // ---------------------------------------------------------------------------------------- |
| 156 | |
| 157 | class directory |
| 158 | { |
| 159 | /*! |
| 160 | INITIAL VALUES |
| 161 | state.name == name() |
| 162 | state.full_name == full_name() |
| 163 | |
| 164 | CONVENTION |
| 165 | state.name == name() |
| 166 | state.full_name == full_name() |
| 167 | is_root() == state.name.size() == 0 |
| 168 | |
| 169 | !*/ |
| 170 | |
| 171 | void init(const std::string& name); |
| 172 | |
| 173 | public: |
| 174 | struct private_constructor{}; |
| 175 | inline directory ( |
| 176 | const std::string& name, |
| 177 | const std::string& full_name, |
| 178 | private_constructor |
| 179 | ) |
| 180 | { |
| 181 | state.name = name; |
| 182 | state.full_name = full_name; |
| 183 | } |
| 184 | |
| 185 | struct data |
| 186 | { |
| 187 | std::string name; |
| 188 | std::string full_name; |
| 189 | }; |
| 190 | |
| 191 | class dir_not_found : public error { |
| 192 | public: dir_not_found(const std::string& s):error(s){} |
| 193 | }; |
| 194 | class listing_error : public error { |
| 195 | public: listing_error(const std::string& s):error(s){} |
| 196 | }; |
| 197 | |
| 198 | inline directory ( |
| 199 | ) |
| 200 | { |
| 201 | } |
| 202 | |
| 203 | directory ( |
| 204 | const std::string& name |
| 205 | ) { init(name); } |
| 206 | |
| 207 | directory ( |
| 208 | const char* name |
| 209 | ) { init(name); } |
| 210 | |
| 211 | static char get_separator ( |
| 212 | ); |
| 213 | |
| 214 | template < |
no outgoing calls
no test coverage detected