0027772: Foundation Classes - define Standard_Boolean using C++ type "bool" instead...
[occt.git] / src / Standard / Standard_Character.hxx
old mode 100755 (executable)
new mode 100644 (file)
index 924a3c6..d34e156
@@ -1,20 +1,16 @@
 // Copyright (c) 1998-1999 Matra Datavision
-// Copyright (c) 1999-2012 OPEN CASCADE SAS
+// Copyright (c) 1999-2014 OPEN CASCADE SAS
 //
-// The content of this file is subject to the Open CASCADE Technology Public
-// License Version 6.5 (the "License"). You may not use the content of this file
-// except in compliance with the License. Please obtain a copy of the License
-// at http://www.opencascade.org and read it completely before using this file.
+// This file is part of Open CASCADE Technology software library.
 //
-// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
-// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
 //
-// The Original Code and all software distributed under the License is
-// distributed on an "AS IS" basis, without warranty of any kind, and the
-// Initial Developer hereby disclaims all such warranties, including without
-// limitation, any warranties of merchantability, fitness for a particular
-// purpose or non-infringement. Please see the License for the specific terms
-// and conditions governing the rights and limitations under the License.
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
 
 //============================================================================
 //==== Titre: Standard_Character.hxx
 #ifndef _Standard_Character_HeaderFile
 #define _Standard_Character_HeaderFile
 
-#ifndef _Standard_ctype_HeaderFile
-#include <Standard_ctype.hxx>
-#endif
-
-#include <string.h>
-
-#ifndef _Standard_TypeDef_HeaderFile
 #include <Standard_TypeDef.hxx>
-#endif
 
-class Handle_Standard_Type;
-
-__Standard_API const Handle_Standard_Type& Standard_Character_Type_();
-
-//class Standard_OStream;
-//void ShallowDump (const Standard_Character, Standard_OStream& );
-// =====================================
-// Method implemented in Standard_Character.cxx
-// =====================================
-__Standard_API Standard_Integer   HashCode(const Standard_Character, const Standard_Integer);
-
-// ===============================================
-// Methods from Standard_Entity class which are redefined:  
-//    - Hascode
-//    - IsEqual
-//    - IsSimilar
-//    - Shallowcopy
-//    - ShallowDump
-// ===============================================
-
-// ===============
-// inline methods 
-// ===============
+#include <string.h>
+#include <cctype>
 
 // ------------------------------------------------------------------
 // IsEqual : Returns Standard_True if two characters have the same value
@@ -69,13 +36,6 @@ inline Standard_Boolean IsEqual(const Standard_Character One,
                                const Standard_Character Two)
 { return One == Two; }
 
-// ------------------------------------------------------------------
-// IsSimilar : Returns Standard_True if two characters have the same value
-// ------------------------------------------------------------------
-inline Standard_Boolean IsSimilar(const Standard_Character One, 
-                                 const Standard_Character Two)
-{ return One == Two; }
-
 // ===============================================
 // Character classification functions
 //
@@ -95,19 +55,19 @@ inline Standard_Boolean IsSimilar(const Standard_Character One,
 // IsAlphabetic : Returns Standard_True if a character is alphabetic
 // ==================================================================
 inline Standard_Boolean IsAlphabetic(const Standard_Character me) 
-{ return isalpha((unsigned char)me); }
+{ return std::isalpha ((unsigned char)me) != 0; }
 
 // ==================================================================
 // IsDigit : Returns Standard_True if a character is a digit
 // ==================================================================
 inline Standard_Boolean IsDigit(const Standard_Character me) 
-{ return isdigit((unsigned char)me); }
+{ return std::isdigit ((unsigned char)me) != 0; }
 
 // ==================================================================
 // IsXDigit : Returns Standard_True if a character is a digit
 // ==================================================================
 inline Standard_Boolean IsXDigit(const Standard_Character me) 
-{ return isxdigit((unsigned char)me); }
+{ return std::isxdigit((unsigned char)me) != 0; }
 
 // ==================================================================
 // IsAlphanumeric : Returns Standard_True if a character is alphanumeric
@@ -119,26 +79,26 @@ inline Standard_Boolean IsAlphanumeric(const Standard_Character me)
 // IsControl : Returns Standard_True if a character  is a control character
 // ==================================================================
 inline Standard_Boolean IsControl(const Standard_Character me) 
-{ return iscntrl((unsigned char)me); }
+{ return std::iscntrl((unsigned char)me) != 0; }
 
 
 // ==================================================================
 // IsGraphic : Returns Standard_True if a character is graphic
 // ==================================================================
 inline Standard_Boolean IsGraphic(const Standard_Character me) 
-{ return isgraph((unsigned char)me); }
+{ return std::isgraph((unsigned char)me) != 0; }
 
 // ==================================================================
 // IsLowerCase : Returns Standard_True if a character is lowercase
 // ==================================================================
 inline Standard_Boolean IsLowerCase(const Standard_Character me) 
-{ return islower((unsigned char)me); }
+{ return std::islower((unsigned char)me) != 0; }
 
 // ==================================================================
 // IsPrintable : Returns Standard_True if a character is printable
 // ==================================================================
 inline Standard_Boolean IsPrintable(const Standard_Character me) 
-{ return isprint((unsigned char)me); }
+{ return std::isprint((unsigned char)me) != 0; }
 
 // ==================================================================
 // IsPunctuation : Returns Standard_True if a character is a graphic and 
@@ -151,44 +111,24 @@ inline Standard_Boolean IsPunctuation(const Standard_Character me)
 // IsSpace : Returns Standard_True if a character is a space
 // ==================================================================
 inline Standard_Boolean IsSpace(const Standard_Character me) 
-{ return isspace((unsigned char)me); }
+{ return std::isspace((unsigned char)me) != 0; }
 
 // ==================================================================
 // IsUppercase : Returns Standard_True if a character is uppercase
 // ==================================================================
 inline Standard_Boolean IsUpperCase(const Standard_Character me) 
-{ return isupper((unsigned char)me); }
+{ return std::isupper((unsigned char)me) != 0; }
 
 // ==================================================================
 // LowerCase : Returns a lowercase character
 // ==================================================================
 inline Standard_Character LowerCase(const Standard_Character me) 
-{ return (Standard_Character)(unsigned char)tolower(me); }
+{ return (Standard_Character)(unsigned char)std::tolower(me); }
 
 // ==================================================================
 // UpperCase : Returns a uppercase character
 // ==================================================================
 inline Standard_Character UpperCase(const Standard_Character me) 
-{ return (Standard_Character)(unsigned char)toupper(me); }
-
-// ------------------------------------------------------------------
-// ShallowCopy : Make a copy of one Character
-// ------------------------------------------------------------------
-inline Standard_Character ShallowCopy (const Standard_Character me) 
-{ return me; }
+{ return (Standard_Character)(unsigned char)std::toupper(me); }
 
 #endif
-
-
-
-
-
-
-
-
-
-
-
-
-
-