函数
GLibVariantparse_error_print_context
since: 2.40
[−]
描述 [src]
以规范方式打印出字符串中 Showing the context of a GVariant
parse error 的消息。
生成的字符串适合输出到控制台或其他以标准方式处理换行符的单屏媒体。
该消息通常看起来像以下之一
unterminated string constant:
(1, 2, 3, 'abc
^^^^
或
unable to find a common type:
[1, 2, 3, 'str']
^ ^^^^^
未来的版本中消息格式可能会更改。
error
必须来自 g_variant_parse()
的失败尝试,而 source_str
必须是造成错误的 exact same string。如果当您传递 source_str
到 g_variant_parse()
时它没有以 nul结尾,那么在使用此函数之前必须添加 nul 结尾。
since: 2.40