source: trunk/yat/split.h @ 1152

Last change on this file since 1152 was 1152, checked in by Peter Johansson, 13 years ago

allow config file to override svn property (fixes #326). Adding two new files (split.h and split.cc) from yat.

  • Property svn:eol-style set to native
File size: 1.5 KB
Line 
1#ifndef _theplu_yat_utility_split_
2#define _theplu_yat_utility_split_
3
4// $Id: split.h 2305 2010-08-02 14:14:32Z peter $
5
6/*
7  Copyright (C) 2010 Peter Johansson
8
9  This file is part of the yat library, http://dev.thep.lu.se/yat
10
11  The yat library is free software; you can redistribute it and/or
12  modify it under the terms of the GNU General Public License as
13  published by the Free Software Foundation; either version 3 of the
14  License, or (at your option) any later version.
15
16  The yat library is distributed in the hope that it will be useful,
17  but WITHOUT ANY WARRANTY; without even the implied warranty of
18  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19  General Public License for more details.
20
21  You should have received a copy of the GNU General Public License
22  along with yat. If not, see <http://www.gnu.org/licenses/>.
23*/
24
25#include <string>
26#include <vector>
27
28namespace theplu {
29namespace yat {
30namespace utility {
31
32  /**
33     \brief split a string into several substrings
34
35     Split \a str with respect to \a delim and place result in \a
36     result. If \a str contains N \a delim, the resulting \a result
37     will hold N+1 elements (given that it was empty to start
38     with). If first or loast character in \a str is \a delim,
39     corresponding element in \a result will be empty string ("").
40
41     \since New in yat 0.7
42   */
43  void split(std::vector<std::string>& result, const std::string& str, 
44             char delim);
45
46}}} // of namespace utility, yat, and theplu
47
48#endif
Note: See TracBrowser for help on using the repository browser.