Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
35 lines (27 loc) · 1.04 KB

File metadata and controls

35 lines (27 loc) · 1.04 KB
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
#include "stdafx.h"
#include "ScintillaCells.h"
//lint -e1732 (Info -- new in constructor for class 'ScintillaCells' which has no assignment operator -- Effective C++ #11)
//lint -e1733 (Info -- new in constructor for class 'ScintillaCells' which has no copy constructor -- Effective C++ #11)
// The allocated memory is placed inside a shared_ptr. The default copy constructor and assignment operator will do just fine.
ScintillaCells::ScintillaCells(boost::python::str characters, boost::python::list styles) :
m_length(_len(characters)),
m_cells(new unsigned char[m_length*2])
{
const char *chrs = boost::python::extract<const char*>(characters);
size_t styleLength = _len(styles);
int style = 0;
for(idx_t pos = 0; pos < m_length; pos++)
{
if (pos < styleLength)
{
style = boost::python::extract<int>(styles[pos]);
}
m_cells.get()[pos*2] = (unsigned char)chrs[pos];
m_cells.get()[(pos*2) + 1] = static_cast<unsigned char>(style);
}
}
//lint +e1732
//lint +e1733
ScintillaCells::~ScintillaCells()
{
}
Morty Proxy This is a proxified and sanitized view of the page, visit original site.