cmNewLineStyle.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*============================================================================
  2. CMake - Cross Platform Makefile Generator
  3. Copyright 2011 Kitware, Inc., Insight Software Consortium
  4. Distributed under the OSI-approved BSD License (the "License");
  5. see accompanying file Copyright.txt for details.
  6. This software is distributed WITHOUT ANY WARRANTY; without even the
  7. implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  8. See the License for more information.
  9. ============================================================================*/
  10. #ifndef cmNewLineStyle_h
  11. #define cmNewLineStyle_h
  12. #include <string>
  13. #include <vector>
  14. class cmNewLineStyle
  15. {
  16. public:
  17. cmNewLineStyle();
  18. enum Style
  19. {
  20. Invalid,
  21. // LF = '\n', 0x0A, 10
  22. // CR = '\r', 0x0D, 13
  23. LF, // Unix
  24. CRLF, // Dos
  25. };
  26. void SetStyle(Style);
  27. Style GetStyle() const;
  28. bool IsValid() const;
  29. bool ReadFromArguments(const std::vector<std::string>& args,
  30. std::string &errorString);
  31. const std::string GetCharacters() const;
  32. private:
  33. Style NewLineStyle;
  34. };
  35. #endif