|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r69043 - sandbox/assign_v2/libs/assign/v2/test/put/pipe/csv
From: erwann.rogard_at_[hidden]
Date: 2011-02-19 05:59:15
Author: e_r
Date: 2011-02-19 05:59:14 EST (Sat, 19 Feb 2011)
New Revision: 69043
URL: http://svn.boost.org/trac/boost/changeset/69043
Log:
upd assign_v2
Added:
sandbox/assign_v2/libs/assign/v2/test/put/pipe/csv/ext.cpp (contents, props changed)
sandbox/assign_v2/libs/assign/v2/test/put/pipe/csv/ext.h (contents, props changed)
sandbox/assign_v2/libs/assign/v2/test/put/pipe/csv/fun.cpp (contents, props changed)
sandbox/assign_v2/libs/assign/v2/test/put/pipe/csv/fun.h (contents, props changed)
sandbox/assign_v2/libs/assign/v2/test/put/pipe/csv/std.cpp (contents, props changed)
sandbox/assign_v2/libs/assign/v2/test/put/pipe/csv/std.h (contents, props changed)
Added: sandbox/assign_v2/libs/assign/v2/test/put/pipe/csv/ext.cpp
==============================================================================
--- (empty file)
+++ sandbox/assign_v2/libs/assign/v2/test/put/pipe/csv/ext.cpp 2011-02-19 05:59:14 EST (Sat, 19 Feb 2011)
@@ -0,0 +1,76 @@
+//////////////////////////////////////////////////////////////////////////////
+// Boost.Assign v2 //
+// //
+// Copyright (C) 2003-2004 Thorsten Ottosen //
+// Copyright (C) 2010 Erwann Rogard //
+// Use, modification and distribution are subject to the //
+// Boost Software License, Version 1.0. (See accompanying file //
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //
+//////////////////////////////////////////////////////////////////////////////
+#include <map>
+#include <deque>
+#include <string>
+
+#include <boost/lambda/lambda.hpp>
+
+#include <boost/assign/v2/put/pipe/csv.hpp>
+#include <boost/assign/v2/detail/config/check.hpp>
+#include <boost/assign/v2/put/ext/lookup.hpp>
+#include <boost/assign/v2/put/ext/repeat.hpp>
+#include <boost/assign/v2/put/ext/iterate.hpp>
+#include <libs/assign/v2/test/put/pipe/csv/ext.h>
+
+namespace test_assign_v2{
+namespace xxx_put{
+namespace xxx_pipe{
+namespace xxx_csv{
+namespace xxx_ext{
+
+ void test(){
+
+ // This test is also about string literals
+
+ namespace as2 = boost::assign::v2;
+ namespace bl = boost::lambda;
+ {
+ //[csv_lookup
+ std::map<std::string, int> cont;
+ cont["jan"] = 29; cont["feb"] = 26; cont["mar"] = 29;
+ cont | (
+ as2::_csv_put % ( as2::_lookup = ( bl::_1 +=2 ) )
+ )( "jan", "feb", "mar" );
+ BOOST_ASSIGN_V2_CHECK( cont["jan"] == 31 );
+ BOOST_ASSIGN_V2_CHECK( cont["feb"] == 28 );
+ BOOST_ASSIGN_V2_CHECK( cont["mar"] == 31 );
+ //]
+ }
+ {
+ //[csv_repeat
+ typedef int T; std::deque<T> cont; T x = 1, y = 2, z = 0;
+ cont | ( as2::_csv_put % ( as2::_repeat = 2 ) )( x, y, z );
+ BOOST_ASSIGN_V2_CHECK( cont.size() == 6 );
+ //]
+ BOOST_ASSIGN_V2_CHECK( cont[0] == x );
+ BOOST_ASSIGN_V2_CHECK( cont[1] == x );
+ BOOST_ASSIGN_V2_CHECK( cont[2] == y );
+ BOOST_ASSIGN_V2_CHECK( cont[3] == y );
+ BOOST_ASSIGN_V2_CHECK( cont[4] == z );
+ BOOST_ASSIGN_V2_CHECK( cont[5] == z );
+ }
+ {
+ //[csv_iterate
+ typedef int T; T x = 1, y = 2, z = 0;
+ boost::array<T, 3> ar; ar[0] = x;
+ ar | (as2::_csv_put % ( as2::_iterate = 1 ) )( y, z );
+ BOOST_ASSIGN_V2_CHECK( ar[0] == x );
+ BOOST_ASSIGN_V2_CHECK( ar[1] == y );
+ BOOST_ASSIGN_V2_CHECK( ar[2] == z );
+ //]
+ }
+ }
+
+}// xxx_ext
+}// xxx_csv
+}// xxx_pipe
+}// xxx_put
+}// xxx_test_assign
Added: sandbox/assign_v2/libs/assign/v2/test/put/pipe/csv/ext.h
==============================================================================
--- (empty file)
+++ sandbox/assign_v2/libs/assign/v2/test/put/pipe/csv/ext.h 2011-02-19 05:59:14 EST (Sat, 19 Feb 2011)
@@ -0,0 +1,27 @@
+//////////////////////////////////////////////////////////////////////////////
+// Boost.Assign v2 //
+// //
+// Copyright (C) 2003-2004 Thorsten Ottosen //
+// Copyright (C) 2010 Erwann Rogard //
+// Use, modification and distribution are subject to the //
+// Boost Software License, Version 1.0. (See accompanying file //
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //
+//////////////////////////////////////////////////////////////////////////////
+#ifndef LIBS_ASSIGN_V2_TEST_PUT_PIPE_CSV_EXT_ER_2010_H
+#define LIBS_ASSIGN_V2_TEST_PUT_PIPE_CSV_EXT_ER_2010_H
+
+namespace test_assign_v2{
+namespace xxx_put{
+namespace xxx_pipe{
+namespace xxx_csv{
+namespace xxx_ext{
+
+ void test();
+
+}// xxx_ext
+}// xxx_csv
+}// xxx_pipe
+}// xxx_put
+}// xxx_test_assign
+
+#endif
Added: sandbox/assign_v2/libs/assign/v2/test/put/pipe/csv/fun.cpp
==============================================================================
--- (empty file)
+++ sandbox/assign_v2/libs/assign/v2/test/put/pipe/csv/fun.cpp 2011-02-19 05:59:14 EST (Sat, 19 Feb 2011)
@@ -0,0 +1,44 @@
+//////////////////////////////////////////////////////////////////////////////
+// Boost.Assign v2 //
+// //
+// Copyright (C) 2003-2004 Thorsten Ottosen //
+// Copyright (C) 2010 Erwann Rogard //
+// Use, modification and distribution are subject to the //
+// Boost Software License, Version 1.0. (See accompanying file //
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //
+//////////////////////////////////////////////////////////////////////////////
+#include <vector>
+#include <boost/assign/v2/detail/config/check.hpp>
+#include <boost/assign/v2/put/modulo/fun.hpp>
+#include <boost/assign/v2/put/pipe/csv.hpp>
+#include <boost/lambda/lambda.hpp>
+#include <libs/assign/v2/test/put/pipe/csv/fun.h>
+
+namespace test_assign_v2{
+namespace xxx_put{
+namespace xxx_pipe{
+namespace xxx_csv{
+namespace xxx_fun{
+
+ void test()
+ {
+ namespace as2 = boost::assign::v2;
+ namespace bl = boost::lambda;
+ {
+ //[csv_modulo_fun
+ typedef int T; T x = 1, y = 2, z = 0;
+ std::vector<int> cont;
+ cont | (
+ as2::_csv_put % ( as2::_fun = ( bl::_1 + 1 ) )
+ )( x, y, z );
+ BOOST_ASSIGN_V2_CHECK( cont.front() == ( x + 1 ) );
+ BOOST_ASSIGN_V2_CHECK( cont.back() == ( z + 1 ) );
+ //]
+ }
+ }
+
+}// xxx_fun
+}// xxx_csv
+}// xxx_pipe
+}// xxx_put
+}// test_assign_v2
Added: sandbox/assign_v2/libs/assign/v2/test/put/pipe/csv/fun.h
==============================================================================
--- (empty file)
+++ sandbox/assign_v2/libs/assign/v2/test/put/pipe/csv/fun.h 2011-02-19 05:59:14 EST (Sat, 19 Feb 2011)
@@ -0,0 +1,27 @@
+//////////////////////////////////////////////////////////////////////////////
+// Boost.Assign v2 //
+// //
+// Copyright (C) 2003-2004 Thorsten Ottosen //
+// Copyright (C) 2010 Erwann Rogard //
+// Use, modification and distribution are subject to the //
+// Boost Software License, Version 1.0. (See accompanying file //
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //
+//////////////////////////////////////////////////////////////////////////////
+#ifndef LIBS_ASSIGN_V2_TEST_PUT_PIPE_CSV_FUN_ER_2010_H
+#define LIBS_ASSIGN_V2_TEST_PUT_PIPE_CSV_FUN_ER_2010_H
+
+namespace test_assign_v2{
+namespace xxx_put{
+namespace xxx_pipe{
+namespace xxx_csv{
+namespace xxx_fun{
+
+ void test();
+
+}// xxx_fun
+}// xxx_csv
+}// xxx_pipe
+}// xxx_put
+}// xxx_test_assign
+
+#endif
Added: sandbox/assign_v2/libs/assign/v2/test/put/pipe/csv/std.cpp
==============================================================================
--- (empty file)
+++ sandbox/assign_v2/libs/assign/v2/test/put/pipe/csv/std.cpp 2011-02-19 05:59:14 EST (Sat, 19 Feb 2011)
@@ -0,0 +1,42 @@
+//////////////////////////////////////////////////////////////////////////////
+// Boost.Assign v2 //
+// //
+// Copyright (C) 2003-2004 Thorsten Ottosen //
+// Copyright (C) 2010 Erwann Rogard //
+// Use, modification and distribution are subject to the //
+// Boost Software License, Version 1.0. (See accompanying file //
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //
+//////////////////////////////////////////////////////////////////////////////
+#include <deque>
+#include <boost/assign/v2/detail/config/check.hpp>
+#include <boost/assign/v2/put/std/push_front.hpp>
+#include <boost/assign/v2/put/pipe/csv.hpp>
+#include <boost/lambda/lambda.hpp>
+#include <libs/assign/v2/test/put/pipe/csv/std.h>
+
+namespace test_assign_v2{
+namespace xxx_put{
+namespace xxx_pipe{
+namespace xxx_csv{
+namespace xxx_std{
+
+ void test()
+ {
+ namespace as2 = boost::assign::v2;
+ namespace bl = boost::lambda;
+ {
+ //[push_front
+ typedef int T; T x = 1, y = 2, z = 0;
+ std::deque<int> cont;
+ cont | ( as2::_csv_put % as2::_push_front )( x, y ,z );
+ BOOST_ASSIGN_V2_CHECK( cont.front() == z );
+ BOOST_ASSIGN_V2_CHECK( cont.back() == x );
+ //]
+ }
+ }
+
+}// xxx_std
+}// xxx_csv
+}// xxx_pipe
+}// xxx_put
+}// test_assign_v2
Added: sandbox/assign_v2/libs/assign/v2/test/put/pipe/csv/std.h
==============================================================================
--- (empty file)
+++ sandbox/assign_v2/libs/assign/v2/test/put/pipe/csv/std.h 2011-02-19 05:59:14 EST (Sat, 19 Feb 2011)
@@ -0,0 +1,27 @@
+//////////////////////////////////////////////////////////////////////////////
+// Boost.Assign v2 //
+// //
+// Copyright (C) 2003-2004 Thorsten Ottosen //
+// Copyright (C) 2010 Erwann Rogard //
+// Use, modification and distribution are subject to the //
+// Boost Software License, Version 1.0. (See accompanying file //
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //
+//////////////////////////////////////////////////////////////////////////////
+#ifndef LIBS_ASSIGN_V2_TEST_PUT_PIPE_CSV_STD_ER_2010_H
+#define LIBS_ASSIGN_V2_TEST_PUT_PIPE_CSV_STD_ER_2010_H
+
+namespace test_assign_v2{
+namespace xxx_put{
+namespace xxx_pipe{
+namespace xxx_csv{
+namespace xxx_std{
+
+ void test();
+
+}// xxx_std
+}// xxx_csv
+}// xxx_pipe
+}// xxx_put
+}// xxx_test_assign
+
+#endif
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk