Lines Matching refs:value
143 bool Config::ParseValue(const std::string& option, const std::string& value, size_t min_value, in ParseValue() argument
145 assert(!value.empty()); in ParseValue()
150 long long_value = strtol(value.c_str(), &end, 10); in ParseValue()
155 if (end == value.c_str()) { in ParseValue()
159 if (static_cast<size_t>(end - value.c_str()) != value.size()) { in ParseValue()
184 bool Config::ParseValue(const std::string& option, const std::string& value, size_t default_value, in ParseValue() argument
186 if (value.empty()) { in ParseValue()
190 return ParseValue(option, value, min_value, max_value, new_value); in ParseValue()
193 bool Config::SetGuard(const std::string& option, const std::string& value) { in SetGuard() argument
194 if (value.empty()) { in SetGuard()
201 if (!ParseValue(option, value, 1, MAX_GUARD_BYTES, &rear_guard_bytes_)) { in SetGuard()
211 bool Config::SetFrontGuard(const std::string& option, const std::string& value) { in SetFrontGuard() argument
212 if (!ParseValue(option, value, DEFAULT_GUARD_BYTES, 1, MAX_GUARD_BYTES, &front_guard_bytes_)) { in SetFrontGuard()
221 bool Config::SetRearGuard(const std::string& option, const std::string& value) { in SetRearGuard() argument
222 return ParseValue(option, value, DEFAULT_GUARD_BYTES, 1, MAX_GUARD_BYTES, &rear_guard_bytes_); in SetRearGuard()
225 bool Config::SetFill(const std::string& option, const std::string& value) { in SetFill() argument
226 if (value.empty()) { in SetFill()
233 if (!ParseValue(option, value, 1, SIZE_MAX, &fill_on_alloc_bytes_)) { in SetFill()
240 bool Config::SetFillOnAlloc(const std::string& option, const std::string& value) { in SetFillOnAlloc() argument
241 return ParseValue(option, value, SIZE_MAX, 1, SIZE_MAX, &fill_on_alloc_bytes_); in SetFillOnAlloc()
244 bool Config::SetFillOnFree(const std::string& option, const std::string& value) { in SetFillOnFree() argument
245 return ParseValue(option, value, SIZE_MAX, 1, SIZE_MAX, &fill_on_free_bytes_); in SetFillOnFree()
248 bool Config::SetBacktrace(const std::string& option, const std::string& value) { in SetBacktrace() argument
250 return ParseValue(option, value, DEFAULT_BACKTRACE_FRAMES, 1, MAX_BACKTRACE_FRAMES, in SetBacktrace()
254 bool Config::SetBacktraceEnableOnSignal(const std::string& option, const std::string& value) { in SetBacktraceEnableOnSignal() argument
256 return ParseValue(option, value, DEFAULT_BACKTRACE_FRAMES, 1, MAX_BACKTRACE_FRAMES, in SetBacktraceEnableOnSignal()
260 bool Config::SetBacktraceDumpOnExit(const std::string& option, const std::string& value) { in SetBacktraceDumpOnExit() argument
261 if (Config::VerifyValueEmpty(option, value)) { in SetBacktraceDumpOnExit()
268 bool Config::SetBacktraceDumpPrefix(const std::string&, const std::string& value) { in SetBacktraceDumpPrefix() argument
269 if (value.empty()) { in SetBacktraceDumpPrefix()
272 backtrace_dump_prefix_ = value; in SetBacktraceDumpPrefix()
277 bool Config::SetExpandAlloc(const std::string& option, const std::string& value) { in SetExpandAlloc() argument
278 return ParseValue(option, value, DEFAULT_EXPAND_BYTES, 1, MAX_EXPAND_BYTES, &expand_alloc_bytes_); in SetExpandAlloc()
281 bool Config::SetFreeTrack(const std::string& option, const std::string& value) { in SetFreeTrack() argument
290 return ParseValue(option, value, DEFAULT_FREE_TRACK_ALLOCATIONS, 1, MAX_FREE_TRACK_ALLOCATIONS, in SetFreeTrack()
294 bool Config::SetFreeTrackBacktraceNumFrames(const std::string& option, const std::string& value) { in SetFreeTrackBacktraceNumFrames() argument
295 return ParseValue(option, value, DEFAULT_BACKTRACE_FRAMES, 0, MAX_BACKTRACE_FRAMES, in SetFreeTrackBacktraceNumFrames()
299 bool Config::SetRecordAllocs(const std::string& option, const std::string& value) { in SetRecordAllocs() argument
303 return ParseValue(option, value, DEFAULT_RECORD_ALLOCS, 1, MAX_RECORD_ALLOCS, in SetRecordAllocs()
307 bool Config::SetRecordAllocsFile(const std::string&, const std::string& value) { in SetRecordAllocsFile() argument
308 if (value.empty()) { in SetRecordAllocsFile()
313 record_allocs_file_ = value; in SetRecordAllocsFile()
317 bool Config::VerifyValueEmpty(const std::string& option, const std::string& value) { in VerifyValueEmpty() argument
318 if (!value.empty()) { in VerifyValueEmpty()
332 bool Config::GetOption(const char** options_str, std::string* option, std::string* value) { in GetOption() argument
350 value->clear(); in GetOption()
360 *value = std::string(start, cur - start); in GetOption()
386 std::string value; in Init() local
388 while (GetOption(&options_str, &option, &value)) { in Init()
398 if (process_func != nullptr && !(this->*process_func)(option, value)) { in Init()