| 151 | } |
| 152 | |
| 153 | const char* scan_dir::next_dir(bool full /* = false */) |
| 154 | { |
| 155 | if (scan_ == NULL) { |
| 156 | return NULL; |
| 157 | } |
| 158 | |
| 159 | const char* dir = acl_scan_dir_next_dir(scan_); |
| 160 | if (dir == NULL || *dir == 0) { |
| 161 | return NULL; |
| 162 | } |
| 163 | if (!full) { |
| 164 | return dir; |
| 165 | } |
| 166 | |
| 167 | const char* path = curr_path(); |
| 168 | if (path == NULL) { |
| 169 | return NULL; |
| 170 | } |
| 171 | |
| 172 | if (file_buf_ == NULL) { |
| 173 | file_buf_ = NEW string(256); |
| 174 | } |
| 175 | |
| 176 | #ifdef ACL_WINDOWS |
| 177 | file_buf_->format("%s%c%s", path, PATH_SEP_C, dir); |
| 178 | #else |
| 179 | if (*path == '/' && *(path + 1) == 0) { |
| 180 | file_buf_->format("%s%s", path, dir); |
| 181 | } else { |
| 182 | file_buf_->format("%s%c%s", path, PATH_SEP_C, dir); |
| 183 | } |
| 184 | #endif |
| 185 | |
| 186 | return file_buf_->c_str(); |
| 187 | } |
| 188 | |
| 189 | const char* scan_dir::next(bool full /* = false */, bool* is_file /* = NULL */) |
| 190 | { |
no test coverage detected