aboutsummaryrefslogtreecommitdiff
path: root/src/tests/csv.cpp
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2011-03-30 22:33:41 +0000
committerMike Buland <eichlan@xagasoft.com>2011-03-30 22:33:41 +0000
commit4b9289cfb260f4bcecaf23a810584ef6ef8e8501 (patch)
tree79136af08c7e42ba3322f0d73e9779e4354b318a /src/tests/csv.cpp
parentc7636dc954eddfe58f7959392602fbc9072d77e7 (diff)
downloadlibbu++-4b9289cfb260f4bcecaf23a810584ef6ef8e8501.tar.gz
libbu++-4b9289cfb260f4bcecaf23a810584ef6ef8e8501.tar.bz2
libbu++-4b9289cfb260f4bcecaf23a810584ef6ef8e8501.tar.xz
libbu++-4b9289cfb260f4bcecaf23a810584ef6ef8e8501.zip
Ok, string stuff is working much, much better, a load of new unit tests have
been added, and I deleted a whole slew of stupid old tests that I don't need.
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