Subversion Repositories gelsvn

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
667 khor 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
 
12
#ifndef __UTIL_STRING_UTILS_H
13
#define __UTIL_STRING_UTILS_H
14
 
15
#include <string>
16
#include <list>
17
 
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