Get info for this entry. Note the path() property isn't set.
| 136 | |
| 137 | // Get info for this entry. Note the path() property isn't set. |
| 138 | FileInfo GetInfo() { |
| 139 | FileInfo info; |
| 140 | if (is_dir()) { |
| 141 | Directory& dir = as_dir(); |
| 142 | info.set_type(FileType::Directory); |
| 143 | info.set_mtime(dir.mtime); |
| 144 | } else { |
| 145 | DCHECK(is_file()); |
| 146 | File& file = as_file(); |
| 147 | info.set_type(FileType::File); |
| 148 | info.set_mtime(file.mtime); |
| 149 | info.set_size(file.size()); |
| 150 | } |
| 151 | return info; |
| 152 | } |
| 153 | |
| 154 | // Get info for this entry, knowing the parent path. |
| 155 | FileInfo GetInfo(const std::string& base_path) { |
no test coverage detected