summaryrefslogtreecommitdiff
path: root/src/newline.h
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2010-02-11 00:38:09 +0000
committerMike Buland <eichlan@xagasoft.com>2010-02-11 00:38:09 +0000
commitd61161061bd5998ef4b1fc2aaad2cf4bbd78e90d (patch)
treef4ea64381d4f0b3b7a9610758c034183098c2e96 /src/newline.h
parent79b7b631750b69cbe06daedb0453306595dea6ad (diff)
downloadlibbu++-d61161061bd5998ef4b1fc2aaad2cf4bbd78e90d.tar.gz
libbu++-d61161061bd5998ef4b1fc2aaad2cf4bbd78e90d.tar.bz2
libbu++-d61161061bd5998ef4b1fc2aaad2cf4bbd78e90d.tar.xz
libbu++-d61161061bd5998ef4b1fc2aaad2cf4bbd78e90d.zip
Started working on a CSV reader, it's pretty much done, the CSV writer is just
a shell, but I may finish it soon, and started work on NewLine, a filter that converts newlines in text streams between the different OS standards. Also added some more helper operators to fbasicstring.
Diffstat (limited to 'src/newline.h')
-rw-r--r--src/newline.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/newline.h b/src/newline.h
new file mode 100644
index 0000000..8ee5779
--- /dev/null
+++ b/src/newline.h
@@ -0,0 +1,34 @@
1#ifndef BU_NEW_LINE_H
2#define BU_NEW_LINE_H
3
4#include "bu/filter.h"
5
6namespace Bu
7{
8 /**
9 * Converts new-line characters from any standard convention into linefeeds
10 * (\n) on reading, and converts them to either your OS's standard or a
11 * specified standard, depending on how you construct the class.
12 *
13 * If you're reading in a text file, then this filter is practically
14 * required.
15 */
16 class NewLine : public Bu::Filter
17 {
18 public:
19 NewLine( Bu::Stream &rNext );
20 virtual ~NewLine();
21
22 virtual void start();
23 virtual size_t stop();
24
25 virtual size_t read( void *pBuf, size_t iAmnt );
26 virtual size_t write( const void *pBuf, size_t iAmnt );
27
28 private:
29 bool bExChar;
30 char cExChar;
31 };
32};
33
34#endif