summaryrefslogtreecommitdiff
path: root/src/Standard/Standard_ExtCharacter.cxx
blob: badef06da0632911b9e72f5b0077e6dd9d2a69ac (plain)
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

//============================================================================
//==== Titre: Standard_ExtCharacter.cxx
//==== Role : the methodes which raise the exceptions are implemented in 
//====        this file.
//============================================================================
#include <stdlib.h>
#include <Standard_ExtCharacter.hxx>
#include <Standard_Integer.hxx>
#include <Standard_RangeError.hxx>

#include <Standard_Type.hxx>
#ifndef _Standard_Stream_HeaderFile
#include <Standard_Stream.hxx>
#endif
#ifndef _Standard_OStream_HeaderFile
#include <Standard_OStream.hxx>
#endif

Handle_Standard_Type& Standard_ExtCharacter_Type_() 
{
  static Handle_Standard_Type _aType = 
    new Standard_Type("Standard_ExtCharacter",sizeof(Standard_ExtCharacter),
		      0,NULL);
  
  return _aType;
}


// ------------------------------------------------------------------
// Hascode : Computes a hascoding value for a given ExtCharacter
// ------------------------------------------------------------------
Standard_Integer HashCode(const Standard_ExtCharacter me, 
			  const Standard_Integer Upper)
{
  if (Upper < 1){
    Standard_RangeError::
      Raise("Try to apply HashCode method with negative or null argument.");
  }
  Standard_Integer aCode = me; 
  return ( aCode % Upper) + 1;
}

// ------------------------------------------------------------------
// ShallowDump : Writes a character
// ------------------------------------------------------------------
Standard_EXPORT void ShallowDump (const Standard_ExtCharacter Value 
				  ,Standard_OStream& s)
{   
  s << hex << Value << " Standard_ExtCharacter" << endl;
}