diff options
Diffstat (limited to 'src/newline.h')
| -rw-r--r-- | src/newline.h | 34 |
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 | |||
| 6 | namespace 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 | ||
