-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPyReportManager.cpp
More file actions
41 lines (35 loc) · 938 Bytes
/
PyReportManager.cpp
File metadata and controls
41 lines (35 loc) · 938 Bytes
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
#include "stdafx.h"
#include "PyReportManager.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
void CPyReportManager::Init(IBroker* pBroker)
{
pBroker->GetInterface(IID_IReportManager, (IUnknown**)&m_pReportManager);
}
void CPyReportManager::Reset()
{
m_pReportManager.Release();
}
IndexType CPyReportManager::GetReportBuilderCount()
{
return m_pReportManager->GetReportBuilderCount();
}
boost::python::list CPyReportManager::GetReportNames()
{
USES_CONVERSION;
boost::python::list list;
std::vector<std::_tstring> vNames = m_pReportManager->GetReportNames();
for (const auto& name : vNames)
{
#if defined _UNICODE
boost::python::handle<> handle(PyUnicode_FromWideChar(name.c_str(),-1));
#else
boost::python::handle<> handle(PyUnicode_FromString(T2A(name.c_str())));
#endif
list.append(boost::python::object(handle));
}
return list;
}