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.
5 // File: StringNative.h
9 // Purpose: Contains types and method signatures for the String class
18 #ifndef _STRINGNATIVE_H_
19 #define _STRINGNATIVE_H_
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.
27 //These are the type signatures for String
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.
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)
45 // Search/Query Methods
47 static FCDECL1(FC_BOOL_RET, IsFastSort, StringObject* pThisRef);
48 static FCDECL1(FC_BOOL_RET, IsAscii, StringObject* pThisRef);
50 static FCDECL2(INT32, FCCompareOrdinalIgnoreCaseWC, StringObject* strA, __in_z INT8 *strB);
52 static FCDECL6(INT32, CompareOrdinalEx, StringObject* strA, INT32 indexA, INT32 countA, StringObject* strB, INT32 indexB, INT32 countB);
54 static FCDECL2(FC_CHAR_RET, GetCharAt, StringObject* pThisRef, INT32 index);
55 static FCDECL1(INT32, Length, StringObject* pThisRef);
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
65 static FCDECL1(INT32, Marvin32HashString, StringObject* thisRefUNSAFE);
69 // Revert to command line compilation flags
70 #if defined(_MSC_VER) && defined(_TARGET_X86_)
71 #pragma optimize ("", on)
74 #endif // _STRINGNATIVE_H_