summaryrefslogtreecommitdiff
path: root/src/tests/csv.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/tests/csv.cpp')
-rw-r--r--src/tests/csv.cpp50
1 files changed, 0 insertions, 50 deletions
diff --git a/src/tests/csv.cpp b/src/tests/csv.cpp
deleted file mode 100644
index 850fda8..0000000
--- a/src/tests/csv.cpp
+++ /dev/null
@@ -1,50 +0,0 @@
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#include "bu/optparser.h"
9#include "bu/file.h"
10#include "bu/newline.h"
11#include "bu/csvreader.h"
12#include "bu/buffer.h"
13#include "bu/sio.h"
14
15using namespace Bu;
16
17class Options : public OptParser
18{
19public:
20 Options( int argc, char *argv[] )
21 {
22 addOption( slot( this, &Options::onRead ), 'r', "read",
23 "Read and display a csv file." );
24
25 addHelpOption();
26
27 parse( argc, argv );
28 }
29
30 int onRead( StrArray aArgs )
31 {
32 File fIn( aArgs[1], File::Read );
33 NewLine nlIn( fIn );
34 Buffer bIn( nlIn );
35 CsvReader rCsv( bIn );
36 while( !fIn.isEos() )
37 {
38 sio << rCsv.readLine() << sio.nl;
39 }
40 sio << sio.nl;
41 return 1;
42 }
43};
44
45int main( int argc, char *argv[] )
46{
47 Options opts( argc, argv );
48 return 0;
49}
50