MCPcopy Create free account
hub / github.com/agraef/pure-lang / PeekLine

Method PeekLine

purepad/evalview.cpp:269–301  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

267}
268
269void CEvalView::PeekLine(int lineno, int len, CString& str,
270 BOOL remove_prompt)
271{
272 CEdit& edit = GetEditCtrl();
273 if (edit.LineIndex(lineno) == -1) {
274 str = "";
275 return;
276 }
277 int ofs = 0;
278 LPTSTR line = new TCHAR[len+4];
279 ASSERT(line != NULL);
280 edit.GetLine(lineno, line, len);
281 line[len] = '\0';
282 if (remove_prompt) {
283 if (edit.LineIndex(lineno+1) < 0) {
284 int l = strlen(m_strPMark);
285 if (strncmp(m_strPMark, line, l) == 0)
286 ofs = l;
287 } else {
288 if (strncmp(CMainFrame::m_strQPSX, line,
289 strlen(CMainFrame::m_strQPSX)) == 0)
290 ofs = strlen(CMainFrame::m_strQPSX);
291 else if (strncmp(CMainFrame::m_strQPS2, line,
292 strlen(CMainFrame::m_strQPS2)) == 0)
293 ofs = strlen(CMainFrame::m_strQPS2);
294 else if (strncmp(CMainFrame::m_strDPS, line,
295 strlen(CMainFrame::m_strDPS)) == 0)
296 ofs = strlen(CMainFrame::m_strDPS);
297 }
298 }
299 str = line+ofs;
300 delete[] line;
301}
302
303void CEvalView::PeekLine(int lineno, CString& str,
304 BOOL remove_prompt)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected