2016-10-30 18:24:19 +01:00
|
|
|
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
|
|
|
file Copyright.txt or https://cmake.org/licensing for details. */
|
2012-02-18 12:40:36 +02:00
|
|
|
#ifndef cmNewLineStyle_h
|
|
|
|
#define cmNewLineStyle_h
|
|
|
|
|
2017-07-20 19:35:53 +02:00
|
|
|
#include "cmConfigure.h" // IWYU pragma: keep
|
2016-10-30 18:24:19 +01:00
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
2012-02-18 12:40:36 +02:00
|
|
|
|
|
|
|
class cmNewLineStyle
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
cmNewLineStyle();
|
|
|
|
|
|
|
|
enum Style
|
|
|
|
{
|
|
|
|
Invalid,
|
2016-07-09 11:21:54 +02:00
|
|
|
// LF = '\n', 0x0A, 10
|
|
|
|
// CR = '\r', 0x0D, 13
|
|
|
|
LF, // Unix
|
|
|
|
CRLF // Dos
|
2012-02-18 12:40:36 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
void SetStyle(Style);
|
|
|
|
Style GetStyle() const;
|
|
|
|
|
|
|
|
bool IsValid() const;
|
|
|
|
|
|
|
|
bool ReadFromArguments(const std::vector<std::string>& args,
|
2016-07-09 11:21:54 +02:00
|
|
|
std::string& errorString);
|
2012-02-18 12:40:36 +02:00
|
|
|
|
2020-02-01 23:06:01 +01:00
|
|
|
std::string GetCharacters() const;
|
2012-02-18 12:40:36 +02:00
|
|
|
|
|
|
|
private:
|
2019-11-11 23:01:05 +01:00
|
|
|
Style NewLineStyle = Invalid;
|
2012-02-18 12:40:36 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|