1 // Copyright (c) 1998-1999 Matra Datavision
2 // Copyright (c) 1999-2014 OPEN CASCADE SAS
4 // This file is part of Open CASCADE Technology software library.
6 // This library is free software; you can redistribute it and/or modify it under
7 // the terms of the GNU Lesser General Public License version 2.1 as published
8 // by the Free Software Foundation, with special exception defined in the file
9 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
10 // distribution for complete text of the license and disclaimer of any warranty.
12 // Alternatively, this file may be used under the terms of Open CASCADE
13 // commercial license or contractual agreement.
15 //============================================================================
16 //==== Titre: Standard_ExtCharacter.hxx
17 //==== Role : The headr file of primitve type "ExtCharacter" from package
20 //==== Implementation: This is a primitive type implemented with typedef
21 //==== Excepting "Unicod encoding"
22 //============================================================================
24 #ifndef _Standard_ExtCharacter_HeaderFile
25 #define _Standard_ExtCharacter_HeaderFile
27 #include <Standard_TypeDef.hxx>
28 #include <Standard_OStream.hxx>
36 // ------------------------------------------------------------------
37 // ToExtCharacter : Returns an ExtCharacter from a Character
38 // ------------------------------------------------------------------
39 inline Standard_ExtCharacter ToExtCharacter(const Standard_Character achar)
41 // extension a zero (partie haute-->octet de gauche) de achar
42 return (Standard_ExtCharacter)( (unsigned char)achar & 0x00ff );
45 // ------------------------------------------------------------------
46 // ToCharacter : Returns an Character from an ExtCharacter
47 // ------------------------------------------------------------------
48 inline Standard_Character ToCharacter(const Standard_ExtCharacter achar)
50 // recuperer partie basse(octet de droite) de achar
51 return (Standard_Character)(unsigned char)(achar & 0x00ff);
54 // ------------------------------------------------------------------
55 // IsAnAscii : Returns True if an ExtCharacter is in the "Ascii Range"
56 // ------------------------------------------------------------------
57 inline Standard_Boolean IsAnAscii(const Standard_ExtCharacter achar)
59 return ! ( achar & 0xff00 );
62 // ------------------------------------------------------------------
63 // IsEqual : Returns Standard_True if two characters have the same value
64 // ------------------------------------------------------------------
65 inline Standard_Boolean IsEqual(const Standard_ExtCharacter One,
66 const Standard_ExtCharacter Two)
67 { return One == Two; }