Lines Matching refs:value
213 bool Config::ParseValue(const std::string& option, const std::string& value, size_t min_value, in ParseValue() argument
215 assert(!value.empty()); in ParseValue()
220 long long_value = strtol(value.c_str(), &end, 10); in ParseValue()
225 if (end == value.c_str()) { in ParseValue()
229 if (static_cast<size_t>(end - value.c_str()) != value.size()) { in ParseValue()
254 bool Config::ParseValue(const std::string& option, const std::string& value, size_t default_value, in ParseValue() argument
256 if (value.empty()) { in ParseValue()
260 return ParseValue(option, value, min_value, max_value, new_value); in ParseValue()
263 bool Config::SetGuard(const std::string& option, const std::string& value) { in SetGuard() argument
264 if (value.empty()) { in SetGuard()
271 if (!ParseValue(option, value, 1, MAX_GUARD_BYTES, &rear_guard_bytes_)) { in SetGuard()
281 bool Config::SetFrontGuard(const std::string& option, const std::string& value) { in SetFrontGuard() argument
282 if (!ParseValue(option, value, DEFAULT_GUARD_BYTES, 1, MAX_GUARD_BYTES, &front_guard_bytes_)) { in SetFrontGuard()
291 bool Config::SetRearGuard(const std::string& option, const std::string& value) { in SetRearGuard() argument
292 return ParseValue(option, value, DEFAULT_GUARD_BYTES, 1, MAX_GUARD_BYTES, &rear_guard_bytes_); in SetRearGuard()
295 bool Config::SetFill(const std::string& option, const std::string& value) { in SetFill() argument
296 if (value.empty()) { in SetFill()
303 if (!ParseValue(option, value, 1, SIZE_MAX, &fill_on_alloc_bytes_)) { in SetFill()
310 bool Config::SetFillOnAlloc(const std::string& option, const std::string& value) { in SetFillOnAlloc() argument
311 return ParseValue(option, value, SIZE_MAX, 1, SIZE_MAX, &fill_on_alloc_bytes_); in SetFillOnAlloc()
314 bool Config::SetFillOnFree(const std::string& option, const std::string& value) { in SetFillOnFree() argument
315 return ParseValue(option, value, SIZE_MAX, 1, SIZE_MAX, &fill_on_free_bytes_); in SetFillOnFree()
318 bool Config::SetBacktrace(const std::string& option, const std::string& value) { in SetBacktrace() argument
320 return ParseValue(option, value, DEFAULT_BACKTRACE_FRAMES, 1, MAX_BACKTRACE_FRAMES, in SetBacktrace()
324 bool Config::SetBacktraceEnableOnSignal(const std::string& option, const std::string& value) { in SetBacktraceEnableOnSignal() argument
326 return ParseValue(option, value, DEFAULT_BACKTRACE_FRAMES, 1, MAX_BACKTRACE_FRAMES, in SetBacktraceEnableOnSignal()
330 bool Config::SetBacktraceDumpOnExit(const std::string& option, const std::string& value) { in SetBacktraceDumpOnExit() argument
331 if (Config::VerifyValueEmpty(option, value)) { in SetBacktraceDumpOnExit()
338 bool Config::SetBacktraceDumpPrefix(const std::string&, const std::string& value) { in SetBacktraceDumpPrefix() argument
339 if (value.empty()) { in SetBacktraceDumpPrefix()
342 backtrace_dump_prefix_ = value; in SetBacktraceDumpPrefix()
347 bool Config::SetBacktraceSize(const std::string& option, const std::string& value) { in SetBacktraceSize() argument
348 if (!ParseValue(option, value, 1, SIZE_MAX, &backtrace_min_size_bytes_)) { in SetBacktraceSize()
356 bool Config::SetBacktraceMinSize(const std::string& option, const std::string& value) { in SetBacktraceMinSize() argument
357 return ParseValue(option, value, 1, SIZE_MAX, &backtrace_min_size_bytes_); in SetBacktraceMinSize()
360 bool Config::SetBacktraceMaxSize(const std::string& option, const std::string& value) { in SetBacktraceMaxSize() argument
361 return ParseValue(option, value, 1, SIZE_MAX, &backtrace_max_size_bytes_); in SetBacktraceMaxSize()
364 bool Config::SetExpandAlloc(const std::string& option, const std::string& value) { in SetExpandAlloc() argument
365 return ParseValue(option, value, DEFAULT_EXPAND_BYTES, 1, MAX_EXPAND_BYTES, &expand_alloc_bytes_); in SetExpandAlloc()
368 bool Config::SetFreeTrack(const std::string& option, const std::string& value) { in SetFreeTrack() argument
377 return ParseValue(option, value, DEFAULT_FREE_TRACK_ALLOCATIONS, 1, MAX_FREE_TRACK_ALLOCATIONS, in SetFreeTrack()
381 bool Config::SetFreeTrackBacktraceNumFrames(const std::string& option, const std::string& value) { in SetFreeTrackBacktraceNumFrames() argument
382 return ParseValue(option, value, DEFAULT_BACKTRACE_FRAMES, 0, MAX_BACKTRACE_FRAMES, in SetFreeTrackBacktraceNumFrames()
386 bool Config::SetRecordAllocs(const std::string& option, const std::string& value) { in SetRecordAllocs() argument
390 return ParseValue(option, value, DEFAULT_RECORD_ALLOCS, 1, MAX_RECORD_ALLOCS, in SetRecordAllocs()
394 bool Config::SetRecordAllocsFile(const std::string&, const std::string& value) { in SetRecordAllocsFile() argument
395 if (value.empty()) { in SetRecordAllocsFile()
400 record_allocs_file_ = value; in SetRecordAllocsFile()
404 bool Config::VerifyValueEmpty(const std::string& option, const std::string& value) { in VerifyValueEmpty() argument
405 if (!value.empty()) { in VerifyValueEmpty()
420 bool Config::GetOption(const char** options_str, std::string* option, std::string* value) { in GetOption() argument
438 value->clear(); in GetOption()
448 *value = std::string(start, cur - start); in GetOption()
478 std::string value; in Init() local
480 while (GetOption(&options_str, &option, &value)) { in Init()
490 if (process_func != nullptr && !(this->*process_func)(option, value)) { in Init()