summaryrefslogtreecommitdiff
path: root/synth/util.h
diff options
context:
space:
mode:
authorFlorian Jung <flo@thinkpad.(none)>2011-01-10 17:32:36 +0100
committerFlorian Jung <flo@thinkpad.(none)>2011-01-10 17:35:46 +0100
commit4b87549a645fd62107ddc5295a5027b2a5851096 (patch)
tree56601c12d5d3057fbd403c9c6b46e6b042073cb2 /synth/util.h
parenteb81cf5820770c54d33facaf09f7f79a17e272ed (diff)
Added str_before and str_after functions
str_before ("foo:bar:baz",':',"doesntmatter") returns "foo" str_after ("foo:bar:baz",':',"doesntmatter") returns "bar:baz" str_after and str_before ("foobar",':',"default") returns "default" Also, extract_var and extract_val now use the newly created functions
Diffstat (limited to 'synth/util.h')
-rw-r--r--synth/util.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/synth/util.h b/synth/util.h
index e571c7d..ad88954 100644
--- a/synth/util.h
+++ b/synth/util.h
@@ -28,4 +28,6 @@ string extract_val(string s);
string fileext(string f);
+string str_before(string s, char delim, string onfail="");
+string str_after(string s, char delim, string onfail="");
#endif