claw 1.9.0
 
Loading...
Searching...
No Matches
string_algorithm.hpp
Go to the documentation of this file.
1/*
2 CLAW - a C++ Library Absolutely Wonderful
3
4 CLAW is a free library without any particular aim but being useful to
5 anyone.
6
7 Copyright (C) 2005-2011 Julien Jorge
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; either
12 version 2.1 of the License, or (at your option) any later version.
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 St, Fifth Floor, Boston, MA 02110-1301 USA
22
23 contact: julien.jorge@stuff-o-matic.com
24*/
30#ifndef __CLAW_STRING_ALGORITHM_HPP__
31#define __CLAW_STRING_ALGORITHM_HPP__
32
33#include <cstddef>
34
35namespace claw
36{
37 namespace text
38 {
39 template <typename StreamType, typename StringType>
40 StreamType& getline(StreamType& is, StringType& str);
41
42 template <typename StringType>
43 void trim_left(StringType& str,
44 const typename StringType::value_type* const s = " ");
45
46 template <typename StringType>
47 void trim_right(StringType& str,
48 const typename StringType::value_type* const s = " ");
49
50 template <typename StringType>
51 void trim(StringType& str,
52 const typename StringType::value_type* const s = " ");
53
54 template <typename StringType>
55 void squeeze(StringType& str,
56 const typename StringType::value_type* const s);
57
58 template <typename StringType>
59 std::size_t replace(StringType& str, const StringType& e1,
60 const StringType& e2);
61
62 template <typename T, typename StringType>
63 bool is_of_type(const StringType& str);
64
65 template <typename Sequence>
66 void split(Sequence& sequence, const typename Sequence::value_type& str,
67 const typename Sequence::value_type::value_type sep);
68
69 template <typename Sequence>
70 void split(Sequence& sequence,
71 typename Sequence::value_type::const_iterator first,
72 typename Sequence::value_type::const_iterator last,
73 const typename Sequence::value_type::value_type sep);
74
75 template <typename InputIterator, typename OutputIterator>
76 void c_escape(InputIterator first, InputIterator last, OutputIterator out);
77
78 template <typename StringType>
79 bool glob_match(const StringType& pattern, const StringType& text,
80 const typename StringType::value_type any_sequence = '*',
81 const typename StringType::value_type zero_or_one = '?',
82 const typename StringType::value_type any = '.');
83
84 template <typename StringType>
85 bool glob_potential_match(
86 const StringType& pattern, const StringType& text,
87 const typename StringType::value_type any_sequence = '*',
88 const typename StringType::value_type zero_or_one = '?',
89 const typename StringType::value_type any = '.');
90
91 }
92}
93
94#include <claw/string_algorithm.tpp>
95
96#endif // __CLAW_STRING_ALGORITHM_HPP__
Everything about text processing.
Definition claw.hpp:88
This is the main namespace.