aGrUM  0.14.2
utils_string.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2005 by Christophe GONZALES and Pierre-Henri WUILLEMIN *
3  * {prenom.nom}_at_lip6.fr *
4  * *
5  * This program is free software; you can redistribute it and/or modify *
6  * it under the terms of the GNU General Public License as published by *
7  * the Free Software Foundation; either version 2 of the License, or *
8  * (at your option) any later version. *
9  * *
10  * This program is distributed in the hope that it will be useful, *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13  * GNU General Public License for more details. *
14  * *
15  * You should have received a copy of the GNU General Public License *
16  * along with this program; if not, write to the *
17  * Free Software Foundation, Inc., *
18  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19  ***************************************************************************/
27 #ifndef GUM_UTILS_STRING_H
28 #define GUM_UTILS_STRING_H
29 
30 #include <cstdlib>
31 #include <sstream>
32 #include <string>
33 #include <vector>
34 
35 #include <agrum/agrum.h>
36 
37 #ifndef HAVE_MKSTEMP // mainly windows
38 # include <io.h>
39 #endif
40 
41 namespace gum {
44 
49  std::string getUniqueFileName();
50 
55  std::string toLower(std::string str);
56 
61  bool endsWith(std::string const& value, std::string const& ending);
62 
69  std::vector< std::string > split(const std::string& orig,
70  const std::string& delimiter);
71 
79  std::string replace(const std::string& s,
80  const std::string& val,
81  const std::string& new_val);
82 
84 } /* namespace gum */
85 
86 #ifndef GUM_NO_INLINE
88 #endif // GUM_NO_INLINE
89 
90 #endif /* GUM_UTILS_STRING_H */
std::string getUniqueFileName()
Returns a path to a unique file name.
Contains usefull methods for random stuff.
gum is the global namespace for all aGrUM entities
Definition: agrum.h:25
std::vector< std::string > split(const std::string &str, const std::string &delim)
Split str using the delimiter.
bool endsWith(std::string const &value, std::string const &ending)
Returns true if value ends with ending.
std::string toLower(std::string str)
Returns the lowercase version of str.
std::string replace(const std::string &s, const std::string &val, const std::string &new_val)
not usable for gcc 4.8 std::vector<std::string> split( const std::string& orig, const std::string& de...