aboutsummaryrefslogtreecommitdiff
path: root/src/unstable/newline.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/unstable/newline.h')
-rw-r--r--src/unstable/newline.h41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/unstable/newline.h b/src/unstable/newline.h
new file mode 100644
index 0000000..afe0a84
--- /dev/null
+++ b/src/unstable/newline.h
@@ -0,0 +1,41 @@
1/*
2 * Copyright (C) 2007-2011 Xagasoft, All rights reserved.
3 *
4 * This file is part of the libbu++ library and is released under the
5 * terms of the license contained in the file LICENSE.
6 */
7
8#ifndef BU_NEW_LINE_H
9#define BU_NEW_LINE_H
10
11#include "bu/filter.h"
12
13namespace Bu
14{
15 /**
16 * Converts new-line characters from any standard convention into linefeeds
17 * (\\n) on reading, and converts them to either your OS's standard or a
18 * specified standard, depending on how you construct the class.
19 *
20 * If you're reading in a text file, then this filter is practically
21 * required.
22 */
23 class NewLine : public Bu::Filter
24 {
25 public:
26 NewLine( Bu::Stream &rNext );
27 virtual ~NewLine();
28
29 virtual void start();
30 virtual Bu::size stop();
31
32 virtual Bu::size read( void *pBuf, Bu::size iAmnt );
33 virtual Bu::size write( const void *pBuf, Bu::size iAmnt );
34
35 private:
36 bool bExChar;
37 char cExChar;
38 };
39};
40
41#endif