From 5e94dac9e3537693dfaa1647c143959d1ce5e069 Mon Sep 17 00:00:00 2001 From: dshaligram Date: Tue, 12 Dec 2006 13:49:05 +0000 Subject: Better explore-stop messages. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@619 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/libutil.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'crawl-ref/source/libutil.h') diff --git a/crawl-ref/source/libutil.h b/crawl-ref/source/libutil.h index 0009f28882..e14c65d206 100644 --- a/crawl-ref/source/libutil.h +++ b/crawl-ref/source/libutil.h @@ -15,6 +15,7 @@ #include "AppHdr.h" #include "defines.h" +#include #include #include @@ -67,6 +68,32 @@ std::vector split_string( bool trim = true, bool accept_empties = false); +inline std::string lowercase_first(std::string s) +{ + if (s.length()) + s[0] = tolower(s[0]); + return (s); +} + +template +std::string comma_separated_line(Z start, Z end) +{ + std::string text; + for (Z i = start; i != end; ++i) + { + if (i != start) + { + if (i + 1 != end) + text += ", "; + else + text += " and "; + } + + text += i->name; + } + return (text); +} + #ifdef NEED_USLEEP void usleep( unsigned long time ); #endif -- cgit v1.2.3-54-g00ecf