STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
vcclr.h
Go to the documentation of this file.
1 //
2 // vcclr.h - helper code for using the managed extensions to C++
3 //
4 // Copyright (C) Microsoft Corporation
5 // All rights reserved.
6 //
7 
8 #if _MSC_VER > 1000
9 #pragma once
10 #endif
11 
12 #if !defined(_INC_VCCLR)
13 #define _INC_VCCLR
14 #ifndef RC_INVOKED
15 
16 #using <mscorlib.dll>
17 #include <gcroot.h>
18 
19 #pragma warning(push)
20 #pragma warning(disable:4400)
21 
22 #ifdef __cplusplus_cli
23 typedef cli::interior_ptr<const System::Char> __const_Char_ptr;
24 typedef cli::interior_ptr<const System::Byte> __const_Byte_ptr;
25 typedef cli::interior_ptr<System::Byte> _Byte_ptr;
26 typedef const System::String^ __const_String_handle;
27 #define _NULLPTR nullptr
28 #else
29 typedef const System::Char* __const_Char_ptr;
30 typedef const System::Byte* __const_Byte_ptr;
31 typedef System::Byte* _Byte_ptr;
32 typedef const System::String* __const_String_handle;
33 #define _NULLPTR 0
34 #endif
35 
36 
37 //
38 // get an interior gc pointer to the first character contained in a System::String object
39 //
41 
42  _Byte_ptr bp = const_cast<_Byte_ptr>(reinterpret_cast<__const_Byte_ptr>(s));
43  if( bp != _NULLPTR ) {
44  unsigned offset = System::Runtime::CompilerServices::RuntimeHelpers::OffsetToStringData;
45  bp += offset;
46  }
47  return reinterpret_cast<__const_Char_ptr>(bp);
48 }
49 
50 #pragma warning(pop)
51 
52 #undef _NULLPTR
53 
54 #endif /* RC_INVOKED */
55 #endif //_INC_VCCLR
System::Byte * _Byte_ptr
Definition: vcclr.h:31
__const_Char_ptr PtrToStringChars(__const_String_handle s)
Definition: vcclr.h:40
#define _NULLPTR
Definition: vcclr.h:33
const System::Byte * __const_Byte_ptr
Definition: vcclr.h:30
const System::Char * __const_Char_ptr
Definition: vcclr.h:29
const System::String * __const_String_handle
Definition: vcclr.h:32