PageRenderTime 26ms CodeModel.GetById 18ms app.highlight 5ms RepoModel.GetById 2ms app.codeStats 0ms

/indra/llcommon/llboost.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 58 lines | 17 code | 5 blank | 36 comment | 2 complexity | b27e97a44f84a235d69ed036bd7de4ed MD5 | raw file
 1/** 
 2 * @file llboost.h
 3 * @brief helper object & functions for use with boost
 4 *
 5 * $LicenseInfo:firstyear=2005&license=viewerlgpl$
 6 * Second Life Viewer Source Code
 7 * Copyright (C) 2010, Linden Research, Inc.
 8 * 
 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation;
12 * version 2.1 of the License only.
13 * 
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17 * Lesser General Public License for more details.
18 * 
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
22 * 
23 * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
24 * $/LicenseInfo$
25 */
26
27#ifndef LL_LLBOOST_H
28#define LL_LLBOOST_H
29
30#include <boost/tokenizer.hpp>
31
32// boost_tokenizer typedef
33/* example usage:
34	boost_tokenizer tokens(input_string, boost::char_separator<char>(" \t\n"));
35	for (boost_tokenizer::iterator token_iter = tokens.begin(); token_iter != tokens.end(); ++token_iter)
36	{
37		std::string tok = *token_iter;
38		process_token_string( tok );
39	}
40*/
41typedef boost::tokenizer<boost::char_separator<char> > boost_tokenizer;
42
43// Useful combiner for boost signals that return a bool (e.g. validation)
44//  returns false if any of the callbacks return false
45struct boost_boolean_combiner
46{
47	typedef bool result_type;
48	template<typename InputIterator>
49	bool operator()(InputIterator first, InputIterator last) const
50	{
51		bool res = true;
52		while (first != last)
53			res &= *first++;
54		return res;
55	}
56};
57
58#endif // LL_LLBOOST_H