MCPcopy Create free account
hub / github.com/dirkvranckaert/AndroidDecompiler / peekNextLine

Method peekNextLine

astyle/src/astyle_main.cpp:205–237  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

203// call this function from ASFormatter ONLY
204template<typename T>
205string ASStreamIterator<T>::peekNextLine()
206{
207 assert (hasMoreLines());
208 string nextLine_;
209 char ch;
210
211 if (peekStart == 0)
212 peekStart = inStream->tellg();
213
214 // read the next record
215 inStream->get(ch);
216 while (!inStream->eof() && ch != '\n' && ch != '\r')
217 {
218 nextLine_.append(1, ch);
219 inStream->get(ch);
220 }
221
222 if (inStream->eof())
223 {
224 return nextLine_;
225 }
226
227 int peekCh = inStream->peek();
228
229 // remove end-of-line characters
230 if (!inStream->eof())
231 {
232 if ((peekCh == '\n' || peekCh == '\r') && peekCh != ch)
233 inStream->get();
234 }
235
236 return nextLine_;
237}
238
239// reset current position and EOF for peekNextLine()
240template<typename T>

Callers 5

peekNextTextMethod · 0.80
checkIfTemplateOpenerMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected