diff options
author | lloyd <[email protected]> | 2009-11-17 15:54:50 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2009-11-17 15:54:50 +0000 |
commit | 57199e2a8ec339c9cccb5c837416f91119936213 (patch) | |
tree | ebf6d03087473ad36b6765c1323b2bb99616ff0c | |
parent | 7a24783fd58b21e1ea59615025806663e5f231eb (diff) |
Replace the Pipe constructor taking a Filter*[] and a length with one taking a
initializer_list<Filter*>
-rw-r--r-- | src/filters/pipe.cpp | 7 | ||||
-rw-r--r-- | src/filters/pipe.h | 7 |
2 files changed, 8 insertions, 6 deletions
diff --git a/src/filters/pipe.cpp b/src/filters/pipe.cpp index 33824be24..d43868e3f 100644 --- a/src/filters/pipe.cpp +++ b/src/filters/pipe.cpp @@ -51,11 +51,12 @@ Pipe::Pipe(Filter* f1, Filter* f2, Filter* f3, Filter* f4) /* * Pipe Constructor */ -Pipe::Pipe(Filter* filter_array[], u32bit count) +Pipe::Pipe(std::initializer_list<Filter*> args) { init(); - for(u32bit j = 0; j != count; ++j) - append(filter_array[j]); + + for(auto i = args.begin(); i != args.end(); ++i) + append(*i); } /* diff --git a/src/filters/pipe.h b/src/filters/pipe.h index 120f2fbdd..7cf7d6df2 100644 --- a/src/filters/pipe.h +++ b/src/filters/pipe.h @@ -11,6 +11,7 @@ #include <botan/data_src.h> #include <botan/filter.h> #include <botan/exceptn.h> +#include <initializer_list> #include <iosfwd> namespace Botan { @@ -238,11 +239,11 @@ class BOTAN_DLL Pipe : public DataSource Pipe(Filter* = 0, Filter* = 0, Filter* = 0, Filter* = 0); /** - * Construct a Pipe from range of filters passed as an array + * Construct a Pipe from a list of filters * @param filters the set of filters to use - * @param count the number of elements in filters */ - Pipe(Filter* filters[], u32bit count); + Pipe(std::initializer_list<Filter*> filters); + ~Pipe(); private: Pipe(const Pipe&) : DataSource() {} |