MCPcopy Create free account
hub / github.com/Kitware/CMake / Parse

Method Parse

Source/cmFileCopier.cxx:188–225  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

186}
187
188bool 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
227bool cmFileCopier::CheckKeyword(std::string const& arg)
228{

Callers 1

RunMethod · 0.95

Calls 8

CheckKeywordMethod · 0.95
CheckValueMethod · 0.95
strMethod · 0.80
sizeMethod · 0.45
SetErrorMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected