MCPcopy Create free account
hub / github.com/RenderKit/embree / next

Method next

common/lexers/stringstream.cpp:24–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22 }
23
24 std::string StringStream::next()
25 {
26 /* skip separators */
27 while (cin->peek() != EOF) {
28 if (endl != "" && cin->peek() == '\n') { cin->drop(); return endl; }
29 if (multiLine && cin->peek() == '\\') {
30 cin->drop();
31 if (cin->peek() == '\n') { cin->drop(); continue; }
32 cin->unget();
33 }
34 if (!isSeparator(cin->peek())) break;
35 cin->drop();
36 }
37
38 /* parse everything until the next separator */
39 std::vector<char> str; str.reserve(64);
40 while (cin->peek() != EOF && !isSeparator(cin->peek())) {
41 int c = cin->get();
42 if (!isValidChar(c)) throw std::runtime_error("invalid character "+std::string(1,c)+" in input");
43 str.push_back((char)c);
44 }
45 str.push_back(0);
46 return std::string(str.data());
47 }
48}

Callers

nothing calls this directly

Calls 5

dropMethod · 0.80
reserveMethod · 0.45
getMethod · 0.45
push_backMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected