Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-13 09:17:46

0001 // Copyright (c) 1998-1999 Matra Datavision
0002 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0003 //
0004 // This file is part of Open CASCADE Technology software library.
0005 //
0006 // This library is free software; you can redistribute it and/or modify it under
0007 // the terms of the GNU Lesser General Public License version 2.1 as published
0008 // by the Free Software Foundation, with special exception defined in the file
0009 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0010 // distribution for complete text of the license and disclaimer of any warranty.
0011 //
0012 // Alternatively, this file may be used under the terms of Open CASCADE
0013 // commercial license or contractual agreement.
0014 
0015 //============================================================================
0016 //==== Title: char16_t.hxx
0017 //==== Role : The headr file of primitive type "ExtCharacter" from package "Standard"
0018 //====
0019 //==== Implementation:  This is a primitive type implemented with typedef
0020 //====                  Excepting "Unicod encoding"
0021 //============================================================================
0022 
0023 #ifndef _Standard_ExtCharacter_HeaderFile
0024 #define _Standard_ExtCharacter_HeaderFile
0025 
0026 #include <Standard_TypeDef.hxx>
0027 
0028 // ===============
0029 // inline methods
0030 // ===============
0031 
0032 // ------------------------------------------------------------------
0033 // ToExtCharacter : Returns an ExtCharacter from a Character
0034 // ------------------------------------------------------------------
0035 inline char16_t ToExtCharacter(const char achar)
0036 {
0037   //  extension a zero (partie haute-->octet de gauche) de achar
0038   return (char16_t)((unsigned char)achar & 0x00ff);
0039 }
0040 
0041 // ------------------------------------------------------------------
0042 // ToCharacter : Returns an Character from an ExtCharacter
0043 // ------------------------------------------------------------------
0044 inline char ToCharacter(const char16_t achar)
0045 {
0046   //  recuperer partie basse(octet de droite) de achar
0047   return (char)(unsigned char)(achar & 0x00ff);
0048 }
0049 
0050 // ------------------------------------------------------------------
0051 // IsAnAscii : Returns True if an ExtCharacter is in the "Ascii Range"
0052 // ------------------------------------------------------------------
0053 inline bool IsAnAscii(const char16_t achar)
0054 {
0055   return !(achar & 0xff00);
0056 }
0057 
0058 // ------------------------------------------------------------------
0059 // IsEqual : Returns true if two characters have the same value
0060 // ------------------------------------------------------------------
0061 inline bool IsEqual(const char16_t One, const char16_t Two)
0062 {
0063   return One == Two;
0064 }
0065 
0066 #endif