/*
- Copyright (C) 2012-2018 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2012-2020 Carl Hetherington <cth@carlh.net>
This file is part of libdcp.
*/
#include "subtitle_asset.h"
+#include "language_tag.h"
#include "local_time.h"
#include "mxf.h"
#include "crypto_context.h"
_content_title_text = t;
}
- void set_language (std::string l) {
- _language = l;
+ void set_language (dcp::LanguageTag l) {
+ _language = l.to_string();
}
void set_issue_date (LocalTime t) {
return _content_title_text;
}
- /** @return language as a xs:language, if one was specified */
+ /** @return Language, if one was set. This should be a xs:language, but
+ * it might not be if a non-compliant DCP was read in.
+ */
boost::optional<std::string> language () const {
return _language;
}
int64_t _intrinsic_duration;
/** <ContentTitleText> from the asset */
std::string _content_title_text;
+ /** This is stored and returned as a string so that we can tolerate non-RFC-5646 strings,
+ * but must be set as a dcp::LanguageTag to try to ensure that we create compliant output.
+ */
boost::optional<std::string> _language;
boost::optional<std::string> _annotation_text;
LocalTime _issue_date;