| 12 | } |
| 13 | |
| 14 | bool 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 | |
| 44 | std::string cmNewLineStyle::GetCharacters() const |
| 45 | { |
no test coverage detected