* Parses a tuple oriented GVariant object matching the data type * for a LogEvent object. The data type must be (uus) if the * GVariant object is does not carry a session token value; otherwise * it must be (uuss) if it does. * * @param logevent Pointer to the GVariant object containig the * log event * @param with_session_token Boolean flag indic
| 331 | * @return Events::Log object of the parsed GVariant object |
| 332 | */ |
| 333 | Log parse_tuple(GVariant *logevent, bool with_session_token) |
| 334 | { |
| 335 | if (!with_session_token) |
| 336 | { |
| 337 | glib2::Utils::checkParams(__func__, logevent, "(uus)", 3); |
| 338 | auto group = glib2::Value::Extract<LogGroup>(logevent, 0); |
| 339 | auto category = glib2::Value::Extract<LogCategory>(logevent, 1); |
| 340 | auto message = glib2::Value::Extract<std::string>(logevent, 2); |
| 341 | return Log(group, category, message, false); |
| 342 | } |
| 343 | else |
| 344 | { |
| 345 | glib2::Utils::checkParams(__func__, logevent, "(uuss)", 4); |
| 346 | auto group = glib2::Value::Extract<LogGroup>(logevent, 0); |
| 347 | auto category = glib2::Value::Extract<LogCategory>(logevent, 1); |
| 348 | auto session_token = glib2::Value::Extract<std::string>(logevent, 2); |
| 349 | auto message = glib2::Value::Extract<std::string>(logevent, 3); |
| 350 | return Log(group, category, session_token, message, false); |
| 351 | } |
| 352 | } |
| 353 | |
| 354 | |
| 355 |