summaryrefslogtreecommitdiff
path: root/base/str.hh
diff options
context:
space:
mode:
authorKevin Lim <ktlim@umich.edu>2005-02-11 17:54:42 -0500
committerKevin Lim <ktlim@umich.edu>2005-02-11 17:54:42 -0500
commit79e83cea971bf346a5b0d6e88541e502a614c777 (patch)
treee1561f7044a4b3ee79a960d57451716af53387b5 /base/str.hh
parentc4d0ebd25cc5f0657b99543ff2df30d1a86f3ad5 (diff)
parent10ee909fbd895b588bf01021af98e81a3ae40fc0 (diff)
downloadgem5-79e83cea971bf346a5b0d6e88541e502a614c777.tar.xz
Merge ktlim@zizzer.eecs.umich.edu:/bk/m5
into zamp.eecs.umich.edu:/z/ktlim2/m5 --HG-- extra : convert_revision : 11832134b169aa827a1d03c96ef89edddf4b3dab
Diffstat (limited to 'base/str.hh')
-rw-r--r--base/str.hh14
1 files changed, 14 insertions, 0 deletions
diff --git a/base/str.hh b/base/str.hh
index 812f4d41a..41433f2bd 100644
--- a/base/str.hh
+++ b/base/str.hh
@@ -90,6 +90,20 @@ to_lower(const std::string &s)
return lower;
}
+// Split the string s into lhs and rhs on the first occurence of the
+// character c.
+bool
+split_first(const std::string &s, std::string &lhs, std::string &rhs, char c);
+
+// Split the string s into lhs and rhs on the last occurence of the
+// character c.
+bool
+split_last(const std::string &s, std::string &lhs, std::string &rhs, char c);
+
+// Tokenize the string <s> splitting on the character <token>, and
+// place the result in the string vector <vector>. If <ign> is true,
+// then empty result strings (due to trailing tokens, or consecutive
+// tokens) are skipped.
void
tokenize(std::vector<std::string> &vector, const std::string &s,
char token, bool ign = true);