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