| 866 | }; |
| 867 | |
| 868 | Result<TimeUnit::type> GetUnitFromString(const std::string& unit_str) { |
| 869 | if (unit_str == "SECOND") { |
| 870 | return TimeUnit::SECOND; |
| 871 | } else if (unit_str == "MILLISECOND") { |
| 872 | return TimeUnit::MILLI; |
| 873 | } else if (unit_str == "MICROSECOND") { |
| 874 | return TimeUnit::MICRO; |
| 875 | } else if (unit_str == "NANOSECOND") { |
| 876 | return TimeUnit::NANO; |
| 877 | } else { |
| 878 | return Status::Invalid("Invalid time unit: ", unit_str); |
| 879 | } |
| 880 | } |
| 881 | |
| 882 | template <typename IntType = int> |
| 883 | Result<IntType> GetMemberInt(const RjObject& obj, const std::string& key) { |
no test coverage detected