-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLLVMDebugStringTableSubsection.cpp
More file actions
48 lines (37 loc) · 1.13 KB
/
LLVMDebugStringTableSubsection.cpp
File metadata and controls
48 lines (37 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// LLVMDebugStringTableSubsection.cpp : Implementation of CLLVMDebugStringTableSubsection
#include "pch.h"
#include "LLVMDebugStringTableSubsection.h"
using namespace boost::locale::conv;
// CLLVMDebugStringTableSubsection
STDMETHODIMP CLLVMDebugStringTableSubsection::InterfaceSupportsErrorInfo(REFIID riid)
{
static const IID* const arr[] =
{
&IID_ILLVMDebugStringTableSubsection
};
for (int i=0; i < sizeof(arr) / sizeof(arr[0]); i++)
{
if (InlineIsEqualGUID(*arr[i],riid))
return S_OK;
}
return S_FALSE;
}
STDMETHODIMP CLLVMDebugStringTableSubsection::insert(BSTR S, ULONG* Res)
{
if (S == nullptr)
*Res = debugStringTableSubsection->insert("");
else
*Res = debugStringTableSubsection->insert(utf_to_utf<char>(S));
return S_OK;
}
STDMETHODIMP CLLVMDebugStringTableSubsection::getIdForString(BSTR S, ULONG* Res)
{
*Res = debugStringTableSubsection->getIdForString(utf_to_utf<char>(S));
return S_OK;
}
STDMETHODIMP CLLVMDebugStringTableSubsection::getStringForId(ULONG Id, BSTR* Res)
{
CComBSTR temp(
utf_to_utf<wchar_t>(debugStringTableSubsection->getStringForId(Id).str()).c_str());
return temp.CopyTo(Res);
}