dyaml/source/dyaml/linebreak.d
Jonathan M Davis 7a1e1ecce3 Another attempt at making d-yaml work with dub.
Creating a symlink in source to the dyaml directory does not actually
result in a symlink when another package grabs d-yaml as a dependency
via dub, and even if it did, it wouldn't work on Windows. So, this moves
the source into source so that it'll actually work, and cdc.d has been
adjusted accordingly so that building with it should still work.
2013-03-28 21:33:13 -07:00

33 lines
739 B
D

// 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";
case LineBreak.Macintosh: return "\r\n";
}
}