/usr/include/oce/Standard_Character.hxx is in liboce-foundation-dev 0.17.2-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 | // Copyright (c) 1998-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// 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.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
//============================================================================
//==== Titre: Standard_Character.hxx
//==== Role : The header file of primitve type "Character" from package
//==== "Standard"
//====
//==== Implementation: This is a primitive type implemented as typedef
//==== typedef char Standard_Character
//============================================================================
#ifndef _Standard_Character_HeaderFile
#define _Standard_Character_HeaderFile
#include <Standard_TypeDef.hxx>
#include <string.h>
#include <cctype>
// ------------------------------------------------------------------
// IsEqual : Returns Standard_True if two characters have the same value
// ------------------------------------------------------------------
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
//
// NOTE: Character classification routines in C standard library
// (isdigit(), isalpha() etc.) have integer argument instead of char.
// Therefore if character from extended Ascii part of char table
// (i.e. above 128) is passed into such functions it is converted
// to int giving negative value (if characters are signed that
// is default for most compilers).
// It can be dangerous since implementation of these C functions
// may use argument as index in the array without any checks
// (for instance, in Microsoft VC++ -- see MSDN)
// To avoid this, we cast char to unsigned char when passing to these functions.
// ===============================================
// ==================================================================
// IsAlphabetic : Returns Standard_True if a character is alphabetic
// ==================================================================
inline Standard_Boolean IsAlphabetic(const Standard_Character me)
{ return 0 != std::isalpha ((unsigned char)me); }
// ==================================================================
// IsDigit : Returns Standard_True if a character is a digit
// ==================================================================
inline Standard_Boolean IsDigit(const Standard_Character me)
{ return 0 != std::isdigit ((unsigned char)me); }
// ==================================================================
// IsXDigit : Returns Standard_True if a character is a digit
// ==================================================================
inline Standard_Boolean IsXDigit(const Standard_Character me)
{ return 0 != std::isxdigit((unsigned char)me); }
// ==================================================================
// IsAlphanumeric : Returns Standard_True if a character is alphanumeric
// ==================================================================
inline Standard_Boolean IsAlphanumeric(const Standard_Character me)
{ return (IsAlphabetic(me) || IsDigit(me)) ; }
// ==================================================================
// IsControl : Returns Standard_True if a character is a control character
// ==================================================================
inline Standard_Boolean IsControl(const Standard_Character me)
{ return 0 != std::iscntrl((unsigned char)me); }
// ==================================================================
// IsGraphic : Returns Standard_True if a character is graphic
// ==================================================================
inline Standard_Boolean IsGraphic(const Standard_Character me)
{ return 0 != std::isgraph((unsigned char)me); }
// ==================================================================
// IsLowerCase : Returns Standard_True if a character is lowercase
// ==================================================================
inline Standard_Boolean IsLowerCase(const Standard_Character me)
{ return 0 != std::islower((unsigned char)me); }
// ==================================================================
// IsPrintable : Returns Standard_True if a character is printable
// ==================================================================
inline Standard_Boolean IsPrintable(const Standard_Character me)
{ return 0 != std::isprint((unsigned char)me); }
// ==================================================================
// IsPunctuation : Returns Standard_True if a character is a graphic and
// not a alphanumeric character
// ==================================================================
inline Standard_Boolean IsPunctuation(const Standard_Character me)
{ return ( IsGraphic(me) && !IsAlphanumeric(me)); }
// ==================================================================
// IsSpace : Returns Standard_True if a character is a space
// ==================================================================
inline Standard_Boolean IsSpace(const Standard_Character me)
{ return 0 != std::isspace((unsigned char)me); }
// ==================================================================
// IsUppercase : Returns Standard_True if a character is uppercase
// ==================================================================
inline Standard_Boolean IsUpperCase(const Standard_Character me)
{ return 0 != std::isupper((unsigned char)me); }
// ==================================================================
// LowerCase : Returns a lowercase character
// ==================================================================
inline Standard_Character LowerCase(const Standard_Character 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)std::toupper(me); }
#endif
|