0024530: TKMesh - remove unused package IntPoly
[occt.git] / src / Standard / Standard_Character.cxx
1 // Copyright (c) 1998-1999 Matra Datavision
2 // Copyright (c) 1999-2014 OPEN CASCADE SAS
3 //
4 // This file is part of Open CASCADE Technology software library.
5 //
6 // This library is free software; you can redistribute it and / or modify it
7 // under the terms of the GNU Lesser General Public 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.
11 //
12 // Alternatively, this file may be used under the terms of Open CASCADE
13 // commercial license or contractual agreement.
14
15 //============================================================================
16 //==== Titre: Standard_Character.cxx
17 //==== Role : the methodes which raise the exceptions are implemented in 
18 //====        this file.
19 //============================================================================
20 #include <stdlib.h>
21 #include <Standard_Character.hxx>
22 #include <Standard_Integer.hxx>
23 #include <Standard_RangeError.hxx>
24 #ifndef _Standard_Stream_HeaderFile
25 #include <Standard_Stream.hxx>
26 #endif
27 #ifndef _Standard_OStream_HeaderFile
28 #include <Standard_OStream.hxx>
29 #endif
30
31 #include <Standard_Type.hxx>
32
33 const Handle_Standard_Type& Standard_Character_Type_() 
34 {
35   static Handle_Standard_Type _aType = 
36     new Standard_Type("Standard_Character",sizeof(Standard_Character),0,NULL);
37
38   return _aType;
39 }
40
41 // ------------------------------------------------------------------
42 // Hascode : Computes a hascoding value for a given Character
43 // ------------------------------------------------------------------
44 Standard_Integer HashCode(const Standard_Character me, 
45                           const Standard_Integer Upper)
46 {
47   if (Upper < 1){
48     Standard_RangeError::
49       Raise("Try to apply HashCode method with negative or null argument.");
50   }
51   Standard_Character S[2];
52   S[0] = me;
53   S[1] = 0;
54   return HashCode( atoi(S) , Upper ) ;
55 }
56
57 // ------------------------------------------------------------------
58 // ShallowDump : Writes a character
59 // ------------------------------------------------------------------
60 Standard_EXPORT void ShallowDump (const Standard_Character Value, Standard_OStream& s)
61
62   s << Value << " Standard_Character" << endl;
63 }