| 186 | } |
| 187 | |
| 188 | bool cmFileCopier::Parse(std::vector<std::string> const& args) |
| 189 | { |
| 190 | this->Doing = DoingFiles; |
| 191 | for (unsigned int i = 1; i < args.size(); ++i) { |
| 192 | // Check this argument. |
| 193 | if (!this->CheckKeyword(args[i]) && !this->CheckValue(args[i])) { |
| 194 | std::ostringstream e; |
| 195 | e << "called with unknown argument \"" << args[i] << "\"."; |
| 196 | this->Status.SetError(e.str()); |
| 197 | return false; |
| 198 | } |
| 199 | |
| 200 | // Quit if an argument is invalid. |
| 201 | if (this->Doing == DoingError) { |
| 202 | return false; |
| 203 | } |
| 204 | } |
| 205 | |
| 206 | // Require a destination. |
| 207 | if (this->Destination.empty()) { |
| 208 | std::ostringstream e; |
| 209 | e << this->Name << " given no DESTINATION"; |
| 210 | this->Status.SetError(e.str()); |
| 211 | return false; |
| 212 | } |
| 213 | |
| 214 | // If file permissions were not specified set default permissions. |
| 215 | if (!this->UseGivenPermissionsFile && !this->UseSourcePermissions) { |
| 216 | this->DefaultFilePermissions(); |
| 217 | } |
| 218 | |
| 219 | // If directory permissions were not specified set default permissions. |
| 220 | if (!this->UseGivenPermissionsDir && !this->UseSourcePermissions) { |
| 221 | this->DefaultDirectoryPermissions(); |
| 222 | } |
| 223 | |
| 224 | return true; |
| 225 | } |
| 226 | |
| 227 | bool cmFileCopier::CheckKeyword(std::string const& arg) |
| 228 | { |
no test coverage detected