summaryrefslogtreecommitdiff
path: root/Source/cmNewLineStyle.h
diff options
context:
space:
mode:
authorPeter Kuemmel <syntheticpp@gmx.net>2011-11-20 14:04:11 +0100
committerBrad King <brad.king@kitware.com>2011-11-28 13:48:59 -0500
commita087490697c416d429d30fdf389cca2f13d9d14e (patch)
treecad0b1147f3451b012f0b4d2cd474452721315fb /Source/cmNewLineStyle.h
parent6580434f16cf4c6db1fde6d804e95d40f27c0f45 (diff)
downloadcmake-a087490697c416d429d30fdf389cca2f13d9d14e.tar.gz
Add NEWLINE_STYLE option to configure_file (#3957)
Diffstat (limited to 'Source/cmNewLineStyle.h')
-rw-r--r--Source/cmNewLineStyle.h48
1 files changed, 48 insertions, 0 deletions
diff --git a/Source/cmNewLineStyle.h b/Source/cmNewLineStyle.h
new file mode 100644
index 0000000000..567a4ea5e6
--- /dev/null
+++ b/Source/cmNewLineStyle.h
@@ -0,0 +1,48 @@
+/*============================================================================
+ CMake - Cross Platform Makefile Generator
+ Copyright 2011 Kitware, Inc., Insight Software Consortium
+
+ Distributed under the OSI-approved BSD License (the "License");
+ see accompanying file Copyright.txt for details.
+
+ This software is distributed WITHOUT ANY WARRANTY; without even the
+ implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the License for more information.
+============================================================================*/
+#ifndef cmNewLineStyle_h
+#define cmNewLineStyle_h
+
+#include <string>
+#include <vector>
+
+
+class cmNewLineStyle
+{
+public:
+
+ cmNewLineStyle();
+
+ enum Style
+ {
+ Invalid,
+ // LF = '\n', 0x0A, 10
+ // CR = '\r', 0x0D, 13
+ LF, // Unix
+ CRLF, // Dos
+ };
+
+ void SetStyle(Style);
+ Style GetStyle() const;
+
+ bool IsValid() const;
+
+ bool ReadFromArguments(const std::vector<std::string>& args,
+ std::string &errorString);
+
+ const std::string GetCharacters() const;
+
+private:
+ Style NewLineStyle;
+};
+
+#endif