summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/libutil.h
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-03-16 15:48:28 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-03-16 15:48:28 +0000
commit54bfc8f5f26243e68353eeedb959864e6565de4c (patch)
treec7b82c5f497ab9f3bbfc5da435f60305738863ee /crawl-ref/source/libutil.h
parenteff8860c8c5cf24ffb3ff64e4b44af416d72b3d4 (diff)
downloadcrawl-ref-54bfc8f5f26243e68353eeedb959864e6565de4c.tar.gz
crawl-ref-54bfc8f5f26243e68353eeedb959864e6565de4c.zip
Added message_colour option to allow custom-colouring individual messages. This
does not affect formatted_mpr. Moved low magic warning to the danger channel and added a message_colour option to colour it lightcyan in the stock init.txt. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1050 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/libutil.h')
-rw-r--r--crawl-ref/source/libutil.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/crawl-ref/source/libutil.h b/crawl-ref/source/libutil.h
index d5b7bf081e..6baf428aa0 100644
--- a/crawl-ref/source/libutil.h
+++ b/crawl-ref/source/libutil.h
@@ -71,11 +71,17 @@ int cancelable_get_line( char *buf,
std::string & trim_string( std::string &str );
std::string trimmed_string( std::string s );
+// Splits string 's' on the separator 'sep'. If trim == true, trims each
+// segment. If accept_empties == true, accepts empty segments. If nsplits >= 0,
+// splits on the first nsplits occurrences of the separator, and stores the
+// remainder of the string as the last segment; negative values of nsplits
+// split on all occurrences of the separator.
std::vector<std::string> split_string(
const char *sep,
std::string s,
bool trim = true,
- bool accept_empties = false);
+ bool accept_empties = false,
+ int nsplits = -1);
inline std::string lowercase_first(std::string s)
{