Switch over to managed Marvin implementation for string hashing (#17029)
[platform/upstream/coreclr.git] / src / classlibnative / bcltype / stringnative.h
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 // File: StringNative.h
6 //
7
8 //
9 // Purpose: Contains types and method signatures for the String class
10 //
11
12 //
13
14 #include "fcall.h"
15 #include "qcall.h"
16 #include "excep.h"
17
18 #ifndef _STRINGNATIVE_H_
19 #define _STRINGNATIVE_H_
20 //
21 // Each function that we call through native only gets one argument,
22 // which is actually a pointer to it's stack of arguments.  Our structs
23 // for accessing these are defined below.
24 //
25
26 //
27 //These are the type signatures for String
28 //
29 //
30 // The method signatures for each of the methods we define.
31 // N.B.: There's a one-to-one mapping between the method signatures and the
32 // type definitions given above.
33 //
34
35
36 // Compile the string functionality with these pragma flags (equivalent of the command line /Ox flag)
37 // Compiling this functionality differently gives us significant throughout gain in some cases.
38 #if defined(_MSC_VER) && defined(_TARGET_X86_)
39 #pragma optimize("tgy", on)
40 #endif
41
42 class COMString {
43 public:
44     //
45     // Search/Query Methods
46     //
47     static FCDECL1(FC_BOOL_RET, IsFastSort, StringObject* pThisRef);
48     static FCDECL1(FC_BOOL_RET, IsAscii, StringObject* pThisRef);
49
50     static FCDECL2(INT32, FCCompareOrdinalIgnoreCaseWC, StringObject* strA, __in_z INT8 *strB);
51
52     static FCDECL6(INT32, CompareOrdinalEx, StringObject* strA, INT32 indexA, INT32 countA, StringObject* strB, INT32 indexB, INT32 countB);
53
54     static FCDECL2(FC_CHAR_RET, GetCharAt, StringObject* pThisRef, INT32 index);
55     static FCDECL1(INT32, Length, StringObject* pThisRef);
56
57     //
58     // Interop
59     //
60 #ifdef FEATURE_COMINTEROP
61     static FCDECL2(FC_BOOL_RET, FCTryGetTrailByte, StringObject* thisRefUNSAFE, UINT8 *pbData);
62     static FCDECL2(VOID,        FCSetTrailByte,    StringObject* thisRefUNSAFE, UINT8 bData);
63 #endif // FEATURE_COMINTEROP
64 };
65
66 // Revert to command line compilation flags
67 #if defined(_MSC_VER) && defined(_TARGET_X86_)
68 #pragma optimize ("", on)
69 #endif
70
71 #endif // _STRINGNATIVE_H_
72
73
74
75
76
77