]> git.tdb.fi Git - libs/core.git/blobdiff - source/utils.h
Add utility functions to check the contents of a string
[libs/core.git] / source / utils.h
index 5492f9558ea4b22a36fcee2a4bcc437c4cfd4b88..44c2edb86c19abcaa003498e7385f31a911b3822 100644 (file)
@@ -1,7 +1,7 @@
 /* $Id$
 
 This file is part of libmspstrings
-Copyright © 2006-2007 Mikko Rasa
+Copyright © 2006-2008 Mikko Rasa
 Distributed under the LGPL
 */
 
@@ -33,6 +33,28 @@ Converts a string to upper case.
 */
 std::string toupper(const std::string &);
 
+/**
+Checks whether a string consists of digits only.
+*/
+bool isnumrc(const std::string &);
+
+/**
+Checks whether a string consists of alphabetic characters only.
+*/
+bool isalpha(const std::string &);
+
+/**
+Checks whether a string consists of alphanumeric characters only.
+*/
+bool isalnum(const std::string &);
+
+/* These are required to make the standard version work from inside the Msp
+namespace */
+using std::tolower;
+using std::toupper;
+using std::isalpha;
+using std::isalnum;
+
 /**
 Splits a string at occurrences of any of the characters in sep.  If max_split
 is non-negative, at most that many split will be performed, i.e. the resulting