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

Method ReadFromArguments

Source/cmNewLineStyle.cxx:14–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12}
13
14bool cmNewLineStyle::ReadFromArguments(std::vector<std::string> const& args,
15 std::string& errorString)
16{
17 this->NewLineStyle = Invalid;
18
19 for (size_t i = 0; i < args.size(); i++) {
20 if (args[i] == "NEWLINE_STYLE") {
21 size_t const styleIndex = i + 1;
22 if (args.size() > styleIndex) {
23 std::string const& eol = args[styleIndex];
24 if (eol == "LF" || eol == "UNIX") {
25 this->NewLineStyle = LF;
26 return true;
27 }
28 if (eol == "CRLF" || eol == "WIN32" || eol == "DOS") {
29 this->NewLineStyle = CRLF;
30 return true;
31 }
32 errorString = "NEWLINE_STYLE sets an unknown style, only LF, "
33 "CRLF, UNIX, DOS, and WIN32 are supported";
34 return false;
35 }
36 errorString = "NEWLINE_STYLE must set a style: "
37 "LF, CRLF, UNIX, DOS, or WIN32";
38 return false;
39 }
40 }
41 return true;
42}
43
44std::string cmNewLineStyle::GetCharacters() const
45{

Callers 3

cmConfigureFileCommandFunction · 0.80
HandleGenerateCommandFunction · 0.80
HandleConfigureCommandFunction · 0.80

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected