Switch over to managed Marvin implementation for string hashing (#17029)
[platform/upstream/coreclr.git] / src / classlibnative / nls / nlsinfo.cpp
1 // Licensed to the .NET Foundation under one or more agreements.
2 // The .NET Foundation licenses this file to you under the MIT license.
3 // See the LICENSE file in the project root for more information.
4 ////////////////////////////////////////////////////////////////////////////
5 //
6 //  Class:    NLSInfo
7 //
8
9 //
10 //  Purpose:  This module implements the methods of the COMNlsInfo
11 //            class.  These methods are the helper functions for the
12 //            Locale class.
13 //
14 //  Date:     August 12, 1998
15 //
16 ////////////////////////////////////////////////////////////////////////////
17
18 //
19 //  Include Files.
20 //
21 #include "common.h"
22 #include "object.h"
23 #include "excep.h"
24 #include "vars.hpp"
25 #include "interoputil.h"
26 #include "corhost.h"
27
28 #include <winnls.h>
29
30 #include "utilcode.h"
31 #include "frames.h"
32 #include "field.h"
33 #include "metasig.h"
34 #include "nls.h"
35 #include "nlsinfo.h"
36
37 /**
38  * This function returns a pointer to this table that we use in System.Globalization.EncodingTable.
39  * No error checking of any sort is performed.  Range checking is entirely the responsibility of the managed
40  * code.
41  */
42 FCIMPL0(EncodingDataItem *, COMNlsInfo::nativeGetEncodingTableDataPointer)
43 {
44     LIMITED_METHOD_CONTRACT;
45     STATIC_CONTRACT_SO_TOLERANT;
46
47     return (EncodingDataItem *)EncodingDataTable;
48 }
49 FCIMPLEND
50
51 /**
52  * This function returns a pointer to this table that we use in System.Globalization.EncodingTable.
53  * No error checking of any sort is performed.  Range checking is entirely the responsibility of the managed
54  * code.
55  */
56 FCIMPL0(CodePageDataItem *, COMNlsInfo::nativeGetCodePageTableDataPointer)
57 {
58     LIMITED_METHOD_CONTRACT;
59
60     STATIC_CONTRACT_SO_TOLERANT;
61
62     return ((CodePageDataItem*) CodePageDataTable);
63 }
64 FCIMPLEND
65
66 /**
67  * This function returns the number of items in EncodingDataTable.
68  */
69 FCIMPL0(INT32, COMNlsInfo::nativeGetNumEncodingItems)
70 {
71     LIMITED_METHOD_CONTRACT;
72     STATIC_CONTRACT_SO_TOLERANT;
73
74     return (m_nEncodingDataTableItems);
75 }
76 FCIMPLEND