aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/ext_depends/D-YAML/source/dyaml/linebreak.d
diff options
context:
space:
mode:
Diffstat (limited to 'src/ext_depends/D-YAML/source/dyaml/linebreak.d')
-rw-r--r--src/ext_depends/D-YAML/source/dyaml/linebreak.d32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/ext_depends/D-YAML/source/dyaml/linebreak.d b/src/ext_depends/D-YAML/source/dyaml/linebreak.d
new file mode 100644
index 0000000..1f0f661
--- /dev/null
+++ b/src/ext_depends/D-YAML/source/dyaml/linebreak.d
@@ -0,0 +1,32 @@
+
+// Copyright Ferdinand Majerech 2011.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+module dyaml.linebreak;
+
+
+///Enumerates platform specific line breaks.
+enum LineBreak
+{
+ ///Unix line break ("\n").
+ unix,
+ ///Windows line break ("\r\n").
+ windows,
+ ///Macintosh line break ("\r").
+ macintosh
+}
+
+package:
+
+//Get line break string for specified line break.
+string lineBreak(in LineBreak b) pure @safe nothrow
+{
+ final switch(b)
+ {
+ case LineBreak.unix: return "\n";
+ case LineBreak.windows: return "\r\n";
+ case LineBreak.macintosh: return "\r";
+ }
+}