#include "subtitle_analysis.h"
#include "exceptions.h"
#include <libcxml/cxml.h>
#include <dcp/raw_convert.h>
#include "subtitle_analysis.h"
#include "exceptions.h"
#include <libcxml/cxml.h>
#include <dcp/raw_convert.h>
if (f.optional_number_child<int>("Version").get_value_or(1) < _current_state_version) {
/* Too old. Throw an exception so that this analysis is re-run. */
if (f.optional_number_child<int>("Version").get_value_or(1) < _current_state_version) {
/* Too old. Throw an exception so that this analysis is re-run. */
xmlpp::Element* root = doc->create_root_node ("SubtitleAnalysis");
root->add_child("Version")->add_child_text (raw_convert<string>(_current_state_version));
if (_bounding_box) {
xmlpp::Element* root = doc->create_root_node ("SubtitleAnalysis");
root->add_child("Version")->add_child_text (raw_convert<string>(_current_state_version));
if (_bounding_box) {
bounding_box->add_child("X")->add_child_text(raw_convert<string>(_bounding_box->x));
bounding_box->add_child("Y")->add_child_text(raw_convert<string>(_bounding_box->y));
bounding_box->add_child("Width")->add_child_text(raw_convert<string>(_bounding_box->width));
bounding_box->add_child("X")->add_child_text(raw_convert<string>(_bounding_box->x));
bounding_box->add_child("Y")->add_child_text(raw_convert<string>(_bounding_box->y));
bounding_box->add_child("Width")->add_child_text(raw_convert<string>(_bounding_box->width));