Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commitb7c9694

Browse files
committed
make GetText return string
1 parenta78fa45 commitb7c9694

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

‎bindings/interface/TextView.cpp‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,12 @@ py::class_<BTextView, PyBTextView, BView, std::unique_ptr<BTextView,py::nodelete
233233
.def("Delete", py::overload_cast<int32, int32>(&BTextView::Delete),"",py::arg("startOffset"),py::arg("endOffset"))
234234
.def("Text", &BTextView::Text,"")
235235
.def("TextLength", &BTextView::TextLength,"")
236-
.def("GetText", &BTextView::GetText,"",py::arg("offset"),py::arg("length"),py::arg("buffer"))
236+
//.def("GetText", &BTextView::GetText, "", py::arg("offset"), py::arg("length"), py::arg("buffer"))
237+
.def("GetText", [](BTextView& self,int32 offset,int32 length) {
238+
std::vector<char>buffer(length);
239+
self.GetText(offset, length, buffer.data());
240+
returnstd::string(buffer.data(), length);
241+
},"",py::arg("offset"),py::arg("length"))
237242
.def("ByteAt", &BTextView::ByteAt,"",py::arg("offset"))
238243
.def("CountLines", &BTextView::CountLines,"")
239244
.def("CurrentLine", &BTextView::CurrentLine,"")

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp