MCPcopy Create free account
hub / github.com/Codeya-IDE/deepin-ide / readFileLine

Method readFileLine

src/plugins/codeeditor/codelens/codelenstree.cpp:105–122  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

103}
104
105QString CodeLensTree::readFileLine(const QString &filePath, int line)
106{
107 QFile file(filePath);
108 if (!file.open(QFile::ReadOnly | QFile::Text))
109 return {};
110
111 QTextStream in(&file);
112 int lineCount = 0;
113 while (!in.atEnd()) {
114 QString text = in.readLine();
115 if (line == lineCount)
116 return text;
117 lineCount++;
118 }
119
120 file.close();
121 return {};
122}

Callers

nothing calls this directly

Calls 4

atEndMethod · 0.80
openMethod · 0.45
readLineMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected