summaryrefslogtreecommitdiffstats
path: root/Source/cmNewLineStyle.h
diff options
context:
space:
mode:
authorPeter Kuemmel <syntheticpp@gmx.net>2011-11-20 13:04:11 (GMT)
committerBrad King <brad.king@kitware.com>2011-11-28 18:48:59 (GMT)
commita087490697c416d429d30fdf389cca2f13d9d14e (patch)
treecad0b1147f3451b012f0b4d2cd474452721315fb /Source/cmNewLineStyle.h
parent6580434f16cf4c6db1fde6d804e95d40f27c0f45 (diff)
downloadCMake-a087490697c416d429d30fdf389cca2f13d9d14e.zip
CMake-a087490697c416d429d30fdf389cca2f13d9d14e.tar.gz
CMake-a087490697c416d429d30fdf389cca2f13d9d14e.tar.bz2
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 0000000..567a4ea
--- /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