1 /*******************************************************************************
2
3 Copyright:
4 Copyright (c) 2007 Kris Bell.
5 Some parts copyright (c) 2009-2016 dunnhumby Germany GmbH.
6 All rights reserved.
7
8 License:
9 Tango Dual License: 3-Clause BSD License / Academic Free License v3.0.
10 See LICENSE_TANGO.txt for details.
11
12 Version: Initial release: Nov 2007
13
14 Authors: Kris
15
16 *******************************************************************************/
17
18 module ocean.io.stream.TextFile;
19
20 import ocean.meta.types.Qualifiers;
21
22 public import ocean.io.device.File;
23
24 import ocean.io.stream.Text;
25
26 /*******************************************************************************
27
28 Composes a file with line-oriented input. The input is buffered.
29
30 *******************************************************************************/
31
32 class TextFileInput : TextInput
33 {
34 /***********************************************************************
35
36 Compose a FileStream.
37
38 ***********************************************************************/
39
40 this (cstring path, File.Style style = File.ReadExisting)
41 {
42 this (new File (path, style));
43 }
44
45 /***********************************************************************
46
47 Wrap a FileConduit instance.
48
49 ***********************************************************************/
50
51 this (File file)
52 {
53 super (file);
54 }
55 }
56
57
58 /*******************************************************************************
59
60 Composes a file with formatted text output. Output is buffered.
61
62 *******************************************************************************/
63
64 class TextFileOutput : TextOutput
65 {
66 /***********************************************************************
67
68 Compose a FileStream.
69
70 ***********************************************************************/
71
72 this (cstring path, File.Style style = File.WriteCreate)
73 {
74 this (new File (path, style));
75 }
76
77 /***********************************************************************
78
79 Wrap a File instance.
80
81 ***********************************************************************/
82
83 this (File file)
84 {
85 super (file);
86 }
87 }