595 |
jab |
1 |
/* ----------------------------------------------------------------------- *
|
|
|
2 |
* This file is part of GEL, http://www.imm.dtu.dk/GEL
|
|
|
3 |
* Copyright (C) the authors and DTU Informatics
|
|
|
4 |
* For license and list of authors, see ../../doc/intro.pdf
|
|
|
5 |
* ----------------------------------------------------------------------- */
|
|
|
6 |
|
|
|
7 |
/**
|
|
|
8 |
* @file string_utils.h
|
|
|
9 |
* @brief Split a string into pieces.
|
|
|
10 |
*/
|
|
|
11 |
|
448 |
jab |
12 |
#ifndef __UTIL_STRING_UTILS_H
|
|
|
13 |
#define __UTIL_STRING_UTILS_H
|
375 |
jrf |
14 |
|
510 |
jrf |
15 |
#include <string>
|
|
|
16 |
#include <list>
|
|
|
17 |
|
375 |
jrf |
18 |
namespace Util
|
|
|
19 |
{
|
|
|
20 |
std::string trim(const std::string& s, const std::string& wspaces);
|
|
|
21 |
std::string trim(const std::string& s);
|
|
|
22 |
void split(const std::string& s, std::list<std::string>& result, const std::string& delim);
|
|
|
23 |
void split(const std::string& s, std::list<std::string>& result);
|
|
|
24 |
void trim_split(const std::string& s, std::list<std::string>& result, const std::string& delim);
|
|
|
25 |
void trim_split(const std::string& s, std::list<std::string>& result);
|
|
|
26 |
void get_first(std::string& s, std::string& first);
|
|
|
27 |
void get_last(std::string& s, std::string& last);
|
|
|
28 |
}
|
|
|
29 |
|
|
|
30 |
#endif // STRING_UTILS_H
|