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
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.
12 // Alternatively, this file may be used under the terms of Open CASCADE
13 // commercial license or contractual agreement.
15 //============================================================================
16 //==== Titre: Standard_Character.cxx
17 //==== Role : the methodes which raise the exceptions are implemented in
19 //============================================================================
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>
27 #ifndef _Standard_OStream_HeaderFile
28 #include <Standard_OStream.hxx>
31 #include <Standard_Type.hxx>
33 const Handle_Standard_Type& Standard_Character_Type_()
35 static Handle_Standard_Type _aType =
36 new Standard_Type("Standard_Character",sizeof(Standard_Character),0,NULL);
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)
49 Raise("Try to apply HashCode method with negative or null argument.");
51 Standard_Character S[2];
54 return HashCode( atoi(S) , Upper ) ;
57 // ------------------------------------------------------------------
58 // ShallowDump : Writes a character
59 // ------------------------------------------------------------------
60 Standard_EXPORT void ShallowDump (const Standard_Character Value, Standard_OStream& s)
62 s << Value << " Standard_Character" << endl;