1 // Copyright Vladimir Prus 2004.
\r
2 // Distributed under the Boost Software License, Version 1.0.
\r
3 // (See accompanying file LICENSE_1_0.txt
\r
4 // or copy at http://www.boost.org/LICENSE_1_0.txt)
\r
6 #ifndef BOOST_ENVIRONMENT_ITERATOR_VP_2004_05_14
\r
7 #define BOOST_ENVIRONMENT_ITERATOR_VP_2004_05_14
\r
9 #include "eof_iterator.hpp"
\r
17 class environment_iterator
\r
18 : public eof_iterator<environment_iterator,
\r
19 std::pair<std::string, std::string> >
\r
22 environment_iterator(char** environment)
\r
23 : m_environment(environment)
\r
28 environment_iterator()
\r
35 if (*m_environment == 0)
\r
38 std::string s(*m_environment);
\r
39 std::string::size_type n = s.find('=');
\r
40 assert(n != s.npos);
\r
41 value().first = s.substr(0, n);
\r
42 value().second = s.substr(n+1);
\r
48 char** m_environment;
\r