aboutsummaryrefslogtreecommitdiff
path: root/build2/utility
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-03-07 12:29:50 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-03-07 12:29:50 +0200
commitb7c0293598d45f052a41c3ed6580d98801280cd7 (patch)
tree19f519f8ebf4e9da6db31eed54ba8e8ee778907d /build2/utility
parent6fa958ee23d0beb62f687d3d9137c774b4960197 (diff)
Implement compiler guessing, including icc and msvc
Diffstat (limited to 'build2/utility')
-rw-r--r--build2/utility34
1 files changed, 34 insertions, 0 deletions
diff --git a/build2/utility b/build2/utility
index 187834e..47eaf7d 100644
--- a/build2/utility
+++ b/build2/utility
@@ -33,6 +33,40 @@ namespace build2
//
using butl::reverse_iterate;
+ // Basic string utilities.
+ //
+
+ // Trim leading/trailing whitespacec, including '\r'.
+ //
+ string&
+ trim (string&);
+
+ // Find the beginning and end poistions of the next word. Return the size
+ // of the word or 0 and set b = e = n if there are no more words. For
+ // example:
+ //
+ // for (size_t b (0), e (0); next_word (s, b, e); )
+ // {
+ // string w (s, b, e - b);
+ // }
+ //
+ // Or:
+ //
+ // for (size_t b (0), e (0), n; n = next_word (s, b, e, ' ', ','); )
+ // {
+ // string w (s, b, n);
+ // }
+ //
+ // The second version examines up to the n'th character in the string.
+ //
+ size_t
+ next_word (const string&, size_t& b, size_t& e,
+ char d1 = ' ', char d2 = '\0');
+
+ size_t
+ next_word (const string&, size_t n, size_t& b, size_t& e,
+ char d1 = ' ', char d2 = '\0');
+
// Empty string and path.
//
extern const std::string empty_string;