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