Lines Matching refs:line

127 bool RocksDBOptionsParser::IsSection(const std::string& line) {  in IsSection()  argument
128 if (line.size() < 2) { in IsSection()
131 if (line[0] != '[' || line[line.size() - 1] != ']') { in IsSection()
140 const std::string& line, in ParseSection() argument
145 size_t arg_start_pos = line.find("\""); in ParseSection()
146 size_t arg_end_pos = line.rfind("\""); in ParseSection()
150 *title = TrimAndRemoveComment(line.substr(1, arg_start_pos - 1), true); in ParseSection()
152 line.substr(arg_start_pos + 1, arg_end_pos - arg_start_pos - 1)); in ParseSection()
154 *title = TrimAndRemoveComment(line.substr(1, line.size() - 2), true); in ParseSection()
176 return Status::InvalidArgument(std::string("Unknown section ") + line); in ParseSection()
188 const std::string& line, in ParseStatement() argument
190 size_t eq_pos = line.find("="); in ParseStatement()
195 *name = TrimAndRemoveComment(line.substr(0, eq_pos), true); in ParseStatement()
197 TrimAndRemoveComment(line.substr(eq_pos + 1, line.size() - eq_pos - 1)); in ParseStatement()
225 std::string line; in Parse() local
228 for (int line_num = 1; ReadOneLine(&iss, &sf_reader, &line, &has_data, &s); in Parse()
233 line = TrimAndRemoveComment(line); in Parse()
234 if (line.empty()) { in Parse()
237 if (IsSection(line)) { in Parse()
253 s = ParseSection(&section, &title, &argument, line, line_num); in Parse()
260 s = ParseStatement(&name, &value, line, line_num); in Parse()
453 std::string RocksDBOptionsParser::TrimAndRemoveComment(const std::string& line, in TrimAndRemoveComment() argument
456 size_t end = line.size(); in TrimAndRemoveComment()
461 while (search_pos < line.size()) { in TrimAndRemoveComment()
462 size_t comment_pos = line.find('#', search_pos); in TrimAndRemoveComment()
466 if (comment_pos == 0 || line[comment_pos - 1] != '\\') { in TrimAndRemoveComment()
474 while (start < end && isspace(line[start]) != 0) { in TrimAndRemoveComment()
479 while (start < end && isspace(line[end - 1]) != 0) { in TrimAndRemoveComment()
484 return line.substr(start, end - start); in TrimAndRemoveComment()