MCPcopy Create free account
hub / github.com/chen3feng/toft / ParseFromString

Method ParseFromString

container/bitmap.h:287–303  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

285 }
286
287 bool ParseFromString(StringPiece initial_value)
288 {
289 if (initial_value.size() != Size())
290 return false;
291
292 for (size_t i = 0; i < initial_value.size(); ++i)
293 {
294 char ch = initial_value[i];
295 if (ch == '1')
296 this->SetAt(initial_value.size() - i - 1);
297 else if (ch == '0')
298 this->ClearAt(initial_value.size() - i - 1);
299 else
300 return false;
301 }
302 return true;
303 }
304
305private:
306 const WordType* Words() const

Callers 2

BasicDynamicBitmapMethod · 0.45
InitializeWithStringMethod · 0.45

Calls 3

SetAtMethod · 0.95
ClearAtMethod · 0.95
sizeMethod · 0.45

Tested by

no test coverage detected