WCharacter.h - Character utility functions for Wiring & Arduino
Copyright (c) 2010 Hernando Barragan. All right reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef Character_h
#define Character_h
#include <ctype.h>
#define isblank(C) (c==' '||c=='\t')
inline bool isAlphaNumeric(int c);
inline bool isAlpha(int c);
inline bool isAscii(int c);
inline bool isWhitespace(int c);
inline bool isControl(int c);
inline bool isDigit(int c);
inline bool isGraph(int c);
inline bool isLowerCase(int c);
inline bool isPrintable(int c);
inline bool isPunct(int c);
inline bool isSpace(int c);
inline bool isUpperCase(int c);
inline bool isHexadecimalDigit(int c);
inline int toAscii(int c);
inline int toLowerCase(int c);
inline int toUpperCase(int c);
inline bool isAlphaNumeric(int c)
{
return ( isalnum(c) == 0 ? false : true);
}
inline bool isAlpha(int c)
{
return ( isalpha(c) == 0 ? false : true);
}
inline bool isAscii(int c)
{
return ( isascii (c) == 0 ? false : true);
}
inline bool isWhitespace(int c)
{
return ( isblank (c) == 0 ? false : true);
}
inline bool isControl(int c)
{
return ( iscntrl (c) == 0 ? false : true);
}
inline bool isDigit(int c)
{
return ( isdigit (c) == 0 ? false : true);
}
inline bool isGraph(int c)
{
return ( isgraph (c) == 0 ? false : true);
}
inline bool isLowerCase(int c)
{
return (islower (c) == 0 ? false : true);
}
inline bool isPrintable(int c)
{
return ( isprint (c) == 0 ? false : true);
}
inline bool isPunct(int c)
{
return ( ispunct (c) == 0 ? false : true);
}
inline bool isSpace(int c)
{
return ( isspace (c) == 0 ? false : true);
}
inline bool isUpperCase(int c)
{
return ( isupper (c) == 0 ? false : true);
}
inline bool isHexadecimalDigit(int c)
{
return ( isxdigit (c) == 0 ? false : true);
}
inline int toAscii(int c)
{
return toascii (c);
}
inline int toLowerCase(int c)
{
return tolower (c);
}
inline int toUpperCase(int c)
{
return toupper (c);
}
#endif