summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/asset_factory.cc2
-rw-r--r--src/atmos_asset_writer.cc2
-rw-r--r--src/certificate.cc2
-rw-r--r--src/certificate_chain.cc16
-rw-r--r--src/combine.h6
-rw-r--r--src/compose.h6
-rw-r--r--src/cpl.cc2
-rw-r--r--src/dcp.cc6
-rw-r--r--src/dcp.h6
-rw-r--r--src/dcp_time.cc20
-rw-r--r--src/decrypted_kdm.cc2
-rw-r--r--src/encrypted_kdm.cc2
-rw-r--r--src/exceptions.cc28
-rw-r--r--src/interop_subtitle_asset.cc6
-rw-r--r--src/j2k_transcode.cc6
-rw-r--r--src/language_tag.cc12
-rw-r--r--src/mono_picture_asset.cc2
-rw-r--r--src/mono_picture_frame.cc2
-rw-r--r--src/picture_asset.cc8
-rw-r--r--src/reel_asset.cc2
-rw-r--r--src/reel_picture_asset.cc4
-rw-r--r--src/rgb_xyz.cc8
-rw-r--r--src/smpte_subtitle_asset.cc10
-rw-r--r--src/sound_asset.cc22
-rw-r--r--src/sound_asset_writer.cc4
-rw-r--r--src/stereo_picture_frame.cc2
-rw-r--r--src/subtitle_asset.cc6
-rw-r--r--src/types.cc6
-rw-r--r--src/util.cc4
-rw-r--r--src/verify.cc118
-rw-r--r--src/verify_j2k.cc12
-rw-r--r--test/combine_test.cc4
-rw-r--r--test/compose_test.cc12
-rw-r--r--test/mca_test.cc10
-rw-r--r--test/test.cc8
-rw-r--r--test/verify_test.cc140
-rw-r--r--tools/dcpinfo.cc12
37 files changed, 257 insertions, 263 deletions
diff --git a/src/asset_factory.cc b/src/asset_factory.cc
index 0b6c9ad5..261568e5 100644
--- a/src/asset_factory.cc
+++ b/src/asset_factory.cc
@@ -93,7 +93,7 @@ dcp::asset_factory (boost::filesystem::path path, bool ignore_incorrect_picture_
case ASDCP::ESS_DCDATA_DOLBY_ATMOS:
return make_shared<AtmosAsset>(path);
default:
- throw ReadError (String::compose("Unknown MXF essence type %1 in %2", static_cast<int>(type), path.string()));
+ throw ReadError (compose("Unknown MXF essence type %1 in %2", static_cast<int>(type), path.string()));
}
return {};
diff --git a/src/atmos_asset_writer.cc b/src/atmos_asset_writer.cc
index 1fe4b4e2..94620c8b 100644
--- a/src/atmos_asset_writer.cc
+++ b/src/atmos_asset_writer.cc
@@ -109,7 +109,7 @@ AtmosAssetWriter::write (uint8_t const * data, int size)
auto const r = _state->mxf_writer.WriteFrame (_state->frame_buffer, _crypto_context->context(), _crypto_context->hmac());
if (ASDCP_FAILURE(r)) {
- boost::throw_exception (MiscError(String::compose("could not write atmos MXF frame (%1)", static_cast<int>(r))));
+ boost::throw_exception (MiscError(compose("could not write atmos MXF frame (%1)", static_cast<int>(r))));
}
++_frames_written;
diff --git a/src/certificate.cc b/src/certificate.cc
index 4508729f..4e2f1e8a 100644
--- a/src/certificate.cc
+++ b/src/certificate.cc
@@ -439,7 +439,7 @@ Certificate::public_key () const
_public_key = EVP_PKEY_get1_RSA (key);
if (!_public_key) {
- throw MiscError (String::compose ("could not get RSA public key (%1)", ERR_error_string (ERR_get_error(), 0)));
+ throw MiscError (compose("could not get RSA public key (%1)", ERR_error_string (ERR_get_error(), 0)));
}
return _public_key;
diff --git a/src/certificate_chain.cc b/src/certificate_chain.cc
index 006d26b2..4d90a44d 100644
--- a/src/certificate_chain.cc
+++ b/src/certificate_chain.cc
@@ -114,7 +114,7 @@ command (string cmd)
int const code = WEXITSTATUS (r);
#endif
if (code) {
- throw dcp::MiscError (String::compose ("error %1 in %2 within %3", code, cmd, boost::filesystem::current_path().string()));
+ throw dcp::MiscError (compose("error %1 in %2 within %3", code, cmd, boost::filesystem::current_path().string()));
}
}
@@ -130,7 +130,7 @@ public_key_digest (boost::filesystem::path private_key, boost::filesystem::path
boost::filesystem::path public_name = private_key.string() + ".public";
/* Create the public key from the private key */
- command (String::compose("\"%1\" rsa -outform PEM -pubout -in %2 -out %3", openssl.string(), private_key.string(), public_name.string()));
+ command (compose("\"%1\" rsa -outform PEM -pubout -in %2 -out %3", openssl.string(), private_key.string(), public_name.string()));
/* Read in the public key from the file */
@@ -231,7 +231,7 @@ CertificateChain::CertificateChain (
{
command (
- String::compose (
+ compose(
"%1 req -new -x509 -sha256 -config ca.cnf -days %2 -set_serial 5"
" -subj \"%3\" -key ca.key -outform PEM -out ca.self-signed.pem",
quoted_openssl, days, ca_subject
@@ -265,7 +265,7 @@ CertificateChain::CertificateChain (
{
command (
- String::compose (
+ compose(
"%1 req -new -config intermediate.cnf -days %2 -subj \"%3\" -key intermediate.key -out intermediate.csr",
quoted_openssl, days - 1, inter_subject
)
@@ -273,7 +273,7 @@ CertificateChain::CertificateChain (
}
command (
- String::compose (
+ compose(
"%1 x509 -req -sha256 -days %2 -CA ca.self-signed.pem -CAkey ca.key -set_serial 6"
" -in intermediate.csr -extfile intermediate.cnf -extensions v3_ca -out intermediate.signed.pem",
quoted_openssl, days - 1
@@ -306,7 +306,7 @@ CertificateChain::CertificateChain (
{
command (
- String::compose (
+ compose(
"%1 req -new -config leaf.cnf -days %2 -subj \"%3\" -key leaf.key -outform PEM -out leaf.csr",
quoted_openssl, days - 2, leaf_subject
)
@@ -314,7 +314,7 @@ CertificateChain::CertificateChain (
}
command (
- String::compose (
+ compose(
"%1 x509 -req -sha256 -days %2 -CA intermediate.signed.pem -CAkey intermediate.key"
" -set_serial 7 -in leaf.csr -extfile leaf.cnf -extensions v3_ca -out leaf.signed.pem",
quoted_openssl, days - 2
@@ -659,7 +659,7 @@ CertificateChain::add_signature_value (xmlpp::Element* parent, string ns, bool a
}
int const r = xmlSecDSigCtxSign (signature_context, parent->cobj ());
if (r < 0) {
- throw MiscError (String::compose ("could not sign (%1)", r));
+ throw MiscError (compose("could not sign (%1)", r));
}
xmlSecDSigCtxDestroy (signature_context);
diff --git a/src/combine.h b/src/combine.h
index 819efc89..0f9e4f7a 100644
--- a/src/combine.h
+++ b/src/combine.h
@@ -51,10 +51,10 @@ class CertificateChain;
void combine (
std::vector<boost::filesystem::path> inputs,
boost::filesystem::path output,
- std::string issuer = String::compose("libdcp %1", dcp::version),
- std::string creator = String::compose("libdcp %1", dcp::version),
+ std::string issuer = compose("libdcp %1", dcp::version),
+ std::string creator = compose("libdcp %1", dcp::version),
std::string issue_date = LocalTime().as_string(),
- std::string annotation_text = String::compose("Created by libdcp %1", dcp::version),
+ std::string annotation_text = compose("Created by libdcp %1", dcp::version),
std::shared_ptr<const CertificateChain> signer = std::shared_ptr<CertificateChain>()
);
diff --git a/src/compose.h b/src/compose.h
index a7bc1154..128600fb 100644
--- a/src/compose.h
+++ b/src/compose.h
@@ -60,9 +60,6 @@ void collect(std::vector<std::string>& string_args, T arg, Ts... rest)
}
-namespace String {
-
-
template <typename...Ts>
std::string compose(std::string fmt, Ts... args)
{
@@ -82,8 +79,5 @@ std::string compose(std::string fmt, Ts... args)
}
-}
-
-
#endif
diff --git a/src/cpl.cc b/src/cpl.cc
index a35fcecc..f6cf1473 100644
--- a/src/cpl.cc
+++ b/src/cpl.cc
@@ -565,7 +565,7 @@ CPL::equals (shared_ptr<const Asset> other, EqualityOptions opt, NoteHandler not
}
if (_reels.size() != other_cpl->_reels.size()) {
- note (NoteType::ERROR, String::compose ("CPL: reel counts differ (%1 vs %2)", _reels.size(), other_cpl->_reels.size()));
+ note (NoteType::ERROR, compose("CPL: reel counts differ (%1 vs %2)", _reels.size(), other_cpl->_reels.size()));
return false;
}
diff --git a/src/dcp.cc b/src/dcp.cc
index 161b5b52..1db14851 100644
--- a/src/dcp.cc
+++ b/src/dcp.cc
@@ -236,7 +236,7 @@ DCP::read (vector<dcp::VerificationNote>* notes, bool ignore_incorrect_picture_m
p->parse_file (path.string());
} catch (std::exception& e) {
delete p;
- throw ReadError(String::compose("XML error in %1", path.string()), e.what());
+ throw ReadError(compose("XML error in %1", path.string()), e.what());
}
auto const root = p->get_document()->get_root_node()->get_name();
@@ -271,7 +271,7 @@ DCP::read (vector<dcp::VerificationNote>* notes, bool ignore_incorrect_picture_m
} else if (*pkl_type == "image/png") {
/* It's an Interop PNG subtitle; let it go */
} else {
- throw ReadError (String::compose("Unknown asset type %1 in PKL", *pkl_type));
+ throw ReadError (compose("Unknown asset type %1 in PKL", *pkl_type));
}
}
@@ -306,7 +306,7 @@ DCP::equals (DCP const & other, EqualityOptions opt, NoteHandler note) const
auto b = other.cpls ();
if (a.size() != b.size()) {
- note (NoteType::ERROR, String::compose ("CPL counts differ: %1 vs %2", a.size(), b.size()));
+ note (NoteType::ERROR, compose("CPL counts differ: %1 vs %2", a.size(), b.size()));
return false;
}
diff --git a/src/dcp.h b/src/dcp.h
index 50a7ea7a..b58d0d44 100644
--- a/src/dcp.h
+++ b/src/dcp.h
@@ -151,10 +151,10 @@ public:
* @param name_format Name format to use for the CPL and PKL filenames
*/
void write_xml (
- std::string issuer = String::compose("libdcp %1", dcp::version),
- std::string creator = String::compose("libdcp %1", dcp::version),
+ std::string issuer = compose("libdcp %1", dcp::version),
+ std::string creator = compose("libdcp %1", dcp::version),
std::string issue_date = LocalTime().as_string(),
- std::string annotation_text = String::compose("Created by libdcp %1", dcp::version),
+ std::string annotation_text = compose("Created by libdcp %1", dcp::version),
std::shared_ptr<const CertificateChain> signer = std::shared_ptr<const CertificateChain>(),
NameFormat name_format = NameFormat("%t")
);
diff --git a/src/dcp_time.cc b/src/dcp_time.cc
index 4e67afb7..c9b184f7 100644
--- a/src/dcp_time.cc
+++ b/src/dcp_time.cc
@@ -102,7 +102,7 @@ Time::Time (string time, optional<int> tcr_)
split (b, time, is_any_of (":"));
if (b.size() < 3 || b[0].empty() || b[1].empty() || b[0].length() > 2 || b[1].length() > 2) {
- boost::throw_exception (ReadError (String::compose ("unrecognised time specification %1", time)));
+ boost::throw_exception (ReadError (compose("unrecognised time specification %1", time)));
}
if (!tcr_) {
@@ -112,17 +112,17 @@ Time::Time (string time, optional<int> tcr_)
vector<string> bs;
split (bs, b[2], is_any_of ("."));
if (bs.size() != 2) {
- boost::throw_exception (ReadError (String::compose ("unrecognised time specification %1", time)));
+ boost::throw_exception (ReadError (compose("unrecognised time specification %1", time)));
}
h = raw_convert<int> (b[0]);
m = raw_convert<int> (b[1]);
if (bs[0].empty() || bs[0].length() > 2) {
- boost::throw_exception (ReadError (String::compose ("unrecognised time specification %1; %2 has bad length", time, bs[0])));
+ boost::throw_exception (ReadError (compose("unrecognised time specification %1; %2 has bad length", time, bs[0])));
}
s = raw_convert<int> (bs[0]);
if (bs[1].empty() || bs[1].length() > 3) {
- boost::throw_exception (ReadError (String::compose ("unrecognised time specification %1; %2 has bad length", time, bs[1])));
+ boost::throw_exception (ReadError (compose("unrecognised time specification %1; %2 has bad length", time, bs[1])));
}
e = raw_convert<int> (bs[1]);
tcr = 1000;
@@ -131,33 +131,33 @@ Time::Time (string time, optional<int> tcr_)
h = raw_convert<int> (b[0]);
m = raw_convert<int> (b[1]);
if (b[2].empty() || b[2].length() > 2) {
- boost::throw_exception (ReadError (String::compose ("unrecognised time specification %1; %2 has bad length", time, b[2])));
+ boost::throw_exception (ReadError (compose("unrecognised time specification %1; %2 has bad length", time, b[2])));
}
s = raw_convert<int> (b[2]);
if (b[3].empty() || b[3].length() > 3) {
- boost::throw_exception (ReadError (String::compose ("unrecognised time specification %1; %2 has bad length", time, b[3])));
+ boost::throw_exception (ReadError (compose("unrecognised time specification %1; %2 has bad length", time, b[3])));
}
e = raw_convert<int> (b[3]);
tcr = 250;
} else {
- boost::throw_exception (ReadError (String::compose ("unrecognised time specification %1", time)));
+ boost::throw_exception (ReadError (compose("unrecognised time specification %1", time)));
}
} else {
/* SMPTE: HH:MM:SS:EE */
split (b, time, is_any_of (":"));
if (b.size() != 4) {
- boost::throw_exception (ReadError (String::compose ("unrecognised time specification %1; does not have 4 parts", time)));
+ boost::throw_exception (ReadError (compose("unrecognised time specification %1; does not have 4 parts", time)));
}
h = raw_convert<int> (b[0]);
m = raw_convert<int> (b[1]);
if (b[2].empty() || b[2].length() > 2) {
- boost::throw_exception (ReadError (String::compose ("unrecognised time specification %1; %2 has bad length", time, b[2])));
+ boost::throw_exception (ReadError (compose("unrecognised time specification %1; %2 has bad length", time, b[2])));
}
s = raw_convert<int> (b[2]);
if (b[3].empty() || b[3].length() > 2) {
- boost::throw_exception (ReadError (String::compose ("unrecognised time specification %1; %2 has bad length", time, b[3])));
+ boost::throw_exception (ReadError (compose("unrecognised time specification %1; %2 has bad length", time, b[3])));
}
e = raw_convert<int> (b[3]);
tcr = tcr_.get();
diff --git a/src/decrypted_kdm.cc b/src/decrypted_kdm.cc
index 7210a848..df57588f 100644
--- a/src/decrypted_kdm.cc
+++ b/src/decrypted_kdm.cc
@@ -362,7 +362,7 @@ DecryptedKDM::encrypt (
unsigned char encrypted[RSA_size(rsa)];
int const encrypted_len = RSA_public_encrypt (p - block, block, encrypted, rsa, RSA_PKCS1_OAEP_PADDING);
if (encrypted_len == -1) {
- throw MiscError (String::compose ("Could not encrypt KDM (%1)", ERR_error_string (ERR_get_error(), 0)));
+ throw MiscError (compose("Could not encrypt KDM (%1)", ERR_error_string (ERR_get_error(), 0)));
}
/* Lazy overallocation */
diff --git a/src/encrypted_kdm.cc b/src/encrypted_kdm.cc
index 5706f953..ebac5200 100644
--- a/src/encrypted_kdm.cc
+++ b/src/encrypted_kdm.cc
@@ -448,7 +448,7 @@ public:
if (disable_forensic_marking_audio) {
auto mrkflg = audio_disable;
if (*disable_forensic_marking_audio > 0) {
- mrkflg += String::compose ("-above-channel-%1", *disable_forensic_marking_audio);
+ mrkflg += compose("-above-channel-%1", *disable_forensic_marking_audio);
}
forensic_mark_flag_list->add_child("ForensicMarkFlag")->add_child_text (mrkflg);
}
diff --git a/src/exceptions.cc b/src/exceptions.cc
index 3cf1a782..12f8ec12 100644
--- a/src/exceptions.cc
+++ b/src/exceptions.cc
@@ -48,7 +48,7 @@ using namespace dcp;
FileError::FileError (string message, boost::filesystem::path filename, int number)
- : runtime_error (String::compose ("%1 (%2) (error %3)", message, filename.string(), number))
+ : runtime_error (compose("%1 (%2) (error %3)", message, filename.string(), number))
, _filename (filename)
, _number (number)
{
@@ -57,49 +57,49 @@ FileError::FileError (string message, boost::filesystem::path filename, int numb
UnresolvedRefError::UnresolvedRefError (string id)
- : runtime_error (String::compose ("Unresolved reference to asset id %1", id))
+ : runtime_error (compose("Unresolved reference to asset id %1", id))
{
}
TimeFormatError::TimeFormatError (string bad_time)
- : runtime_error (String::compose ("Bad time string %1", bad_time))
+ : runtime_error (compose("Bad time string %1", bad_time))
{
}
BadContentKindError::BadContentKindError (string content_kind)
- : ReadError (String::compose("Bad content kind '%1'", content_kind))
+ : ReadError (compose("Bad content kind '%1'", content_kind))
{
}
NotEncryptedError::NotEncryptedError (string const & what)
- : runtime_error (String::compose ("%1 is not encrypted", what))
+ : runtime_error (compose("%1 is not encrypted", what))
{
}
ProgrammingError::ProgrammingError (string file, int line)
- : runtime_error (String::compose ("Programming error at %1:%2", file, line))
+ : runtime_error (compose("Programming error at %1:%2", file, line))
{
}
KDMDecryptionError::KDMDecryptionError (std::string message, int cipher_length, int modulus_dmax)
- : runtime_error (String::compose ("Could not decrypt KDM (%1) (%2/%3)", message, cipher_length, modulus_dmax))
+ : runtime_error (compose("Could not decrypt KDM (%1) (%2/%3)", message, cipher_length, modulus_dmax))
{
}
KDMFormatError::KDMFormatError (std::string message)
- : runtime_error (String::compose ("Could not parse KDM (%1)", message))
+ : runtime_error (compose("Could not parse KDM (%1)", message))
{
}
@@ -113,7 +113,7 @@ CertificateChainError::CertificateChainError (string message)
ReadError::ReadError (string message, string detail)
- : runtime_error(String::compose("%1 (%2)", message, detail))
+ : runtime_error(compose("%1 (%2)", message, detail))
, _message(message)
, _detail(detail)
{
@@ -122,7 +122,7 @@ ReadError::ReadError (string message, string detail)
MissingSubtitleImageError::MissingSubtitleImageError (string id)
- : runtime_error (String::compose("Could not load image for subtitle %1", id))
+ : runtime_error (compose("Could not load image for subtitle %1", id))
{
}
@@ -141,7 +141,7 @@ BadKDMDateError::BadKDMDateError (bool starts_too_early)
StartCompressionError::StartCompressionError (optional<int> code)
- : runtime_error (String::compose("Could not start JPEG2000 encoding%1", code ? String::compose(" (%1", *code) : ""))
+ : runtime_error (compose("Could not start JPEG2000 encoding%1", code ? compose(" (%1", *code) : ""))
, _code (code)
{}
@@ -172,14 +172,14 @@ DuplicateIdError::DuplicateIdError (std::string message)
MainSoundConfigurationError::MainSoundConfigurationError (std::string s)
- : runtime_error (String::compose("Could not parse MainSoundConfiguration %1", s))
+ : runtime_error (compose("Could not parse MainSoundConfiguration %1", s))
{
}
UnknownChannelIdError::UnknownChannelIdError (std::string id)
- : runtime_error (String::compose("Unrecognised channel id '%1'", id))
+ : runtime_error (compose("Unrecognised channel id '%1'", id))
{
}
@@ -193,7 +193,7 @@ NoReelsError::NoReelsError ()
MissingAssetmapError::MissingAssetmapError (boost::filesystem::path dir)
- : ReadError (String::compose("Could not find ASSETMAP nor ASSETMAP.xml in '%1'", dir.string()))
+ : ReadError (compose("Could not find ASSETMAP nor ASSETMAP.xml in '%1'", dir.string()))
{
}
diff --git a/src/interop_subtitle_asset.cc b/src/interop_subtitle_asset.cc
index 51c41d18..2adaa5f4 100644
--- a/src/interop_subtitle_asset.cc
+++ b/src/interop_subtitle_asset.cc
@@ -96,7 +96,7 @@ InteropSubtitleAsset::InteropSubtitleAsset (boost::filesystem::path file)
for (auto i: _subtitles) {
auto si = dynamic_pointer_cast<SubtitleImage>(i);
if (si) {
- si->read_png_file (file.parent_path() / String::compose("%1.png", si->id()));
+ si->read_png_file (file.parent_path() / compose("%1.png", si->id()));
}
}
}
@@ -136,7 +136,7 @@ void
InteropSubtitleAsset::add_font (string load_id, dcp::ArrayData data)
{
_fonts.push_back (Font(load_id, make_uuid(), data));
- auto const uri = String::compose("font_%1.ttf", _load_font_nodes.size());
+ auto const uri = compose("font_%1.ttf", _load_font_nodes.size());
_load_font_nodes.push_back (shared_ptr<InteropLoadFontNode>(new InteropLoadFontNode(load_id, uri)));
}
@@ -210,7 +210,7 @@ InteropSubtitleAsset::write (boost::filesystem::path p) const
for (auto i: _subtitles) {
auto im = dynamic_pointer_cast<dcp::SubtitleImage> (i);
if (im) {
- im->write_png_file(p.parent_path() / String::compose("%1.png", im->id()));
+ im->write_png_file(p.parent_path() / compose("%1.png", im->id()));
}
}
diff --git a/src/j2k_transcode.cc b/src/j2k_transcode.cc
index 6b0aa58d..6cdeec42 100644
--- a/src/j2k_transcode.cc
+++ b/src/j2k_transcode.cc
@@ -172,9 +172,9 @@ dcp::decompress_j2k (uint8_t const * data, int64_t size, int reduce)
opj_destroy_codec (decoder);
opj_stream_destroy (stream);
if (format == OPJ_CODEC_J2K) {
- boost::throw_exception (ReadError (String::compose ("could not decode JPEG2000 codestream of %1 bytes.", size)));
+ boost::throw_exception (ReadError (compose("could not decode JPEG2000 codestream of %1 bytes.", size)));
} else {
- boost::throw_exception (ReadError (String::compose ("could not decode JP2 file of %1 bytes.", size)));
+ boost::throw_exception (ReadError (compose("could not decode JP2 file of %1 bytes.", size)));
}
}
@@ -204,7 +204,7 @@ dcp::decompress_j2k (uint8_t* data, int64_t size, int reduce)
if (!image) {
opj_destroy_decompress (decoder);
opj_cio_close (cio);
- boost::throw_exception (ReadError (String::compose ("could not decode JPEG2000 codestream of %1 bytes.", size)));
+ boost::throw_exception (ReadError (compose("could not decode JPEG2000 codestream of %1 bytes.", size)));
}
opj_destroy_decompress (decoder);
diff --git a/src/language_tag.cc b/src/language_tag.cc
index 9ceaba00..2bd77a28 100644
--- a/src/language_tag.cc
+++ b/src/language_tag.cc
@@ -82,7 +82,7 @@ LanguageTag::Subtag::Subtag (string subtag, SubtagType type)
: _subtag (subtag)
{
if (!get_subtag_data(type, subtag)) {
- throw LanguageTagError(String::compose("Unknown %1 string %2", subtag_type_name(type), subtag));
+ throw LanguageTagError(compose("Unknown %1 string %2", subtag_type_name(type), subtag));
}
}
@@ -92,7 +92,7 @@ LanguageTag::LanguageTag (string tag)
vector<string> parts;
boost::split (parts, tag, boost::is_any_of("-"));
if (parts.empty()) {
- throw LanguageTagError (String::compose("Could not parse language tag %1", tag));
+ throw LanguageTagError (compose("Could not parse language tag %1", tag));
}
vector<string>::size_type p = 0;
@@ -142,7 +142,7 @@ LanguageTag::LanguageTag (string tag)
} catch (...) {}
if (p < parts.size()) {
- throw LanguageTagError (String::compose("Unrecognised subtag %1", parts[p]));
+ throw LanguageTagError (compose("Unrecognised subtag %1", parts[p]));
}
}
@@ -201,7 +201,7 @@ void
LanguageTag::add_variant (VariantSubtag variant)
{
if (find(_variants.begin(), _variants.end(), variant) != _variants.end()) {
- throw LanguageTagError (String::compose("Duplicate Variant subtag %1", variant.subtag()));
+ throw LanguageTagError (compose("Duplicate Variant subtag %1", variant.subtag()));
}
_variants.push_back (variant);
@@ -217,7 +217,7 @@ check_for_duplicates (vector<T> const& subtags, dcp::LanguageTag::SubtagType typ
optional<T> last;
for (auto const& i: sorted) {
if (last && i == *last) {
- throw LanguageTagError (String::compose("Duplicate %1 subtag %2", dcp::LanguageTag::subtag_type_name(type), i.subtag()));
+ throw LanguageTagError (compose("Duplicate %1 subtag %2", dcp::LanguageTag::subtag_type_name(type), i.subtag()));
}
last = i;
}
@@ -236,7 +236,7 @@ void
LanguageTag::add_extlang (ExtlangSubtag extlang)
{
if (find(_extlangs.begin(), _extlangs.end(), extlang) != _extlangs.end()) {
- throw LanguageTagError (String::compose("Duplicate Extlang subtag %1", extlang.subtag()));
+ throw LanguageTagError (compose("Duplicate Extlang subtag %1", extlang.subtag()));
}
_extlangs.push_back (extlang);
diff --git a/src/mono_picture_asset.cc b/src/mono_picture_asset.cc
index ea753d0e..33ad3b21 100644
--- a/src/mono_picture_asset.cc
+++ b/src/mono_picture_asset.cc
@@ -170,7 +170,7 @@ MonoPictureAsset::equals (shared_ptr<const Asset> other, EqualityOptions opt, No
#pragma omp critical
#endif
{
- note (NoteType::PROGRESS, String::compose("Compared video frame %1 of %2", i, _intrinsic_duration));
+ note (NoteType::PROGRESS, compose("Compared video frame %1 of %2", i, _intrinsic_duration));
for (auto const& i: notes) {
note (i.first, i.second);
}
diff --git a/src/mono_picture_frame.cc b/src/mono_picture_frame.cc
index c40eb01a..93b47e1b 100644
--- a/src/mono_picture_frame.cc
+++ b/src/mono_picture_frame.cc
@@ -90,7 +90,7 @@ MonoPictureFrame::MonoPictureFrame (ASDCP::JP2K::MXFReader* reader, int n, share
auto const r = reader->ReadFrame (n, *_buffer, c->context(), check_hmac ? c->hmac() : nullptr);
if (ASDCP_FAILURE(r)) {
- boost::throw_exception (ReadError(String::compose ("could not read video frame %1 (%2)", n, static_cast<int>(r))));
+ boost::throw_exception (ReadError(compose("could not read video frame %1 (%2)", n, static_cast<int>(r))));
}
}
diff --git a/src/picture_asset.cc b/src/picture_asset.cc
index e905aeb1..ab8460c9 100644
--- a/src/picture_asset.cc
+++ b/src/picture_asset.cc
@@ -160,7 +160,7 @@ PictureAsset::frame_buffer_equals (
for (int c = 0; c < 3; ++c) {
if (image_A->size() != image_B->size()) {
- note (NoteType::ERROR, String::compose ("image sizes for frame %1 differ", frame));
+ note (NoteType::ERROR, compose("image sizes for frame %1 differ", frame));
return false;
}
@@ -186,12 +186,12 @@ PictureAsset::frame_buffer_equals (
auto const std_dev = sqrt (double (total_squared_deviation) / abs_diffs.size());
- note (NoteType::NOTE, String::compose("mean difference %1 deviation %2", mean, std_dev));
+ note (NoteType::NOTE, compose("mean difference %1 deviation %2", mean, std_dev));
if (mean > opt.max_mean_pixel_error) {
note (
NoteType::ERROR,
- String::compose ("mean %1 out of range %2 in frame %3", mean, opt.max_mean_pixel_error, frame)
+ compose("mean %1 out of range %2 in frame %3", mean, opt.max_mean_pixel_error, frame)
);
return false;
@@ -200,7 +200,7 @@ PictureAsset::frame_buffer_equals (
if (std_dev > opt.max_std_dev_pixel_error) {
note (
NoteType::ERROR,
- String::compose ("standard deviation %1 out of range %2 in frame %3", std_dev, opt.max_std_dev_pixel_error, frame)
+ compose("standard deviation %1 out of range %2 in frame %3", std_dev, opt.max_std_dev_pixel_error, frame)
);
return false;
diff --git a/src/reel_asset.cc b/src/reel_asset.cc
index 1807ae66..8e8e6b2d 100644
--- a/src/reel_asset.cc
+++ b/src/reel_asset.cc
@@ -139,7 +139,7 @@ ReelAsset::asset_equals (shared_ptr<const ReelAsset> other, EqualityOptions opt,
}
if (_intrinsic_duration != other->_intrinsic_duration) {
- note (NoteType::ERROR, String::compose ("Reel: intrinsic durations differ (%1 vs %2)", _intrinsic_duration, other->_intrinsic_duration));
+ note (NoteType::ERROR, compose("Reel: intrinsic durations differ (%1 vs %2)", _intrinsic_duration, other->_intrinsic_duration));
return false;
}
diff --git a/src/reel_picture_asset.cc b/src/reel_picture_asset.cc
index 15ccf013..795122ac 100644
--- a/src/reel_picture_asset.cc
+++ b/src/reel_picture_asset.cc
@@ -91,7 +91,7 @@ ReelPictureAsset::write_to_cpl (xmlpp::Node* node, Standard standard) const
{
auto asset = ReelFileAsset::write_to_cpl (node, standard);
- asset->add_child("FrameRate")->add_child_text(String::compose("%1 %2", _frame_rate.numerator, _frame_rate.denominator));
+ asset->add_child("FrameRate")->add_child_text(compose("%1 %2", _frame_rate.numerator, _frame_rate.denominator));
if (standard == Standard::INTEROP) {
@@ -116,7 +116,7 @@ ReelPictureAsset::write_to_cpl (xmlpp::Node* node, Standard standard) const
asset->add_child("ScreenAspectRatio")->add_child_text(raw_convert<string>(closest.get(), 2, true));
} else {
asset->add_child("ScreenAspectRatio")->add_child_text(
- String::compose ("%1 %2", _screen_aspect_ratio.numerator, _screen_aspect_ratio.denominator)
+ compose("%1 %2", _screen_aspect_ratio.numerator, _screen_aspect_ratio.denominator)
);
}
diff --git a/src/rgb_xyz.cc b/src/rgb_xyz.cc
index 734d5a95..4e83944b 100644
--- a/src/rgb_xyz.cc
+++ b/src/rgb_xyz.cc
@@ -180,21 +180,21 @@ dcp::xyz_to_rgb (
if (cx < 0 || cx > 4095) {
if (note) {
- note.get()(NoteType::NOTE, String::compose("XYZ value %1 out of range", cx));
+ note.get()(NoteType::NOTE, compose("XYZ value %1 out of range", cx));
}
cx = max (min (cx, 4095), 0);
}
if (cy < 0 || cy > 4095) {
if (note) {
- note.get()(NoteType::NOTE, String::compose("XYZ value %1 out of range", cy));
+ note.get()(NoteType::NOTE, compose("XYZ value %1 out of range", cy));
}
cy = max (min (cy, 4095), 0);
}
if (cz < 0 || cz > 4095) {
if (note) {
- note.get()(NoteType::NOTE, String::compose("XYZ value %1 out of range", cz));
+ note.get()(NoteType::NOTE, compose("XYZ value %1 out of range", cz));
}
cz = max (min (cz, 4095), 0);
}
@@ -322,7 +322,7 @@ dcp::rgb_to_xyz (
}
if (clamped && note) {
- note.get()(NoteType::NOTE, String::compose("%1 XYZ value(s) clamped", clamped));
+ note.get()(NoteType::NOTE, compose("%1 XYZ value(s) clamped", clamped));
}
return xyz;
diff --git a/src/smpte_subtitle_asset.cc b/src/smpte_subtitle_asset.cc
index 19ef8b5b..8645c828 100644
--- a/src/smpte_subtitle_asset.cc
+++ b/src/smpte_subtitle_asset.cc
@@ -123,7 +123,7 @@ SMPTESubtitleAsset::SMPTESubtitleAsset (boost::filesystem::path file)
} catch (cxml::Error& e) {
boost::throw_exception (
ReadError (
- String::compose (
+ compose(
"Failed to read subtitle file %1; MXF failed with %2, XML failed with %3",
file, static_cast<int>(r), e.what()
)
@@ -138,11 +138,11 @@ SMPTESubtitleAsset::SMPTESubtitleAsset (boost::filesystem::path file)
auto im = dynamic_pointer_cast<SubtitleImage>(i);
if (im && im->png_image().size() == 0) {
/* Even more dubious; allow <id>.png or urn:uuid:<id>.png */
- auto p = file.parent_path() / String::compose("%1.png", im->id());
+ auto p = file.parent_path() / compose("%1.png", im->id());
if (boost::filesystem::is_regular_file(p)) {
im->read_png_file (p);
} else if (starts_with (im->id(), "urn:uuid:")) {
- p = file.parent_path() / String::compose("%1.png", remove_urn_uuid(im->id()));
+ p = file.parent_path() / compose("%1.png", remove_urn_uuid(im->id()));
if (boost::filesystem::is_regular_file(p)) {
im->read_png_file (p);
}
@@ -303,7 +303,7 @@ SMPTESubtitleAsset::set_key (Key key)
if (ASDCP_FAILURE (r)) {
boost::throw_exception (
ReadError (
- String::compose ("Could not read encrypted subtitle MXF (%1)", static_cast<int> (r))
+ compose("Could not read encrypted subtitle MXF (%1)", static_cast<int> (r))
)
);
}
@@ -520,7 +520,7 @@ SMPTESubtitleAsset::equals (shared_ptr<const Asset> other_asset, EqualityOptions
}
if (_language != other->_language) {
- note (NoteType::ERROR, String::compose("Subtitle languages differ (`%1' vs `%2')", _language.get_value_or("[none]"), other->_language.get_value_or("[none]")));
+ note (NoteType::ERROR, compose("Subtitle languages differ (`%1' vs `%2')", _language.get_value_or("[none]"), other->_language.get_value_or("[none]")));
return false;
}
diff --git a/src/sound_asset.cc b/src/sound_asset.cc
index bbb21913..83b86d63 100644
--- a/src/sound_asset.cc
+++ b/src/sound_asset.cc
@@ -146,7 +146,7 @@ SoundAsset::equals (shared_ptr<const Asset> other, EqualityOptions opt, NoteHand
if (desc_A.EditRate != desc_B.EditRate) {
note (
NoteType::ERROR,
- String::compose (
+ compose(
"audio edit rates differ: %1/%2 cf %3/%4",
desc_A.EditRate.Numerator, desc_A.EditRate.Denominator, desc_B.EditRate.Numerator, desc_B.EditRate.Denominator
)
@@ -155,7 +155,7 @@ SoundAsset::equals (shared_ptr<const Asset> other, EqualityOptions opt, NoteHand
} else if (desc_A.AudioSamplingRate != desc_B.AudioSamplingRate) {
note (
NoteType::ERROR,
- String::compose (
+ compose(
"audio sampling rates differ: %1 cf %2",
desc_A.AudioSamplingRate.Numerator, desc_A.AudioSamplingRate.Denominator,
desc_B.AudioSamplingRate.Numerator, desc_B.AudioSamplingRate.Numerator
@@ -163,25 +163,25 @@ SoundAsset::equals (shared_ptr<const Asset> other, EqualityOptions opt, NoteHand
);
return false;
} else if (desc_A.Locked != desc_B.Locked) {
- note (NoteType::ERROR, String::compose ("audio locked flags differ: %1 cf %2", desc_A.Locked, desc_B.Locked));
+ note (NoteType::ERROR, compose("audio locked flags differ: %1 cf %2", desc_A.Locked, desc_B.Locked));
return false;
} else if (desc_A.ChannelCount != desc_B.ChannelCount) {
- note (NoteType::ERROR, String::compose ("audio channel counts differ: %1 cf %2", desc_A.ChannelCount, desc_B.ChannelCount));
+ note (NoteType::ERROR, compose("audio channel counts differ: %1 cf %2", desc_A.ChannelCount, desc_B.ChannelCount));
return false;
} else if (desc_A.QuantizationBits != desc_B.QuantizationBits) {
- note (NoteType::ERROR, String::compose ("audio bits per sample differ: %1 cf %2", desc_A.QuantizationBits, desc_B.QuantizationBits));
+ note (NoteType::ERROR, compose("audio bits per sample differ: %1 cf %2", desc_A.QuantizationBits, desc_B.QuantizationBits));
return false;
} else if (desc_A.BlockAlign != desc_B.BlockAlign) {
- note (NoteType::ERROR, String::compose ("audio bytes per sample differ: %1 cf %2", desc_A.BlockAlign, desc_B.BlockAlign));
+ note (NoteType::ERROR, compose("audio bytes per sample differ: %1 cf %2", desc_A.BlockAlign, desc_B.BlockAlign));
return false;
} else if (desc_A.AvgBps != desc_B.AvgBps) {
- note (NoteType::ERROR, String::compose ("audio average bps differ: %1 cf %2", desc_A.AvgBps, desc_B.AvgBps));
+ note (NoteType::ERROR, compose("audio average bps differ: %1 cf %2", desc_A.AvgBps, desc_B.AvgBps));
return false;
} else if (desc_A.LinkedTrackID != desc_B.LinkedTrackID) {
- note (NoteType::ERROR, String::compose ("audio linked track IDs differ: %1 cf %2", desc_A.LinkedTrackID, desc_B.LinkedTrackID));
+ note (NoteType::ERROR, compose("audio linked track IDs differ: %1 cf %2", desc_A.LinkedTrackID, desc_B.LinkedTrackID));
return false;
} else if (desc_A.ContainerDuration != desc_B.ContainerDuration) {
- note (NoteType::ERROR, String::compose ("audio container durations differ: %1 cf %2", desc_A.ContainerDuration, desc_B.ContainerDuration));
+ note (NoteType::ERROR, compose("audio container durations differ: %1 cf %2", desc_A.ContainerDuration, desc_B.ContainerDuration));
return false;
} else if (desc_A.ChannelFormat != desc_B.ChannelFormat) {
/* XXX */
@@ -198,7 +198,7 @@ SoundAsset::equals (shared_ptr<const Asset> other, EqualityOptions opt, NoteHand
auto frame_B = other_reader->get_frame (i);
if (frame_A->size() != frame_B->size()) {
- note (NoteType::ERROR, String::compose ("sizes of audio data for frame %1 differ", i));
+ note (NoteType::ERROR, compose("sizes of audio data for frame %1 differ", i));
return false;
}
@@ -207,7 +207,7 @@ SoundAsset::equals (shared_ptr<const Asset> other, EqualityOptions opt, NoteHand
for (int channel = 0; channel < frame_A->channels(); ++channel) {
int32_t const d = abs(frame_A->get(channel, sample) - frame_B->get(channel, sample));
if (d > opt.max_audio_sample_error) {
- note (NoteType::ERROR, String::compose("PCM data difference of %1 in frame %2, channel %3, sample %4", d, i, channel, sample));
+ note (NoteType::ERROR, compose("PCM data difference of %1 in frame %2, channel %3, sample %4", d, i, channel, sample));
return false;
}
}
diff --git a/src/sound_asset_writer.cc b/src/sound_asset_writer.cc
index 346dcc12..29f3360d 100644
--- a/src/sound_asset_writer.cc
+++ b/src/sound_asset_writer.cc
@@ -242,7 +242,7 @@ SoundAssetWriter::write_current_frame ()
{
auto const r = _state->mxf_writer.WriteFrame (_state->frame_buffer, _crypto_context->context(), _crypto_context->hmac());
if (ASDCP_FAILURE(r)) {
- boost::throw_exception (MiscError(String::compose("could not write audio MXF frame (%1)", static_cast<int>(r))));
+ boost::throw_exception (MiscError(compose("could not write audio MXF frame (%1)", static_cast<int>(r))));
}
++_frames_written;
@@ -263,7 +263,7 @@ SoundAssetWriter::finalize ()
if (_started) {
auto const r = _state->mxf_writer.Finalize();
if (ASDCP_FAILURE(r)) {
- boost::throw_exception (MiscError(String::compose ("could not finalise audio MXF (%1)", static_cast<int>(r))));
+ boost::throw_exception (MiscError(compose("could not finalise audio MXF (%1)", static_cast<int>(r))));
}
}
diff --git a/src/stereo_picture_frame.cc b/src/stereo_picture_frame.cc
index 46a0ef80..be45c847 100644
--- a/src/stereo_picture_frame.cc
+++ b/src/stereo_picture_frame.cc
@@ -102,7 +102,7 @@ StereoPictureFrame::StereoPictureFrame (ASDCP::JP2K::MXFSReader* reader, int n,
_buffer = make_shared<ASDCP::JP2K::SFrameBuffer>(4 * Kumu::Megabyte);
if (ASDCP_FAILURE (reader->ReadFrame (n, *_buffer, c->context(), check_hmac ? c->hmac() : nullptr))) {
- boost::throw_exception (ReadError (String::compose ("could not read video frame %1 of %2", n)));
+ boost::throw_exception (ReadError (compose("could not read video frame %1 of %2", n)));
}
}
diff --git a/src/subtitle_asset.cc b/src/subtitle_asset.cc
index e236b77a..c540c96c 100644
--- a/src/subtitle_asset.cc
+++ b/src/subtitle_asset.cc
@@ -88,7 +88,7 @@ string_attribute (xmlpp::Element const * node, string name)
{
auto a = node->get_attribute (name);
if (!a) {
- throw XMLError (String::compose ("missing attribute %1", name));
+ throw XMLError (compose("missing attribute %1", name));
}
return string (a->get_value ());
}
@@ -524,7 +524,7 @@ SubtitleAsset::equals (shared_ptr<const Asset> other_asset, EqualityOptions opti
}
if (_subtitles.size() != other->_subtitles.size()) {
- note (NoteType::ERROR, String::compose("different number of subtitles: %1 vs %2", _subtitles.size(), other->_subtitles.size()));
+ note (NoteType::ERROR, compose("different number of subtitles: %1 vs %2", _subtitles.size(), other->_subtitles.size()));
return false;
}
@@ -543,7 +543,7 @@ SubtitleAsset::equals (shared_ptr<const Asset> other_asset, EqualityOptions opti
}
if (string_i && *string_i != *string_j) {
- note (NoteType::ERROR, String::compose("subtitles differ in text or metadata: %1 vs %2", string_i->text(), string_j->text()));
+ note (NoteType::ERROR, compose("subtitles differ in text or metadata: %1 vs %2", string_i->text(), string_j->text()));
return false;
}
diff --git a/src/types.cc b/src/types.cc
index 40ceb18c..3e50af38 100644
--- a/src/types.cc
+++ b/src/types.cc
@@ -91,7 +91,7 @@ Fraction::Fraction (string s)
string
Fraction::as_string () const
{
- return String::compose ("%1 %2", numerator, denominator);
+ return compose("%1 %2", numerator, denominator);
}
@@ -505,7 +505,7 @@ void
Luminance::set_value (float v)
{
if (v < 0) {
- throw dcp::MiscError (String::compose("Invalid luminance value %1", v));
+ throw dcp::MiscError (compose("Invalid luminance value %1", v));
}
_value = v;
@@ -546,7 +546,7 @@ Luminance::string_to_unit (string u)
return Unit::FOOT_LAMBERT;
}
- throw XMLError (String::compose("Invalid luminance unit %1", u));
+ throw XMLError (compose("Invalid luminance unit %1", u));
}
diff --git a/src/util.cc b/src/util.cc
index a36e2429..222b5a05 100644
--- a/src/util.cc
+++ b/src/util.cc
@@ -281,7 +281,7 @@ dcp::file_to_string (boost::filesystem::path p, uintmax_t max_length)
{
auto len = boost::filesystem::file_size (p);
if (len > max_length) {
- throw MiscError (String::compose("Unexpectedly long file (%1)", p.string()));
+ throw MiscError (compose("Unexpectedly long file (%1)", p.string()));
}
auto f = fopen_boost (p, "r");
@@ -414,7 +414,7 @@ dcp::unique_string (vector<string> existing, string base)
{
int const max_tries = existing.size() + 1;
for (int i = 0; i < max_tries; ++i) {
- string trial = String::compose("%1%2", base, i);
+ string trial = compose("%1%2", base, i);
if (find(existing.begin(), existing.end(), trial) == existing.end()) {
return trial;
}
diff --git a/src/verify.cc b/src/verify.cc
index 6e335c6f..47ae205f 100644
--- a/src/verify.cc
+++ b/src/verify.cc
@@ -335,7 +335,7 @@ validate_xml (T xml, boost::filesystem::path xsd_dtd_directory, vector<Verificat
*/
string locations;
for (auto i: schema) {
- locations += String::compose("%1 %1 ", i, i);
+ locations += compose("%1 %1 ", i, i);
}
parser.setExternalSchemaLocation(locations.c_str());
@@ -519,7 +519,7 @@ verify_main_picture_asset (
notes.push_back({
VerificationNote::Type::BV21_ERROR,
VerificationNote::Code::INVALID_PICTURE_SIZE_IN_PIXELS,
- String::compose("%1x%2", asset->size().width, asset->size().height),
+ compose("%1x%2", asset->size().width, asset->size().height),
file
});
}
@@ -532,7 +532,7 @@ verify_main_picture_asset (
notes.push_back({
VerificationNote::Type::BV21_ERROR,
VerificationNote::Code::INVALID_PICTURE_FRAME_RATE_FOR_2K,
- String::compose("%1/%2", asset->edit_rate().numerator, asset->edit_rate().denominator),
+ compose("%1/%2", asset->edit_rate().numerator, asset->edit_rate().denominator),
file
});
}
@@ -543,7 +543,7 @@ verify_main_picture_asset (
notes.push_back({
VerificationNote::Type::BV21_ERROR,
VerificationNote::Code::INVALID_PICTURE_FRAME_RATE_FOR_4K,
- String::compose("%1/%2", asset->edit_rate().numerator, asset->edit_rate().denominator),
+ compose("%1/%2", asset->edit_rate().numerator, asset->edit_rate().denominator),
file
});
}
@@ -553,7 +553,7 @@ verify_main_picture_asset (
notes.push_back({
VerificationNote::Type::BV21_ERROR,
VerificationNote::Code::INVALID_PICTURE_ASSET_RESOLUTION_FOR_3D,
- String::compose("%1/%2", asset->edit_rate().numerator, asset->edit_rate().denominator),
+ compose("%1/%2", asset->edit_rate().numerator, asset->edit_rate().denominator),
file
});
@@ -679,7 +679,7 @@ verify_smpte_timed_text_asset (
{
VerificationNote::Type::BV21_ERROR,
VerificationNote::Code::MISMATCHED_TIMED_TEXT_DURATION,
- String::compose("%1 %2", *reel_asset_duration, asset->intrinsic_duration()),
+ compose("%1 %2", *reel_asset_duration, asset->intrinsic_duration()),
asset->file().get()
});
}
@@ -1287,7 +1287,7 @@ dcp::verify (
notes.push_back ({
VerificationNote::Type::ERROR,
VerificationNote::Code::INVALID_PICTURE_FRAME_RATE,
- String::compose("%1/%2", frame_rate.numerator, frame_rate.denominator)
+ compose("%1/%2", frame_rate.numerator, frame_rate.denominator)
});
}
/* Check asset */
@@ -1460,65 +1460,65 @@ dcp::note_to_string (VerificationNote note)
case VerificationNote::Code::FAILED_READ:
return *note.note();
case VerificationNote::Code::MISMATCHED_CPL_HASHES:
- return String::compose("The hash of the CPL %1 in the PKL does not agree with the CPL file.", note.note().get());
+ return compose("The hash of the CPL %1 in the PKL does not agree with the CPL file.", note.note().get());
case VerificationNote::Code::INVALID_PICTURE_FRAME_RATE:
- return String::compose("The picture in a reel has an invalid frame rate %1.", note.note().get());
+ return compose("The picture in a reel has an invalid frame rate %1.", note.note().get());
case VerificationNote::Code::INCORRECT_PICTURE_HASH:
- return String::compose("The hash of the picture asset %1 does not agree with the PKL file.", note.file()->filename());
+ return compose("The hash of the picture asset %1 does not agree with the PKL file.", note.file()->filename());
case VerificationNote::Code::MISMATCHED_PICTURE_HASHES:
- return String::compose("The PKL and CPL hashes differ for the picture asset %1.", note.file()->filename());
+ return compose("The PKL and CPL hashes differ for the picture asset %1.", note.file()->filename());
case VerificationNote::Code::INCORRECT_SOUND_HASH:
- return String::compose("The hash of the sound asset %1 does not agree with the PKL file.", note.file()->filename());
+ return compose("The hash of the sound asset %1 does not agree with the PKL file.", note.file()->filename());
case VerificationNote::Code::MISMATCHED_SOUND_HASHES:
- return String::compose("The PKL and CPL hashes differ for the sound asset %1.", note.file()->filename());
+ return compose("The PKL and CPL hashes differ for the sound asset %1.", note.file()->filename());
case VerificationNote::Code::EMPTY_ASSET_PATH:
return "The asset map contains an empty asset path.";
case VerificationNote::Code::MISSING_ASSET:
- return String::compose("The file %1 for an asset in the asset map cannot be found.", note.file()->filename());
+ return compose("The file %1 for an asset in the asset map cannot be found.", note.file()->filename());
case VerificationNote::Code::MISMATCHED_STANDARD:
return "The DCP contains both SMPTE and Interop parts.";
case VerificationNote::Code::INVALID_XML:
- return String::compose("An XML file is badly formed: %1 (%2:%3)", note.note().get(), note.file()->filename(), note.line().get());
+ return compose("An XML file is badly formed: %1 (%2:%3)", note.note().get(), note.file()->filename(), note.line().get());
case VerificationNote::Code::MISSING_ASSETMAP:
return "No ASSETMAP or ASSETMAP.xml was found.";
case VerificationNote::Code::INVALID_INTRINSIC_DURATION:
- return String::compose("The intrinsic duration of the asset %1 is less than 1 second.", note.note().get());
+ return compose("The intrinsic duration of the asset %1 is less than 1 second.", note.note().get());
case VerificationNote::Code::INVALID_DURATION:
- return String::compose("The duration of the asset %1 is less than 1 second.", note.note().get());
+ return compose("The duration of the asset %1 is less than 1 second.", note.note().get());
case VerificationNote::Code::INVALID_PICTURE_FRAME_SIZE_IN_BYTES:
- return String::compose("The instantaneous bit rate of the picture asset %1 is larger than the limit of 250Mbit/s in at least one place.", note.file()->filename());
+ return compose("The instantaneous bit rate of the picture asset %1 is larger than the limit of 250Mbit/s in at least one place.", note.file()->filename());
case VerificationNote::Code::NEARLY_INVALID_PICTURE_FRAME_SIZE_IN_BYTES:
- return String::compose("The instantaneous bit rate of the picture asset %1 is close to the limit of 250Mbit/s in at least one place.", note.file()->filename());
+ return compose("The instantaneous bit rate of the picture asset %1 is close to the limit of 250Mbit/s in at least one place.", note.file()->filename());
case VerificationNote::Code::EXTERNAL_ASSET:
- return String::compose("The asset %1 that this DCP refers to is not included in the DCP. It may be a VF.", note.note().get());
+ return compose("The asset %1 that this DCP refers to is not included in the DCP. It may be a VF.", note.note().get());
case VerificationNote::Code::THREED_ASSET_MARKED_AS_TWOD:
- return String::compose("The asset %1 is 3D but its MXF is marked as 2D.", note.file()->filename());
+ return compose("The asset %1 is 3D but its MXF is marked as 2D.", note.file()->filename());
case VerificationNote::Code::INVALID_STANDARD:
return "This DCP does not use the SMPTE standard.";
case VerificationNote::Code::INVALID_LANGUAGE:
- return String::compose("The DCP specifies a language '%1' which does not conform to the RFC 5646 standard.", note.note().get());
+ return compose("The DCP specifies a language '%1' which does not conform to the RFC 5646 standard.", note.note().get());
case VerificationNote::Code::INVALID_PICTURE_SIZE_IN_PIXELS:
- return String::compose("The size %1 of picture asset %2 is not allowed.", note.note().get(), note.file()->filename());
+ return compose("The size %1 of picture asset %2 is not allowed.", note.note().get(), note.file()->filename());
case VerificationNote::Code::INVALID_PICTURE_FRAME_RATE_FOR_2K:
- return String::compose("The frame rate %1 of picture asset %2 is not allowed for 2K DCPs.", note.note().get(), note.file()->filename());
+ return compose("The frame rate %1 of picture asset %2 is not allowed for 2K DCPs.", note.note().get(), note.file()->filename());
case VerificationNote::Code::INVALID_PICTURE_FRAME_RATE_FOR_4K:
- return String::compose("The frame rate %1 of picture asset %2 is not allowed for 4K DCPs.", note.note().get(), note.file()->filename());
+ return compose("The frame rate %1 of picture asset %2 is not allowed for 4K DCPs.", note.note().get(), note.file()->filename());
case VerificationNote::Code::INVALID_PICTURE_ASSET_RESOLUTION_FOR_3D:
return "3D 4K DCPs are not allowed.";
case VerificationNote::Code::INVALID_CLOSED_CAPTION_XML_SIZE_IN_BYTES:
- return String::compose("The size %1 of the closed caption asset %2 is larger than the 256KB maximum.", note.note().get(), note.file()->filename());
+ return compose("The size %1 of the closed caption asset %2 is larger than the 256KB maximum.", note.note().get(), note.file()->filename());
case VerificationNote::Code::INVALID_TIMED_TEXT_SIZE_IN_BYTES:
- return String::compose("The size %1 of the timed text asset %2 is larger than the 115MB maximum.", note.note().get(), note.file()->filename());
+ return compose("The size %1 of the timed text asset %2 is larger than the 115MB maximum.", note.note().get(), note.file()->filename());
case VerificationNote::Code::INVALID_TIMED_TEXT_FONT_SIZE_IN_BYTES:
- return String::compose("The size %1 of the fonts in timed text asset %2 is larger than the 10MB maximum.", note.note().get(), note.file()->filename());
+ return compose("The size %1 of the fonts in timed text asset %2 is larger than the 10MB maximum.", note.note().get(), note.file()->filename());
case VerificationNote::Code::MISSING_SUBTITLE_LANGUAGE:
- return String::compose("The XML for the SMPTE subtitle asset %1 has no <Language> tag.", note.file()->filename());
+ return compose("The XML for the SMPTE subtitle asset %1 has no <Language> tag.", note.file()->filename());
case VerificationNote::Code::MISMATCHED_SUBTITLE_LANGUAGES:
return "Some subtitle assets have different <Language> tags than others";
case VerificationNote::Code::MISSING_SUBTITLE_START_TIME:
- return String::compose("The XML for the SMPTE subtitle asset %1 has no <StartTime> tag.", note.file()->filename());
+ return compose("The XML for the SMPTE subtitle asset %1 has no <StartTime> tag.", note.file()->filename());
case VerificationNote::Code::INVALID_SUBTITLE_START_TIME:
- return String::compose("The XML for a SMPTE subtitle asset %1 has a non-zero <StartTime> tag.", note.file()->filename());
+ return compose("The XML for a SMPTE subtitle asset %1 has a non-zero <StartTime> tag.", note.file()->filename());
case VerificationNote::Code::INVALID_SUBTITLE_FIRST_TEXT_TIME:
return "The first subtitle or closed caption is less than 4 seconds from the start of the DCP.";
case VerificationNote::Code::INVALID_SUBTITLE_DURATION:
@@ -1538,11 +1538,11 @@ dcp::note_to_string (VerificationNote note)
case VerificationNote::Code::INVALID_CLOSED_CAPTION_LINE_LENGTH:
return "There are more than 32 characters in at least one closed caption line.";
case VerificationNote::Code::INVALID_SOUND_FRAME_RATE:
- return String::compose("The sound asset %1 has a sampling rate of %2", note.file()->filename(), note.note().get());
+ return compose("The sound asset %1 has a sampling rate of %2", note.file()->filename(), note.note().get());
case VerificationNote::Code::MISSING_CPL_ANNOTATION_TEXT:
- return String::compose("The CPL %1 has no <AnnotationText> tag.", note.note().get());
+ return compose("The CPL %1 has no <AnnotationText> tag.", note.note().get());
case VerificationNote::Code::MISMATCHED_CPL_ANNOTATION_TEXT:
- return String::compose("The CPL %1 has an <AnnotationText> which differs from its <ContentTitleText>", note.note().get());
+ return compose("The CPL %1 has an <AnnotationText> which differs from its <ContentTitleText>", note.note().get());
case VerificationNote::Code::MISMATCHED_ASSET_DURATION:
return "All assets in a reel do not have the same duration.";
case VerificationNote::Code::MISSING_MAIN_SUBTITLE_FROM_SOME_REELS:
@@ -1550,15 +1550,15 @@ dcp::note_to_string (VerificationNote note)
case VerificationNote::Code::MISMATCHED_CLOSED_CAPTION_ASSET_COUNTS:
return "At least one reel has closed captions, but reels have different numbers of closed caption assets.";
case VerificationNote::Code::MISSING_SUBTITLE_ENTRY_POINT:
- return String::compose("The subtitle asset %1 has no <EntryPoint> tag.", note.note().get());
+ return compose("The subtitle asset %1 has no <EntryPoint> tag.", note.note().get());
case VerificationNote::Code::INCORRECT_SUBTITLE_ENTRY_POINT:
- return String::compose("The subtitle asset %1 has an <EntryPoint> other than 0.", note.note().get());
+ return compose("The subtitle asset %1 has an <EntryPoint> other than 0.", note.note().get());
case VerificationNote::Code::MISSING_CLOSED_CAPTION_ENTRY_POINT:
- return String::compose("The closed caption asset %1 has no <EntryPoint> tag.", note.note().get());
+ return compose("The closed caption asset %1 has no <EntryPoint> tag.", note.note().get());
case VerificationNote::Code::INCORRECT_CLOSED_CAPTION_ENTRY_POINT:
- return String::compose("The closed caption asset %1 has an <EntryPoint> other than 0.", note.note().get());
+ return compose("The closed caption asset %1 has an <EntryPoint> other than 0.", note.note().get());
case VerificationNote::Code::MISSING_HASH:
- return String::compose("The asset %1 has no <Hash> tag in the CPL.", note.note().get());
+ return compose("The asset %1 has no <Hash> tag in the CPL.", note.note().get());
case VerificationNote::Code::MISSING_FFEC_IN_FEATURE:
return "The DCP is marked as a Feature but there is no FFEC (first frame of end credits) marker";
case VerificationNote::Code::MISSING_FFMC_IN_FEATURE:
@@ -1568,49 +1568,49 @@ dcp::note_to_string (VerificationNote note)
case VerificationNote::Code::MISSING_LFOC:
return "There should be a LFOC (last frame of content) marker";
case VerificationNote::Code::INCORRECT_FFOC:
- return String::compose("The FFOC marker is %1 instead of 1", note.note().get());
+ return compose("The FFOC marker is %1 instead of 1", note.note().get());
case VerificationNote::Code::INCORRECT_LFOC:
- return String::compose("The LFOC marker is %1 instead of 1 less than the duration of the last reel.", note.note().get());
+ return compose("The LFOC marker is %1 instead of 1 less than the duration of the last reel.", note.note().get());
case VerificationNote::Code::MISSING_CPL_METADATA:
- return String::compose("The CPL %1 has no <CompositionMetadataAsset> tag.", note.note().get());
+ return compose("The CPL %1 has no <CompositionMetadataAsset> tag.", note.note().get());
case VerificationNote::Code::MISSING_CPL_METADATA_VERSION_NUMBER:
- return String::compose("The CPL %1 has no <VersionNumber> in its <CompositionMetadataAsset>.", note.note().get());
+ return compose("The CPL %1 has no <VersionNumber> in its <CompositionMetadataAsset>.", note.note().get());
case VerificationNote::Code::MISSING_EXTENSION_METADATA:
- return String::compose("The CPL %1 has no <ExtensionMetadata> in its <CompositionMetadataAsset>.", note.note().get());
+ return compose("The CPL %1 has no <ExtensionMetadata> in its <CompositionMetadataAsset>.", note.note().get());
case VerificationNote::Code::INVALID_EXTENSION_METADATA:
- return String::compose("The CPL %1 has a malformed <ExtensionMetadata> (%2).", note.file()->filename(), note.note().get());
+ return compose("The CPL %1 has a malformed <ExtensionMetadata> (%2).", note.file()->filename(), note.note().get());
case VerificationNote::Code::UNSIGNED_CPL_WITH_ENCRYPTED_CONTENT:
- return String::compose("The CPL %1, which has encrypted content, is not signed.", note.note().get());
+ return compose("The CPL %1, which has encrypted content, is not signed.", note.note().get());
case VerificationNote::Code::UNSIGNED_PKL_WITH_ENCRYPTED_CONTENT:
- return String::compose("The PKL %1, which has encrypted content, is not signed.", note.note().get());
+ return compose("The PKL %1, which has encrypted content, is not signed.", note.note().get());
case VerificationNote::Code::MISMATCHED_PKL_ANNOTATION_TEXT_WITH_CPL:
- return String::compose("The PKL %1 has only one CPL but its <AnnotationText> does not match the CPL's <ContentTitleText>.", note.note().get());
+ return compose("The PKL %1 has only one CPL but its <AnnotationText> does not match the CPL's <ContentTitleText>.", note.note().get());
case VerificationNote::Code::PARTIALLY_ENCRYPTED:
return "Some assets are encrypted but some are not.";
case VerificationNote::Code::INVALID_JPEG2000_CODESTREAM:
- return String::compose("The JPEG2000 codestream for at least one frame is invalid (%1)", note.note().get());
+ return compose("The JPEG2000 codestream for at least one frame is invalid (%1)", note.note().get());
case VerificationNote::Code::INVALID_JPEG2000_GUARD_BITS_FOR_2K:
- return String::compose("The JPEG2000 codestream uses %1 guard bits in a 2K image instead of 1.", note.note().get());
+ return compose("The JPEG2000 codestream uses %1 guard bits in a 2K image instead of 1.", note.note().get());
case VerificationNote::Code::INVALID_JPEG2000_GUARD_BITS_FOR_4K:
- return String::compose("The JPEG2000 codestream uses %1 guard bits in a 4K image instead of 2.", note.note().get());
+ return compose("The JPEG2000 codestream uses %1 guard bits in a 4K image instead of 2.", note.note().get());
case VerificationNote::Code::INVALID_JPEG2000_TILE_SIZE:
return "The JPEG2000 tile size is not the same as the image size.";
case VerificationNote::Code::INVALID_JPEG2000_CODE_BLOCK_WIDTH:
- return String::compose("The JPEG2000 codestream uses a code block width of %1 instead of 32.", note.note().get());
+ return compose("The JPEG2000 codestream uses a code block width of %1 instead of 32.", note.note().get());
case VerificationNote::Code::INVALID_JPEG2000_CODE_BLOCK_HEIGHT:
- return String::compose("The JPEG2000 codestream uses a code block height of %1 instead of 32.", note.note().get());
+ return compose("The JPEG2000 codestream uses a code block height of %1 instead of 32.", note.note().get());
case VerificationNote::Code::INCORRECT_JPEG2000_POC_MARKER_COUNT_FOR_2K:
- return String::compose("%1 POC markers found in 2K JPEG2000 codestream instead of 0.", note.note().get());
+ return compose("%1 POC markers found in 2K JPEG2000 codestream instead of 0.", note.note().get());
case VerificationNote::Code::INCORRECT_JPEG2000_POC_MARKER_COUNT_FOR_4K:
- return String::compose("%1 POC markers found in 4K JPEG2000 codestream instead of 1.", note.note().get());
+ return compose("%1 POC markers found in 4K JPEG2000 codestream instead of 1.", note.note().get());
case VerificationNote::Code::INCORRECT_JPEG2000_POC_MARKER:
- return String::compose("Incorrect POC marker content found (%1)", note.note().get());
+ return compose("Incorrect POC marker content found (%1)", note.note().get());
case VerificationNote::Code::INVALID_JPEG2000_POC_MARKER_LOCATION:
return "POC marker found outside main header";
case VerificationNote::Code::INVALID_JPEG2000_TILE_PARTS_FOR_2K:
- return String::compose("The JPEG2000 codestream has %1 tile parts in a 2K image instead of 3.", note.note().get());
+ return compose("The JPEG2000 codestream has %1 tile parts in a 2K image instead of 3.", note.note().get());
case VerificationNote::Code::INVALID_JPEG2000_TILE_PARTS_FOR_4K:
- return String::compose("The JPEG2000 codestream has %1 tile parts in a 4K image instead of 6.", note.note().get());
+ return compose("The JPEG2000 codestream has %1 tile parts in a 4K image instead of 6.", note.note().get());
case VerificationNote::Code::MISSING_JPEG200_TLM_MARKER:
return "No TLM marker was found in a JPEG2000 codestream.";
case VerificationNote::Code::MISMATCHED_TIMED_TEXT_RESOURCE_ID:
@@ -1622,7 +1622,7 @@ dcp::note_to_string (VerificationNote note)
vector<string> parts;
boost::split (parts, note.note().get(), boost::is_any_of(" "));
DCP_ASSERT (parts.size() == 2);
- return String::compose("The reel duration of some timed text (%1) is not the same as the ContainerDuration of its MXF (%2).", parts[0], parts[1]);
+ return compose("The reel duration of some timed text (%1) is not the same as the ContainerDuration of its MXF (%2).", parts[0], parts[1]);
}
case VerificationNote::Code::MISSED_CHECK_OF_ENCRYPTED:
return "Some aspect of this DCP could not be checked because it is encrypted.";
diff --git a/src/verify_j2k.cc b/src/verify_j2k.cc
index 5317b2f7..ea28596d 100644
--- a/src/verify_j2k.cc
+++ b/src/verify_j2k.cc
@@ -136,21 +136,21 @@ dcp::verify_j2k (shared_ptr<const Data> j2k, vector<VerificationNote>& notes)
auto require_8 = [&](uint8_t value, string note) {
auto v = get_8 ();
if (v != value) {
- throw InvalidCodestream (String::compose(note, v));
+ throw InvalidCodestream (compose(note, v));
}
};
auto require_16 = [&](uint16_t value, string note) {
auto v = get_16 ();
if (v != value) {
- throw InvalidCodestream (String::compose(note, v));
+ throw InvalidCodestream (compose(note, v));
}
};
auto require_32 = [&](uint32_t value, string note) {
auto v = get_32 ();
if (v != value) {
- throw InvalidCodestream (String::compose(note, v));
+ throw InvalidCodestream (compose(note, v));
}
};
@@ -198,7 +198,7 @@ dcp::verify_j2k (shared_ptr<const Data> j2k, vector<VerificationNote>& notes)
if (!marker_name) {
char buffer[16];
snprintf (buffer, 16, "%2x", marker_id);
- throw InvalidCodestream(String::compose("unknown marker %1", buffer));
+ throw InvalidCodestream(compose("unknown marker %1", buffer));
} else if (*marker_name == "SOT") {
require_16(10, "invalid SOT size %1");
get_16(); // tile index
@@ -287,13 +287,13 @@ dcp::verify_j2k (shared_ptr<const Data> j2k, vector<VerificationNote>& notes)
auto require_8_poc = [&](uint16_t value, string note) {
if (get_8() != value) {
- notes.push_back ({ VerificationNote::Type::BV21_ERROR, VerificationNote::Code::INCORRECT_JPEG2000_POC_MARKER, String::compose(note, value) });
+ notes.push_back ({ VerificationNote::Type::BV21_ERROR, VerificationNote::Code::INCORRECT_JPEG2000_POC_MARKER, compose(note, value) });
}
};
auto require_16_poc = [&](uint16_t value, string note) {
if (get_16() != value) {
- notes.push_back ({ VerificationNote::Type::BV21_ERROR, VerificationNote::Code::INCORRECT_JPEG2000_POC_MARKER, String::compose(note, value) });
+ notes.push_back ({ VerificationNote::Type::BV21_ERROR, VerificationNote::Code::INCORRECT_JPEG2000_POC_MARKER, compose(note, value) });
}
};
diff --git a/test/combine_test.cc b/test/combine_test.cc
index 603cca62..33e28664 100644
--- a/test/combine_test.cc
+++ b/test/combine_test.cc
@@ -158,8 +158,8 @@ BOOST_AUTO_TEST_CASE (combine_single_dcp_test)
dcp::combine (
inputs,
out,
- dcp::String::compose("libdcp %1", dcp::version),
- dcp::String::compose("libdcp %1", dcp::version),
+ dcp::compose("libdcp %1", dcp::version),
+ dcp::compose("libdcp %1", dcp::version),
dcp::LocalTime().as_string(),
"A Test DCP"
);
diff --git a/test/compose_test.cc b/test/compose_test.cc
index 9dddb81b..b6347f78 100644
--- a/test/compose_test.cc
+++ b/test/compose_test.cc
@@ -38,11 +38,11 @@
BOOST_AUTO_TEST_CASE (compose_test)
{
- BOOST_REQUIRE_EQUAL (dcp::String::compose("foo %1", 42), "foo 42");
- BOOST_REQUIRE_EQUAL (dcp::String::compose("foo %1 %2", "", 42), "foo 42 ");
- BOOST_REQUIRE_EQUAL (dcp::String::compose("foo %1 %1", 42), "foo 42 42");
- BOOST_REQUIRE_EQUAL (dcp::String::compose("foo %1 %2", 42, 9.6), "foo 42 9.6");
- BOOST_REQUIRE_EQUAL (dcp::String::compose("something %1 foo %2 %3", "balls", 42, 9.6), "something balls foo 42 9.6");
- BOOST_REQUIRE_EQUAL (dcp::String::compose("something %1 foo %2 %3 and then %% %4", "balls", 42, 9.6, boost::filesystem::path("/foo")), "something balls foo 42 9.6 and then % /foo");
+ BOOST_REQUIRE_EQUAL (dcp::compose("foo %1", 42), "foo 42");
+ BOOST_REQUIRE_EQUAL (dcp::compose("foo %1 %2", "", 42), "foo 42 ");
+ BOOST_REQUIRE_EQUAL (dcp::compose("foo %1 %1", 42), "foo 42 42");
+ BOOST_REQUIRE_EQUAL (dcp::compose("foo %1 %2", 42, 9.6), "foo 42 9.6");
+ BOOST_REQUIRE_EQUAL (dcp::compose("something %1 foo %2 %3", "balls", 42, 9.6), "something balls foo 42 9.6");
+ BOOST_REQUIRE_EQUAL (dcp::compose("something %1 foo %2 %3 and then %% %4", "balls", 42, 9.6, boost::filesystem::path("/foo")), "something balls foo 42 9.6 and then % /foo");
}
diff --git a/test/mca_test.cc b/test/mca_test.cc
index 3888e2b7..1201eca3 100644
--- a/test/mca_test.cc
+++ b/test/mca_test.cc
@@ -60,10 +60,10 @@ using std::vector;
BOOST_AUTO_TEST_CASE (parse_mca_descriptors_from_mxf_test)
{
for (int i = 1; i < 3; ++i) {
- auto sound_asset = make_shared<dcp::SoundAsset>(private_test / "data" / dcp::String::compose("51_sound_with_mca_%1.mxf", i));
+ auto sound_asset = make_shared<dcp::SoundAsset>(private_test / "data" / dcp::compose("51_sound_with_mca_%1.mxf", i));
auto reel_sound_asset = make_shared<dcp::ReelSoundAsset>(sound_asset, 0);
auto reel = make_shared<dcp::Reel>();
- reel->add (black_picture_asset(dcp::String::compose("build/test/parse_mca_descriptors_from_mxf_test%1", i), 24));
+ reel->add (black_picture_asset(dcp::compose("build/test/parse_mca_descriptors_from_mxf_test%1", i), 24));
reel->add (reel_sound_asset);
dcp::CPL cpl("", dcp::ContentKind::FEATURE, dcp::Standard::SMPTE);
@@ -72,10 +72,10 @@ BOOST_AUTO_TEST_CASE (parse_mca_descriptors_from_mxf_test)
cpl.set_main_sound_sample_rate(48000);
cpl.set_main_picture_stored_area(dcp::Size(1998, 1080));
cpl.set_main_picture_active_area(dcp::Size(1998, 1080));
- cpl.write_xml (dcp::String::compose("build/test/parse_mca_descriptors_from_mxf_test%1/cpl.xml", i), shared_ptr<dcp::CertificateChain>());
+ cpl.write_xml (dcp::compose("build/test/parse_mca_descriptors_from_mxf_test%1/cpl.xml", i), shared_ptr<dcp::CertificateChain>());
- cxml::Document ref("CompositionPlaylist", private_test / dcp::String::compose("51_sound_with_mca_%1.cpl", i));
- cxml::Document check("CompositionPlaylist", dcp::String::compose("build/test/parse_mca_descriptors_from_mxf_test%1/cpl.xml", i));
+ cxml::Document ref("CompositionPlaylist", private_test / dcp::compose("51_sound_with_mca_%1.cpl", i));
+ cxml::Document check("CompositionPlaylist", dcp::compose("build/test/parse_mca_descriptors_from_mxf_test%1/cpl.xml", i));
vector<string> ignore;
check_xml (
diff --git a/test/test.cc b/test/test.cc
index e9561dbe..3ebc235d 100644
--- a/test/test.cc
+++ b/test/test.cc
@@ -233,7 +233,7 @@ check_file (boost::filesystem::path ref, boost::filesystem::path check)
if (ref_buffer[i] != check_buffer[i]) {
BOOST_CHECK_MESSAGE (
false,
- dcp::String::compose("File %1 differs from reference %2 at offset %3", check, ref, pos + i)
+ dcp::compose("File %1 differs from reference %2 at offset %3", check, ref, pos + i)
);
break;
}
@@ -275,7 +275,7 @@ simple_picture (boost::filesystem::path path, string suffix, int frames)
shared_ptr<dcp::MonoPictureAsset> mp (new dcp::MonoPictureAsset (dcp::Fraction (24, 1), dcp::Standard::SMPTE));
mp->set_metadata (mxf_meta);
- shared_ptr<dcp::PictureAssetWriter> picture_writer = mp->start_write (path / dcp::String::compose("video%1.mxf", suffix), false);
+ shared_ptr<dcp::PictureAssetWriter> picture_writer = mp->start_write (path / dcp::compose("video%1.mxf", suffix), false);
dcp::Size const size (1998, 1080);
auto image = make_shared<dcp::OpenJPEGImage>(size);
@@ -302,7 +302,7 @@ simple_sound (boost::filesystem::path path, string suffix, dcp::MXFMetadata mxf_
shared_ptr<dcp::SoundAsset> ms (new dcp::SoundAsset(dcp::Fraction(24, 1), sample_rate, channels, dcp::LanguageTag("en-US"), dcp::Standard::SMPTE));
ms->_language = language;
ms->set_metadata (mxf_meta);
- shared_ptr<dcp::SoundAssetWriter> sound_writer = ms->start_write (path / dcp::String::compose("audio%1.mxf", suffix));
+ shared_ptr<dcp::SoundAssetWriter> sound_writer = ms->start_write (path / dcp::compose("audio%1.mxf", suffix));
int const samples_per_frame = sample_rate / 24;
@@ -353,7 +353,7 @@ make_simple (boost::filesystem::path path, int reels, int frames, dcp::Standard
cpl->set_version_number(1);
for (int i = 0; i < reels; ++i) {
- string suffix = reels == 1 ? "" : dcp::String::compose("%1", i);
+ string suffix = reels == 1 ? "" : dcp::compose("%1", i);
shared_ptr<dcp::MonoPictureAsset> mp = simple_picture (path, suffix, frames);
shared_ptr<dcp::SoundAsset> ms = simple_sound (path, suffix, mxf_meta, "en-US", frames);
diff --git a/test/verify_test.cc b/test/verify_test.cc
index d8a259ac..4c2cb5d3 100644
--- a/test/verify_test.cc
+++ b/test/verify_test.cc
@@ -118,9 +118,9 @@ prepare_directory (path path)
static path
setup (int reference_number, string verify_test_suffix)
{
- auto const dir = dcp::String::compose("build/test/verify_test%1", verify_test_suffix);
+ auto const dir = dcp::compose("build/test/verify_test%1", verify_test_suffix);
prepare_directory (dir);
- for (auto i: directory_iterator(dcp::String::compose("test/ref/DCP/dcp_test%1", reference_number))) {
+ for (auto i: directory_iterator(dcp::compose("test/ref/DCP/dcp_test%1", reference_number))) {
copy_file (i.path(), dir / i.path().filename());
}
@@ -141,8 +141,8 @@ write_dcp_with_single_asset (path dir, shared_ptr<dcp::ReelAsset> reel_asset, dc
auto dcp = make_shared<dcp::DCP>(dir);
dcp->add (cpl);
dcp->write_xml (
- dcp::String::compose("libdcp %1", dcp::version),
- dcp::String::compose("libdcp %1", dcp::version),
+ dcp::compose("libdcp %1", dcp::version),
+ dcp::compose("libdcp %1", dcp::version),
dcp::LocalTime().as_string(),
"hello"
);
@@ -399,7 +399,7 @@ static
path
cpl (string suffix)
{
- return dcp::String::compose("build/test/verify_test%1/%2", suffix, dcp_test1_cpl);
+ return dcp::compose("build/test/verify_test%1/%2", suffix, dcp_test1_cpl);
}
@@ -407,7 +407,7 @@ static
path
pkl (string suffix)
{
- return dcp::String::compose("build/test/verify_test%1/%2", suffix, dcp_test1_pkl);
+ return dcp::compose("build/test/verify_test%1/%2", suffix, dcp_test1_pkl);
}
@@ -415,7 +415,7 @@ static
path
asset_map (string suffix)
{
- return dcp::String::compose("build/test/verify_test%1/ASSETMAP.xml", suffix);
+ return dcp::compose("build/test/verify_test%1/ASSETMAP.xml", suffix);
}
@@ -814,8 +814,8 @@ BOOST_AUTO_TEST_CASE (verify_valid_cpl_metadata)
dcp::DCP dcp (dir);
dcp.add (cpl);
dcp.write_xml (
- dcp::String::compose("libdcp %1", dcp::version),
- dcp::String::compose("libdcp %1", dcp::version),
+ dcp::compose("libdcp %1", dcp::version),
+ dcp::compose("libdcp %1", dcp::version),
dcp::LocalTime().as_string(),
"hello"
);
@@ -858,8 +858,8 @@ BOOST_AUTO_TEST_CASE (verify_invalid_cpl_metadata_bad_tag)
dcp::DCP dcp (dir);
dcp.add (cpl);
dcp.write_xml (
- dcp::String::compose("libdcp %1", dcp::version),
- dcp::String::compose("libdcp %1", dcp::version),
+ dcp::compose("libdcp %1", dcp::version),
+ dcp::compose("libdcp %1", dcp::version),
dcp::LocalTime().as_string(),
"hello"
);
@@ -909,8 +909,8 @@ BOOST_AUTO_TEST_CASE (verify_invalid_cpl_metadata_missing_tag)
dcp::DCP dcp (dir);
dcp.add (cpl);
dcp.write_xml (
- dcp::String::compose("libdcp %1", dcp::version),
- dcp::String::compose("libdcp %1", dcp::version),
+ dcp::compose("libdcp %1", dcp::version),
+ dcp::compose("libdcp %1", dcp::version),
dcp::LocalTime().as_string(),
"hello"
);
@@ -1002,8 +1002,8 @@ BOOST_AUTO_TEST_CASE (verify_invalid_language3)
auto dcp = make_shared<dcp::DCP>(dir);
dcp->add (cpl);
dcp->write_xml (
- dcp::String::compose("libdcp %1", dcp::version),
- dcp::String::compose("libdcp %1", dcp::version),
+ dcp::compose("libdcp %1", dcp::version),
+ dcp::compose("libdcp %1", dcp::version),
dcp::LocalTime().as_string(),
"hello"
);
@@ -1068,8 +1068,8 @@ check_picture_size (int width, int height, int frame_rate, bool three_d)
d->add (cpl);
d->write_xml (
- dcp::String::compose("libdcp %1", dcp::version),
- dcp::String::compose("libdcp %1", dcp::version),
+ dcp::compose("libdcp %1", dcp::version),
+ dcp::compose("libdcp %1", dcp::version),
dcp::LocalTime().as_string(),
"A Test DCP"
);
@@ -1237,7 +1237,7 @@ make_large_subtitle_asset (path font_file)
dcp::ArrayData big_fake_font(1024 * 1024);
big_fake_font.write (font_file);
for (int i = 0; i < 116; ++i) {
- asset->add_font (dcp::String::compose("big%1", i), big_fake_font);
+ asset->add_font (dcp::compose("big%1", i), big_fake_font);
}
return asset;
}
@@ -1313,8 +1313,8 @@ BOOST_AUTO_TEST_CASE (verify_missing_subtitle_language)
auto reel_subs = make_shared<dcp::ReelSMPTESubtitleAsset>(subs, dcp::Fraction(24, 1), 106, 0);
dcp->cpls()[0]->reels()[0]->add(reel_subs);
dcp->write_xml (
- dcp::String::compose("libdcp %1", dcp::version),
- dcp::String::compose("libdcp %1", dcp::version),
+ dcp::compose("libdcp %1", dcp::version),
+ dcp::compose("libdcp %1", dcp::version),
dcp::LocalTime().as_string(),
"A Test DCP"
);
@@ -1354,8 +1354,8 @@ BOOST_AUTO_TEST_CASE (verify_mismatched_subtitle_languages)
}
dcp->write_xml (
- dcp::String::compose("libdcp %1", dcp::version),
- dcp::String::compose("libdcp %1", dcp::version),
+ dcp::compose("libdcp %1", dcp::version),
+ dcp::compose("libdcp %1", dcp::version),
dcp::LocalTime().as_string(),
"A Test DCP"
);
@@ -1396,8 +1396,8 @@ BOOST_AUTO_TEST_CASE (verify_multiple_closed_caption_languages_allowed)
}
dcp->write_xml (
- dcp::String::compose("libdcp %1", dcp::version),
- dcp::String::compose("libdcp %1", dcp::version),
+ dcp::compose("libdcp %1", dcp::version),
+ dcp::compose("libdcp %1", dcp::version),
dcp::LocalTime().as_string(),
"A Test DCP"
);
@@ -1448,8 +1448,8 @@ BOOST_AUTO_TEST_CASE (verify_missing_subtitle_start_time)
auto reel_subs = make_shared<dcp::ReelSMPTESubtitleAsset>(subs, dcp::Fraction(24, 1), 106, 0);
dcp->cpls()[0]->reels()[0]->add(reel_subs);
dcp->write_xml (
- dcp::String::compose("libdcp %1", dcp::version),
- dcp::String::compose("libdcp %1", dcp::version),
+ dcp::compose("libdcp %1", dcp::version),
+ dcp::compose("libdcp %1", dcp::version),
dcp::LocalTime().as_string(),
"A Test DCP"
);
@@ -1501,8 +1501,8 @@ BOOST_AUTO_TEST_CASE (verify_invalid_subtitle_start_time)
auto reel_subs = make_shared<dcp::ReelSMPTESubtitleAsset>(subs, dcp::Fraction(24, 1), 106, 0);
dcp->cpls().front()->reels().front()->add(reel_subs);
dcp->write_xml (
- dcp::String::compose("libdcp %1", dcp::version),
- dcp::String::compose("libdcp %1", dcp::version),
+ dcp::compose("libdcp %1", dcp::version),
+ dcp::compose("libdcp %1", dcp::version),
dcp::LocalTime().as_string(),
"A Test DCP"
);
@@ -1612,8 +1612,8 @@ BOOST_AUTO_TEST_CASE (verify_valid_subtitle_first_text_time_on_second_reel)
auto dcp = make_shared<dcp::DCP>(dir);
dcp->add (cpl);
dcp->write_xml (
- dcp::String::compose("libdcp %1", dcp::version),
- dcp::String::compose("libdcp %1", dcp::version),
+ dcp::compose("libdcp %1", dcp::version),
+ dcp::compose("libdcp %1", dcp::version),
dcp::LocalTime().as_string(),
"hello"
);
@@ -1906,8 +1906,8 @@ BOOST_AUTO_TEST_CASE (verify_invalid_sound_frame_rate)
auto dcp = make_shared<dcp::DCP>(dir);
dcp->add (cpl);
dcp->write_xml (
- dcp::String::compose("libdcp %1", dcp::version),
- dcp::String::compose("libdcp %1", dcp::version),
+ dcp::compose("libdcp %1", dcp::version),
+ dcp::compose("libdcp %1", dcp::version),
dcp::LocalTime().as_string(),
"hello"
);
@@ -1926,8 +1926,8 @@ BOOST_AUTO_TEST_CASE (verify_missing_cpl_annotation_text)
path const dir("build/test/verify_missing_cpl_annotation_text");
auto dcp = make_simple (dir);
dcp->write_xml (
- dcp::String::compose("libdcp %1", dcp::version),
- dcp::String::compose("libdcp %1", dcp::version),
+ dcp::compose("libdcp %1", dcp::version),
+ dcp::compose("libdcp %1", dcp::version),
dcp::LocalTime().as_string(),
"A Test DCP"
);
@@ -1956,8 +1956,8 @@ BOOST_AUTO_TEST_CASE (verify_mismatched_cpl_annotation_text)
path const dir("build/test/verify_mismatched_cpl_annotation_text");
auto dcp = make_simple (dir);
dcp->write_xml (
- dcp::String::compose("libdcp %1", dcp::version),
- dcp::String::compose("libdcp %1", dcp::version),
+ dcp::compose("libdcp %1", dcp::version),
+ dcp::compose("libdcp %1", dcp::version),
dcp::LocalTime().as_string(),
"A Test DCP"
);
@@ -2000,8 +2000,8 @@ BOOST_AUTO_TEST_CASE (verify_mismatched_asset_duration)
dcp->add (cpl);
dcp->write_xml (
- dcp::String::compose("libdcp %1", dcp::version),
- dcp::String::compose("libdcp %1", dcp::version),
+ dcp::compose("libdcp %1", dcp::version),
+ dcp::compose("libdcp %1", dcp::version),
dcp::LocalTime().as_string(),
"A Test DCP"
);
@@ -2065,8 +2065,8 @@ verify_subtitles_must_be_in_all_reels_check (path dir, bool add_to_reel1, bool a
dcp->add (cpl);
dcp->write_xml (
- dcp::String::compose("libdcp %1", dcp::version),
- dcp::String::compose("libdcp %1", dcp::version),
+ dcp::compose("libdcp %1", dcp::version),
+ dcp::compose("libdcp %1", dcp::version),
dcp::LocalTime().as_string(),
"A Test DCP"
);
@@ -2151,8 +2151,8 @@ verify_closed_captions_must_be_in_all_reels_check (path dir, int caps_in_reel1,
dcp->add (cpl);
dcp->write_xml (
- dcp::String::compose("libdcp %1", dcp::version),
- dcp::String::compose("libdcp %1", dcp::version),
+ dcp::compose("libdcp %1", dcp::version),
+ dcp::compose("libdcp %1", dcp::version),
dcp::LocalTime().as_string(),
"A Test DCP"
);
@@ -2219,8 +2219,8 @@ verify_text_entry_point_check (path dir, dcp::VerificationNote::Code code, boost
dcp->add (cpl);
dcp->write_xml (
- dcp::String::compose("libdcp %1", dcp::version),
- dcp::String::compose("libdcp %1", dcp::version),
+ dcp::compose("libdcp %1", dcp::version),
+ dcp::compose("libdcp %1", dcp::version),
dcp::LocalTime().as_string(),
"A Test DCP"
);
@@ -2277,8 +2277,8 @@ BOOST_AUTO_TEST_CASE (verify_missing_hash)
path const dir("build/test/verify_missing_hash");
auto dcp = make_simple (dir);
dcp->write_xml (
- dcp::String::compose("libdcp %1", dcp::version),
- dcp::String::compose("libdcp %1", dcp::version),
+ dcp::compose("libdcp %1", dcp::version),
+ dcp::compose("libdcp %1", dcp::version),
dcp::LocalTime().as_string(),
"A Test DCP"
);
@@ -2320,8 +2320,8 @@ verify_markers_test (
}
dcp->cpls()[0]->reels()[0]->add(markers_asset);
dcp->write_xml (
- dcp::String::compose("libdcp %1", dcp::version),
- dcp::String::compose("libdcp %1", dcp::version),
+ dcp::compose("libdcp %1", dcp::version),
+ dcp::compose("libdcp %1", dcp::version),
dcp::LocalTime().as_string(),
"A Test DCP"
);
@@ -2421,8 +2421,8 @@ BOOST_AUTO_TEST_CASE (verify_missing_cpl_metadata_version_number)
auto cpl = dcp->cpls()[0];
cpl->unset_version_number();
dcp->write_xml (
- dcp::String::compose("libdcp %1", dcp::version),
- dcp::String::compose("libdcp %1", dcp::version),
+ dcp::compose("libdcp %1", dcp::version),
+ dcp::compose("libdcp %1", dcp::version),
dcp::LocalTime().as_string(),
"A Test DCP"
);
@@ -2436,8 +2436,8 @@ BOOST_AUTO_TEST_CASE (verify_missing_extension_metadata1)
path dir = "build/test/verify_missing_extension_metadata1";
auto dcp = make_simple (dir);
dcp->write_xml (
- dcp::String::compose("libdcp %1", dcp::version),
- dcp::String::compose("libdcp %1", dcp::version),
+ dcp::compose("libdcp %1", dcp::version),
+ dcp::compose("libdcp %1", dcp::version),
dcp::LocalTime().as_string(),
"A Test DCP"
);
@@ -2463,8 +2463,8 @@ BOOST_AUTO_TEST_CASE (verify_missing_extension_metadata2)
path dir = "build/test/verify_missing_extension_metadata2";
auto dcp = make_simple (dir);
dcp->write_xml (
- dcp::String::compose("libdcp %1", dcp::version),
- dcp::String::compose("libdcp %1", dcp::version),
+ dcp::compose("libdcp %1", dcp::version),
+ dcp::compose("libdcp %1", dcp::version),
dcp::LocalTime().as_string(),
"A Test DCP"
);
@@ -2490,8 +2490,8 @@ BOOST_AUTO_TEST_CASE (verify_invalid_xml_cpl_extension_metadata3)
path dir = "build/test/verify_invalid_xml_cpl_extension_metadata3";
auto dcp = make_simple (dir);
dcp->write_xml (
- dcp::String::compose("libdcp %1", dcp::version),
- dcp::String::compose("libdcp %1", dcp::version),
+ dcp::compose("libdcp %1", dcp::version),
+ dcp::compose("libdcp %1", dcp::version),
dcp::LocalTime().as_string(),
"A Test DCP"
);
@@ -2519,8 +2519,8 @@ BOOST_AUTO_TEST_CASE (verify_invalid_extension_metadata1)
path dir = "build/test/verify_invalid_extension_metadata1";
auto dcp = make_simple (dir);
dcp->write_xml (
- dcp::String::compose("libdcp %1", dcp::version),
- dcp::String::compose("libdcp %1", dcp::version),
+ dcp::compose("libdcp %1", dcp::version),
+ dcp::compose("libdcp %1", dcp::version),
dcp::LocalTime().as_string(),
"A Test DCP"
);
@@ -2546,8 +2546,8 @@ BOOST_AUTO_TEST_CASE (verify_invalid_extension_metadata2)
path dir = "build/test/verify_invalid_extension_metadata2";
auto dcp = make_simple (dir);
dcp->write_xml (
- dcp::String::compose("libdcp %1", dcp::version),
- dcp::String::compose("libdcp %1", dcp::version),
+ dcp::compose("libdcp %1", dcp::version),
+ dcp::compose("libdcp %1", dcp::version),
dcp::LocalTime().as_string(),
"A Test DCP"
);
@@ -2573,8 +2573,8 @@ BOOST_AUTO_TEST_CASE (verify_invalid_xml_cpl_extension_metadata6)
path dir = "build/test/verify_invalid_xml_cpl_extension_metadata6";
auto dcp = make_simple (dir);
dcp->write_xml (
- dcp::String::compose("libdcp %1", dcp::version),
- dcp::String::compose("libdcp %1", dcp::version),
+ dcp::compose("libdcp %1", dcp::version),
+ dcp::compose("libdcp %1", dcp::version),
dcp::LocalTime().as_string(),
"A Test DCP"
);
@@ -2602,8 +2602,8 @@ BOOST_AUTO_TEST_CASE (verify_invalid_xml_cpl_extension_metadata7)
path dir = "build/test/verify_invalid_xml_cpl_extension_metadata7";
auto dcp = make_simple (dir);
dcp->write_xml (
- dcp::String::compose("libdcp %1", dcp::version),
- dcp::String::compose("libdcp %1", dcp::version),
+ dcp::compose("libdcp %1", dcp::version),
+ dcp::compose("libdcp %1", dcp::version),
dcp::LocalTime().as_string(),
"A Test DCP"
);
@@ -2629,8 +2629,8 @@ BOOST_AUTO_TEST_CASE (verify_invalid_xml_cpl_extension_metadata8)
path dir = "build/test/verify_invalid_xml_cpl_extension_metadata8";
auto dcp = make_simple (dir);
dcp->write_xml (
- dcp::String::compose("libdcp %1", dcp::version),
- dcp::String::compose("libdcp %1", dcp::version),
+ dcp::compose("libdcp %1", dcp::version),
+ dcp::compose("libdcp %1", dcp::version),
dcp::LocalTime().as_string(),
"A Test DCP"
);
@@ -2658,8 +2658,8 @@ BOOST_AUTO_TEST_CASE (verify_invalid_xml_cpl_extension_metadata9)
path dir = "build/test/verify_invalid_xml_cpl_extension_metadata9";
auto dcp = make_simple (dir);
dcp->write_xml (
- dcp::String::compose("libdcp %1", dcp::version),
- dcp::String::compose("libdcp %1", dcp::version),
+ dcp::compose("libdcp %1", dcp::version),
+ dcp::compose("libdcp %1", dcp::version),
dcp::LocalTime().as_string(),
"A Test DCP"
);
@@ -2884,7 +2884,7 @@ BOOST_AUTO_TEST_CASE (verify_mismatched_subtitle_resource_id)
auto subs_mxf = dir / "subs.mxf";
auto r = writer.OpenWrite(subs_mxf.c_str(), writer_info, descriptor, 4096);
BOOST_REQUIRE (ASDCP_SUCCESS(r));
- writer.WriteTimedTextResource (dcp::String::compose(
+ writer.WriteTimedTextResource (dcp::compose(
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
"<SubtitleReel xmlns=\"http://www.smpte-ra.org/schemas/428-7/2010/DCST\" xmlns:xs=\"http://www.w3.org/2001/schema\">"
"<Id>urn:uuid:%1</Id>"
@@ -2948,7 +2948,7 @@ BOOST_AUTO_TEST_CASE (verify_incorrect_timed_text_id)
auto subs_mxf = dir / "subs.mxf";
auto r = writer.OpenWrite(subs_mxf.c_str(), writer_info, descriptor, 4096);
BOOST_REQUIRE (ASDCP_SUCCESS(r));
- writer.WriteTimedTextResource (dcp::String::compose(
+ writer.WriteTimedTextResource (dcp::compose(
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
"<SubtitleReel xmlns=\"http://www.smpte-ra.org/schemas/428-7/2010/DCST\" xmlns:xs=\"http://www.w3.org/2001/schema\">"
"<Id>urn:uuid:%1</Id>"
diff --git a/tools/dcpinfo.cc b/tools/dcpinfo.cc
index 23a3ef15..f1777850 100644
--- a/tools/dcpinfo.cc
+++ b/tools/dcpinfo.cc
@@ -100,16 +100,16 @@ mbits_per_second (int size, Fraction frame_rate)
return size * 8 * frame_rate.as_float() / 1e6;
}
-#define OUTPUT_DCP_PATH(...) maybe_output(only, "dcp-path", String::compose(__VA_ARGS__));
-#define OUTPUT_CPL_NAME_ID(...) maybe_output(only, "cpl-name-id", String::compose(__VA_ARGS__));
-#define OUTPUT_PICTURE(...) maybe_output(only, "picture", String::compose(__VA_ARGS__));
+#define OUTPUT_DCP_PATH(...) maybe_output(only, "dcp-path", compose(__VA_ARGS__));
+#define OUTPUT_CPL_NAME_ID(...) maybe_output(only, "cpl-name-id", compose(__VA_ARGS__));
+#define OUTPUT_PICTURE(...) maybe_output(only, "picture", compose(__VA_ARGS__));
#define OUTPUT_PICTURE_NC(x) maybe_output(only, "picture", (x));
#define SHOULD_PICTURE should_output(only, "picture")
-#define OUTPUT_SOUND(...) maybe_output(only, "sound", String::compose(__VA_ARGS__));
+#define OUTPUT_SOUND(...) maybe_output(only, "sound", compose(__VA_ARGS__));
#define OUTPUT_SOUND_NC(x) maybe_output(only, "sound", (x));
-#define OUTPUT_SUBTITLE(...) maybe_output(only, "subtitle", String::compose(__VA_ARGS__));
+#define OUTPUT_SUBTITLE(...) maybe_output(only, "subtitle", compose(__VA_ARGS__));
#define OUTPUT_SUBTITLE_NC(x) maybe_output(only, "subtitle", (x));
-#define OUTPUT_TOTAL_TIME(...) maybe_output(only, "total-time", String::compose(__VA_ARGS__));
+#define OUTPUT_TOTAL_TIME(...) maybe_output(only, "total-time", compose(__VA_ARGS__));
static bool
should_output(vector<string> const& only, string t)