MCPcopy Create free account
hub / github.com/acl-dev/acl / find_blank_line

Method find_blank_line

lib_acl_cpp/src/stdlib/string.cpp:1185–1217  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1183}
1184
1185int string::find_blank_line(int* left_count /* = NIL */,
1186 string* out /* = NIL */)
1187{
1188 if (line_state_ == NIL) {
1189 line_state_ = (ACL_LINE_STATE*) acl_line_state_alloc();
1190 }
1191
1192 int len = (int) LEN(vbf_);
1193 if (line_state_->offset >= len) {
1194 return -1;
1195 }
1196
1197 int nleft = len - line_state_->offset;
1198 char* s = STR(vbf_) + line_state_->offset;
1199 int ret = acl_find_blank_line(s, nleft, line_state_);
1200
1201 if (left_count != NIL) {
1202 *left_count = ret;
1203 }
1204
1205 if (line_state_->finish) {
1206 acl_line_state_reset(line_state_, line_state_->offset);
1207 if (out != NIL) {
1208 out->append(STR(vbf_) + line_state_offset_,
1209 line_state_->offset - line_state_offset_);
1210 }
1211 line_state_offset_ = line_state_->offset;
1212
1213 return line_state_->offset;
1214 }
1215
1216 return 0;
1217}
1218
1219string& string::find_reset()
1220{

Callers 1

mainFunction · 0.80

Calls 4

acl_line_state_allocFunction · 0.85
acl_find_blank_lineFunction · 0.85
acl_line_state_resetFunction · 0.85
appendMethod · 0.45

Tested by

no test coverage detected