0029915: Porting to VC 2017 : Regressions in Modeling Algorithms on VC 2017
[occt.git] / src / Standard / Standard_ExtCharacter.hxx
CommitLineData
b311480e 1// Copyright (c) 1998-1999 Matra Datavision
973c2be1 2// Copyright (c) 1999-2014 OPEN CASCADE SAS
b311480e 3//
973c2be1 4// This file is part of Open CASCADE Technology software library.
b311480e 5//
d5f74e42 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
973c2be1 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.
b311480e 11//
973c2be1 12// Alternatively, this file may be used under the terms of Open CASCADE
13// commercial license or contractual agreement.
b311480e 14
7fd59977 15//============================================================================
16//==== Titre: Standard_ExtCharacter.hxx
17//==== Role : The headr file of primitve type "ExtCharacter" from package
18//==== "Standard"
19//====
20//==== Implementation: This is a primitive type implemented with typedef
21//==== Excepting "Unicod encoding"
22//============================================================================
23
24#ifndef _Standard_ExtCharacter_HeaderFile
25#define _Standard_ExtCharacter_HeaderFile
26
7fd59977 27#include <Standard_TypeDef.hxx>
7fd59977 28#include <Standard_OStream.hxx>
971c281b 29
30#include <string.h>
7fd59977 31
7fd59977 32// ===============
33// inline methods
34// ===============
35
36// ------------------------------------------------------------------
37// ToExtCharacter : Returns an ExtCharacter from a Character
38// ------------------------------------------------------------------
39inline Standard_ExtCharacter ToExtCharacter(const Standard_Character achar)
40{
41// extension a zero (partie haute-->octet de gauche) de achar
42 return (Standard_ExtCharacter)( (unsigned char)achar & 0x00ff );
43}
44
45// ------------------------------------------------------------------
46// ToCharacter : Returns an Character from an ExtCharacter
47// ------------------------------------------------------------------
48inline Standard_Character ToCharacter(const Standard_ExtCharacter achar)
49{
50// recuperer partie basse(octet de droite) de achar
51 return (Standard_Character)(unsigned char)(achar & 0x00ff);
52}
53
54// ------------------------------------------------------------------
55// IsAnAscii : Returns True if an ExtCharacter is in the "Ascii Range"
56// ------------------------------------------------------------------
57inline Standard_Boolean IsAnAscii(const Standard_ExtCharacter achar)
58{
59 return ! ( achar & 0xff00 );
60}
61
62// ------------------------------------------------------------------
63// IsEqual : Returns Standard_True if two characters have the same value
64// ------------------------------------------------------------------
65inline Standard_Boolean IsEqual(const Standard_ExtCharacter One,
66 const Standard_ExtCharacter Two)
67{ return One == Two; }
68
7fd59977 69#endif