cmNewLineStyle.h 736 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. file Copyright.txt or https://cmake.org/licensing for details. */
  3. #ifndef cmNewLineStyle_h
  4. #define cmNewLineStyle_h
  5. #include "cmConfigure.h" // IWYU pragma: keep
  6. #include <string>
  7. #include <vector>
  8. class cmNewLineStyle
  9. {
  10. public:
  11. cmNewLineStyle();
  12. enum Style
  13. {
  14. Invalid,
  15. // LF = '\n', 0x0A, 10
  16. // CR = '\r', 0x0D, 13
  17. LF, // Unix
  18. CRLF // Dos
  19. };
  20. void SetStyle(Style);
  21. Style GetStyle() const;
  22. bool IsValid() const;
  23. bool ReadFromArguments(const std::vector<std::string>& args,
  24. std::string& errorString);
  25. const std::string GetCharacters() const;
  26. private:
  27. Style NewLineStyle;
  28. };
  29. #endif