]> git.lyx.org Git - lyx.git/blobdiff - src/support/lstrings.h
add generic helper class for calling functions in gui thread
[lyx.git] / src / support / lstrings.h
index 036a91c566a3639be983accfc041cd58302d33cd..c04357ec7a8dc0e5473579fe153db7c98d4970cb 100644 (file)
@@ -44,6 +44,9 @@ bool isStrUnsignedInt(std::string const & str);
 ///
 bool isStrDbl(std::string const & str);
 
+/// does the string contain a digit?
+bool hasDigit(docstring const & str);
+
 bool isHex(docstring const & str);
 
 int hexToInt(docstring const & str);
@@ -80,6 +83,12 @@ char_type lowercase(char_type c);
 /// Does not depend on the locale.
 char_type uppercase(char_type c);
 
+/// Checks if the supplied character is lower-case
+bool isLowerCase(char_type ch);
+
+/// Checks if the supplied character is upper-case
+bool isUpperCase(char_type ch);
+
 /// same as lowercase(), but ignores locale
 std::string const ascii_lowercase(std::string const &);
 docstring const ascii_lowercase(docstring const &);
@@ -170,6 +179,9 @@ std::string const subst(std::string const & a,
 docstring const subst(docstring const & a,
                docstring const & oldstr, docstring const & newstr);
 
+/// Count all occurences of char \a chr inside \a str
+int count_char(docstring const & str, docstring::value_type chr);
+
 /** Trims characters off the end and beginning of a string.
     \code
     trim("ccabccc", "c") == "ab".
@@ -202,7 +214,7 @@ std::string const ltrim(std::string const & a, char const * p = " ");
 docstring const ltrim(docstring const & a, char const * p = " ");
 
 /** Splits the string given in the first argument at the first occurence 
-    of the third argumnent, delim.
+    of the third argument, delim.
     What precedes delim is returned in the second argument, piece; this
     will be the whole of the string if no delimiter is found.
     The return value is what follows delim, if anything. So the return
@@ -282,6 +294,7 @@ template<> docstring bformat(docstring const & fmt, unsigned int arg1);
 template<> docstring bformat(docstring const & fmt, docstring arg1);
 template<> docstring bformat(docstring const & fmt, char * arg1);
 template<> docstring bformat(docstring const & fmt, docstring arg1, docstring arg2);
+template<> docstring bformat(docstring const & fmt, docstring arg1, int arg2);
 template<> docstring bformat(docstring const & fmt, char const * arg1, docstring arg2);
 template<> docstring bformat(docstring const & fmt, int arg1, int arg2);
 template<> docstring bformat(docstring const & fmt, docstring arg1, docstring arg2, docstring arg3);