0022749: Segfault in HashCode() of Standard_Transient
[occt.git] / src / Standard / Standard_ExtCharacter.hxx
1 //============================================================================
2 //==== Titre: Standard_ExtCharacter.hxx
3 //==== Role : The headr file of primitve type "ExtCharacter" from package 
4 //====        "Standard"
5 //==== 
6 //==== Implementation:  This is a primitive type implemented with typedef
7 //====                  Excepting "Unicod encoding"
8 //============================================================================
9
10 #ifndef _Standard_ExtCharacter_HeaderFile
11 #define _Standard_ExtCharacter_HeaderFile
12
13 #ifndef _Standard_ctype_HeaderFile
14 #include <Standard_ctype.hxx>
15 #endif
16
17 #include <string.h>
18
19 #ifndef _Standard_TypeDef_HeaderFile
20 #include <Standard_TypeDef.hxx>
21 #endif
22
23 #ifndef _Standard_OStream_HeaderFile
24 #include <Standard_OStream.hxx>
25 #endif
26
27 class Handle_Standard_Type;
28
29 __Standard_API Handle_Standard_Type& Standard_ExtCharacter_Type_();
30 //class Standard_OStream;
31 //void ShallowDump (const Standard_ExtCharacter, Standard_OStream& );
32 // =====================================
33 // Method implemented in Standard_ExtCharacter.cxx
34 // =====================================
35 __Standard_API Standard_Integer HashCode(const Standard_ExtCharacter, const Standard_Integer);
36
37 // ===============================================
38 // Methods from Standard_Entity class which are redefined:  
39 //    - Hascode
40 //    - IsEqual
41 //    - IsSimilar
42 //    - Shallowcopy
43 //    - ShallowDump
44 // ===============================================
45
46 // ===============
47 // inline methods 
48 // ===============
49
50 // ------------------------------------------------------------------
51 // ToExtCharacter : Returns an ExtCharacter from a Character
52 // ------------------------------------------------------------------
53 inline Standard_ExtCharacter ToExtCharacter(const Standard_Character achar)
54 {
55 //  extension a zero (partie haute-->octet de gauche) de achar
56     return (Standard_ExtCharacter)( (unsigned char)achar & 0x00ff );
57 }
58
59 // ------------------------------------------------------------------
60 // ToCharacter : Returns an Character from an ExtCharacter
61 // ------------------------------------------------------------------
62 inline Standard_Character ToCharacter(const Standard_ExtCharacter achar)
63 {
64 //  recuperer partie basse(octet de droite) de achar
65     return (Standard_Character)(unsigned char)(achar & 0x00ff);
66 }
67
68 // ------------------------------------------------------------------
69 // IsAnAscii : Returns True if an ExtCharacter is in the "Ascii Range"
70 // ------------------------------------------------------------------
71 inline Standard_Boolean IsAnAscii(const Standard_ExtCharacter achar)
72 {
73     return ! ( achar & 0xff00 );
74 }
75
76 // ------------------------------------------------------------------
77 // IsEqual : Returns Standard_True if two characters have the same value
78 // ------------------------------------------------------------------
79 inline Standard_Boolean IsEqual(const Standard_ExtCharacter One,
80                                 const Standard_ExtCharacter Two)
81 { return One == Two; }
82
83 // ------------------------------------------------------------------
84 // IsSimilar : Returns Standard_True if two characters have the same value
85 // ------------------------------------------------------------------
86 inline Standard_Boolean IsSimilar(const Standard_ExtCharacter One, 
87                                   const Standard_ExtCharacter Two)
88 { return One == Two; }
89
90
91 // ------------------------------------------------------------------
92 // ShallowCopy : Make a copy of one Character
93 // ------------------------------------------------------------------
94 inline Standard_ExtCharacter ShallowCopy (const Standard_ExtCharacter me) 
95 { return me; }
96
97 #endif
98
99
100
101
102
103
104
105
106
107
108
109
110
111