例外¶
YAML文書のパースや、YAML文書からの変換が失敗した場合、戻り値ではなくて例外で失敗を通知します。 ここでは、yamlcastが生成する例外を解説します。
-
class
yaml_exception: publicstd::exception¶ yamlcastの返す全ての例外のベースクラスとなります。
-
class
yaml_parse_exception: publicyaml_exception¶ YAMLの構文解析に失敗した時に発生する例外です。
-
const yaml_mark_t &
get_problem_mark() const¶ エラーが起こった場所を取得します。
-
const yaml_mark_t &
-
class
yaml_cast_exception: publicyaml_exception¶ 読み込んだYAMLデータから型変換に失敗するときに発生する例外です。
-
const yaml_mark_t &
get_start_mark() const¶ エラーの原因となったYAMLのノードの開始位置を取得します。
-
const yaml_mark_t &
get_end_mark() const¶ エラーの原因となったYAMLのノードの終了位置を取得します。
-
const yaml_mark_t &
-
class
yaml_bad_cast: publicyaml_cast_exception¶ 指定した型への変換に失敗した時に発生する例外です。
-
yaml_node_type_t
get_expect() const¶ 期待したYAMLのタイプを取得します。
-
yaml_node_type_t
get_actual() const¶ 実際のYAMLのタイプを取得します。
-
yaml_node_type_t