322 guarantee(faddr != NULL && faddr->is_uintx(), "wrong flag type"); |
322 guarantee(faddr != NULL && faddr->is_uintx(), "wrong flag type"); |
323 faddr->set_uintx(value); |
323 faddr->set_uintx(value); |
324 faddr->origin = origin; |
324 faddr->origin = origin; |
325 } |
325 } |
326 |
326 |
|
327 bool CommandLineFlags::uint64_tAt(char* name, size_t len, uint64_t* value) { |
|
328 Flag* result = Flag::find_flag(name, len); |
|
329 if (result == NULL) return false; |
|
330 if (!result->is_uint64_t()) return false; |
|
331 *value = result->get_uint64_t(); |
|
332 return true; |
|
333 } |
|
334 |
|
335 bool CommandLineFlags::uint64_tAtPut(char* name, size_t len, uint64_t* value, FlagValueOrigin origin) { |
|
336 Flag* result = Flag::find_flag(name, len); |
|
337 if (result == NULL) return false; |
|
338 if (!result->is_uint64_t()) return false; |
|
339 uint64_t old_value = result->get_uint64_t(); |
|
340 result->set_uint64_t(*value); |
|
341 *value = old_value; |
|
342 result->origin = origin; |
|
343 return true; |
|
344 } |
|
345 |
|
346 void CommandLineFlagsEx::uint64_tAtPut(CommandLineFlagWithType flag, uint64_t value, FlagValueOrigin origin) { |
|
347 Flag* faddr = address_of_flag(flag); |
|
348 guarantee(faddr != NULL && faddr->is_uint64_t(), "wrong flag type"); |
|
349 faddr->set_uint64_t(value); |
|
350 faddr->origin = origin; |
|
351 } |
|
352 |
327 bool CommandLineFlags::doubleAt(char* name, size_t len, double* value) { |
353 bool CommandLineFlags::doubleAt(char* name, size_t len, double* value) { |
328 Flag* result = Flag::find_flag(name, len); |
354 Flag* result = Flag::find_flag(name, len); |
329 if (result == NULL) return false; |
355 if (result == NULL) return false; |
330 if (!result->is_double()) return false; |
356 if (!result->is_double()) return false; |
331 *value = result->get_double(); |
357 *value = result->get_double(); |