| 49 | } |
| 50 | |
| 51 | bool Address::FromString(const std::string &str) { |
| 52 | int ret = Parse(str, "%2hhx:%2hhx:%2hhx:%2hhx:%2hhx:%2hhx", &bytes[0], |
| 53 | &bytes[1], &bytes[2], &bytes[3], &bytes[4], &bytes[5]); |
| 54 | return (ret == Address::kSize); |
| 55 | } |
| 56 | |
| 57 | std::string Address::ToString() const { |
| 58 | return Format("%02hhx:%02hhx:%02hhx:%02hhx:%02hhx:%02hhx", bytes[0], bytes[1], |