#include <openssl/rsa.h>
#include <boost/filesystem.hpp>
#include <boost/algorithm/string.hpp>
-#include <boost/foreach.hpp>
#include <fstream>
#include <iostream>
CertificateChain::add_signature_value (xmlpp::Element* parent, string ns, bool add_indentation) const
{
cxml::Node cp (parent);
- xmlpp::Node* key_info = cp.node_child("KeyInfo")->node ();
+ auto key_info = cp.node_child("KeyInfo")->node();
/* Add the certificate chain to the KeyInfo child node of parent */
- BOOST_FOREACH (Certificate const & i, leaf_to_root ()) {
- xmlpp::Element* data = key_info->add_child("X509Data", ns);
+ for (auto const& i: leaf_to_root()) {
+ auto data = key_info->add_child("X509Data", ns);
{
- xmlpp::Element* serial = data->add_child("X509IssuerSerial", ns);
+ auto serial = data->add_child("X509IssuerSerial", ns);
serial->add_child("X509IssuerName", ns)->add_child_text (i.issuer ());
serial->add_child("X509SerialNumber", ns)->add_child_text (i.serial ());
}
data->add_child("X509Certificate", ns)->add_child_text (i.certificate());
}
- xmlSecDSigCtxPtr signature_context = xmlSecDSigCtxCreate (0);
+ auto signature_context = xmlSecDSigCtxCreate (0);
if (signature_context == 0) {
throw MiscError ("could not create signature context");
}
CertificateChain::chain () const
{
string o;
- BOOST_FOREACH (Certificate const &i, root_to_leaf ()) {
+ for (auto const& i: root_to_leaf()) {
o += i.certificate(true);
}
#include "interop_subtitle_asset.h"
#include "raw_convert.h"
#include <boost/filesystem.hpp>
-#include <boost/foreach.hpp>
#include <set>
#include <string>
#include <vector>
DCP output_dcp (output);
optional<dcp::Standard> standard;
- BOOST_FOREACH (path i, inputs) {
+ for (auto i: inputs) {
DCP dcp (i);
dcp.read ();
if (!standard) {
vector<path> paths;
vector<shared_ptr<dcp::Asset>> assets;
- BOOST_FOREACH (path i, inputs) {
+ for (auto i: inputs) {
DCP dcp (i);
dcp.read ();
- BOOST_FOREACH (shared_ptr<dcp::CPL> j, dcp.cpls()) {
+ for (auto j: dcp.cpls()) {
output_dcp.add (j);
}
- BOOST_FOREACH (shared_ptr<dcp::Asset> j, dcp.assets(true)) {
+ for (auto j: dcp.assets(true)) {
if (dynamic_pointer_cast<dcp::CPL>(j)) {
continue;
}
#include <openssl/rsa.h>
#include <openssl/pem.h>
#include <openssl/err.h>
-#include <boost/foreach.hpp>
using std::list;
using std::vector;
/* Use the private key to decrypt the keys */
- BOOST_FOREACH (string const & i, kdm.keys ()) {
+ for (auto const& i: kdm.keys()) {
/* Decode the base-64-encoded cipher value from the KDM */
unsigned char cipher_value[256];
int const cipher_value_len = base64_decode (i, cipher_value, sizeof (cipher_value));
{
DCP_ASSERT (!_keys.empty ());
- BOOST_FOREACH (dcp::Certificate i, signer->leaf_to_root()) {
+ for (auto i: signer->leaf_to_root()) {
if (day_greater_than_or_equal(dcp::LocalTime(i.not_before()), _not_valid_before)) {
throw BadKDMDateError (true);
} else if (day_less_than_or_equal(dcp::LocalTime(i.not_after()), _not_valid_after)) {
vector<pair<string, string>> key_ids;
vector<string> keys;
- BOOST_FOREACH (DecryptedKDMKey const & i, _keys) {
+ for (auto const& i: _keys) {
/* We're making SMPTE keys so we must have a type for each one */
DCP_ASSERT (i.type());
key_ids.push_back (make_pair (i.type().get(), i.id ()));
/*
- Copyright (C) 2012-2018 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2012-2021 Carl Hetherington <cth@carlh.net>
This file is part of libdcp.
#include "compose.hpp"
#include "subtitle_image.h"
#include <libxml++/libxml++.h>
-#include <boost/foreach.hpp>
#include <boost/weak_ptr.hpp>
#include <cmath>
#include <cstdio>
using std::shared_ptr;
using std::dynamic_pointer_cast;
using std::vector;
+using std::make_shared;
using boost::shared_array;
using boost::optional;
using namespace dcp;
}
}
- BOOST_FOREACH (shared_ptr<Subtitle> i, _subtitles) {
- shared_ptr<SubtitleImage> si = dynamic_pointer_cast<SubtitleImage>(i);
+ 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()));
}
_file = p;
/* Image subtitles */
- BOOST_FOREACH (shared_ptr<dcp::Subtitle> i, _subtitles) {
- shared_ptr<dcp::SubtitleImage> im = dynamic_pointer_cast<dcp::SubtitleImage> (i);
+ 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()));
}
}
/* Fonts */
- BOOST_FOREACH (shared_ptr<InteropLoadFontNode> i, _load_font_nodes) {
- boost::filesystem::path file = p.parent_path() / i->uri;
+ for (auto i: _load_font_nodes) {
+ auto file = p.parent_path() / i->uri;
auto j = _fonts.begin();
while (j != _fonts.end() && j->load_id != i->id) {
++j;
void
InteropSubtitleAsset::resolve_fonts (vector<shared_ptr<Asset>> assets)
{
- BOOST_FOREACH (shared_ptr<Asset> i, assets) {
- shared_ptr<FontAsset> font = dynamic_pointer_cast<FontAsset> (i);
+ for (auto i: assets) {
+ auto font = dynamic_pointer_cast<FontAsset> (i);
if (!font) {
continue;
}
- BOOST_FOREACH (shared_ptr<InteropLoadFontNode> j, _load_font_nodes) {
+ for (auto j: _load_font_nodes) {
bool got = false;
- BOOST_FOREACH (Font const & k, _fonts) {
+ for (auto const& k: _fonts) {
if (k.load_id == j->id) {
got = true;
break;
void
InteropSubtitleAsset::add_font_assets (vector<shared_ptr<Asset>>& assets)
{
- BOOST_FOREACH (Font const & i, _fonts) {
+ for (auto const& i: _fonts) {
DCP_ASSERT (i.file);
- assets.push_back (shared_ptr<FontAsset> (new FontAsset (i.uuid, i.file.get ())));
+ assets.push_back (make_shared<FontAsset>(i.uuid, i.file.get()));
}
}
{
Asset::write_to_assetmap (node, root);
- BOOST_FOREACH (shared_ptr<dcp::Subtitle> i, _subtitles) {
- shared_ptr<dcp::SubtitleImage> im = dynamic_pointer_cast<dcp::SubtitleImage> (i);
+ for (auto i: _subtitles) {
+ auto im = dynamic_pointer_cast<dcp::SubtitleImage> (i);
if (im) {
DCP_ASSERT (im->file());
write_file_to_assetmap (node, root, im->file().get(), im->id());
{
Asset::add_to_pkl (pkl, root);
- BOOST_FOREACH (shared_ptr<dcp::Subtitle> i, _subtitles) {
- shared_ptr<dcp::SubtitleImage> im = dynamic_pointer_cast<dcp::SubtitleImage> (i);
+ for (auto i: _subtitles) {
+ auto im = dynamic_pointer_cast<dcp::SubtitleImage> (i);
if (im) {
- ArrayData png_image = im->png_image ();
+ auto png_image = im->png_image ();
pkl->add_asset (im->id(), optional<string>(), make_digest(png_image), png_image.size(), "image/png");
}
}
void
InteropSubtitleAsset::set_font_file (string load_id, boost::filesystem::path file)
{
- BOOST_FOREACH (Font& i, _fonts) {
+ for (auto& i: _fonts) {
if (i.load_id == load_id) {
i.file = file;
}
}
- BOOST_FOREACH (shared_ptr<InteropLoadFontNode> i, _load_font_nodes) {
+ for (auto i: _load_font_nodes) {
if (i->id == load_id) {
i->uri = file.filename().string();
}
#include "exceptions.h"
#include "language_tag.h"
#include <boost/algorithm/string.hpp>
-#include <boost/foreach.hpp>
#include <string>
optional<LanguageTag::SubtagData>
find_in_list (vector<LanguageTag::SubtagData> const& list, string subtag)
{
- BOOST_FOREACH (LanguageTag::SubtagData const& i, list) {
+ for (auto const& i: list) {
if (boost::iequals(i.subtag, subtag)) {
return i;
}
s += "-" + _region->subtag();
}
- BOOST_FOREACH (VariantSubtag i, _variants) {
+ for (auto i: _variants) {
s += "-" + i.subtag();
}
- BOOST_FOREACH (ExtlangSubtag i, _extlangs) {
+ for (auto i: _extlangs) {
s += "-" + i.subtag();
}
string d;
- BOOST_FOREACH (VariantSubtag const& i, _variants) {
+ for (auto const& i: _variants) {
optional<SubtagData> variant = get_subtag_data (SubtagType::VARIANT, i.subtag());
DCP_ASSERT (variant);
d += variant->description + " dialect of ";
}
- optional<SubtagData> language = get_subtag_data (SubtagType::LANGUAGE, _language->subtag());
+ auto language = get_subtag_data (SubtagType::LANGUAGE, _language->subtag());
DCP_ASSERT (language);
d += language->description;
d += " for " + region->description;
}
- BOOST_FOREACH (ExtlangSubtag const& i, _extlangs) {
+ for (auto const& i: _extlangs) {
optional<SubtagData> extlang = get_subtag_data (SubtagType::EXTLANG, i.subtag());
DCP_ASSERT (extlang);
d += ", " + extlang->description;
vector<pair<LanguageTag::SubtagType, LanguageTag::SubtagData> >
LanguageTag::subtags () const
{
- vector<pair<SubtagType, SubtagData> > s;
+ vector<pair<SubtagType, SubtagData>> s;
if (_language) {
s.push_back (make_pair(SubtagType::LANGUAGE, *get_subtag_data(SubtagType::LANGUAGE, _language->subtag())));
s.push_back (make_pair(SubtagType::REGION, *get_subtag_data(SubtagType::REGION, _region->subtag())));
}
- BOOST_FOREACH (VariantSubtag const& i, _variants) {
+ for (auto const& i: _variants) {
s.push_back (make_pair(SubtagType::VARIANT, *get_subtag_data(SubtagType::VARIANT, i.subtag())));
}
- BOOST_FOREACH (ExtlangSubtag const& i, _extlangs) {
+ for (auto const& i: _extlangs) {
s.push_back (make_pair(SubtagType::EXTLANG, *get_subtag_data(SubtagType::EXTLANG, i.subtag())));
}
/*
- Copyright (C) 2012-2016 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2012-2021 Carl Hetherington <cth@carlh.net>
This file is part of libdcp.
using std::pair;
using std::shared_ptr;
using std::dynamic_pointer_cast;
+using std::make_shared;
#if BOOST_VERSION >= 106100
using namespace boost::placeholders;
#endif
: PictureAsset (file)
{
ASDCP::JP2K::MXFReader reader;
- Kumu::Result_t r = reader.OpenRead (file.string().c_str());
- if (ASDCP_FAILURE (r)) {
- boost::throw_exception (MXFFileError ("could not open MXF file for reading", file.string(), r));
+ auto r = reader.OpenRead (file.string().c_str());
+ if (ASDCP_FAILURE(r)) {
+ boost::throw_exception (MXFFileError("could not open MXF file for reading", file.string(), r));
}
ASDCP::JP2K::PictureDescriptor desc;
- if (ASDCP_FAILURE (reader.FillPictureDescriptor (desc))) {
- boost::throw_exception (ReadError ("could not read video MXF information"));
+ if (ASDCP_FAILURE (reader.FillPictureDescriptor(desc))) {
+ boost::throw_exception (ReadError("could not read video MXF information"));
}
read_picture_descriptor (desc);
ASDCP::WriterInfo info;
if (ASDCP_FAILURE (reader.FillWriterInfo (info))) {
- boost::throw_exception (ReadError ("could not read video MXF information"));
+ boost::throw_exception (ReadError("could not read video MXF information"));
}
_id = read_writer_info (info);
bool
MonoPictureAsset::equals (shared_ptr<const Asset> other, EqualityOptions opt, NoteHandler note) const
{
- if (!dynamic_pointer_cast<const MonoPictureAsset> (other)) {
+ if (!dynamic_pointer_cast<const MonoPictureAsset>(other)) {
return false;
}
ASDCP::JP2K::MXFReader reader_A;
DCP_ASSERT (_file);
- Kumu::Result_t r = reader_A.OpenRead (_file->string().c_str());
- if (ASDCP_FAILURE (r)) {
- boost::throw_exception (MXFFileError ("could not open MXF file for reading", _file->string(), r));
+ auto r = reader_A.OpenRead (_file->string().c_str());
+ if (ASDCP_FAILURE(r)) {
+ boost::throw_exception (MXFFileError("could not open MXF file for reading", _file->string(), r));
}
ASDCP::JP2K::MXFReader reader_B;
return false;
}
- shared_ptr<const MonoPictureAsset> other_picture = dynamic_pointer_cast<const MonoPictureAsset> (other);
+ auto other_picture = dynamic_pointer_cast<const MonoPictureAsset> (other);
DCP_ASSERT (other_picture);
bool result = true;
- shared_ptr<MonoPictureAssetReader> reader = start_read ();
- shared_ptr<MonoPictureAssetReader> other_reader = other_picture->start_read ();
+ auto reader = start_read ();
+ auto other_reader = other_picture->start_read ();
#ifdef LIBDCP_OPENMP
#pragma omp parallel for
if (result || opt.keep_going) {
- shared_ptr<const MonoPictureFrame> frame_A = reader->get_frame (i);
- shared_ptr<const MonoPictureFrame> frame_B = other_reader->get_frame (i);
+ auto frame_A = reader->get_frame (i);
+ auto frame_B = other_reader->get_frame (i);
list<pair<NoteType, string> > notes;
#endif
{
note (NoteType::PROGRESS, String::compose("Compared video frame %1 of %2", i, _intrinsic_duration));
- for (list<pair<NoteType, string> >::const_iterator i = notes.begin(); i != notes.end(); ++i) {
- note (i->first, i->second);
+ for (auto const& i: notes) {
+ note (i.first, i.second);
}
}
}
shared_ptr<PictureAssetWriter>
MonoPictureAsset::start_write (boost::filesystem::path file, bool overwrite)
{
- /* XXX: can't we use shared_ptr here? */
- return shared_ptr<MonoPictureAssetWriter> (new MonoPictureAssetWriter (this, file, overwrite));
+ return make_shared<MonoPictureAssetWriter>(this, file, overwrite);
}
shared_ptr<MonoPictureAssetReader>
MonoPictureAsset::start_read () const
{
- return shared_ptr<MonoPictureAssetReader> (new MonoPictureAssetReader (this, key(), standard()));
+ return make_shared<MonoPictureAssetReader>(this, key(), standard());
}
string
class MonoPictureAssetWriter : public PictureAssetWriter
{
public:
+ MonoPictureAssetWriter (PictureAsset *, boost::filesystem::path file, bool);
+
FrameInfo write (uint8_t const *, int);
void fake_write (int size);
bool finalize ();
private:
friend class MonoPictureAsset;
- MonoPictureAssetWriter (PictureAsset *, boost::filesystem::path file, bool);
void start (uint8_t const *, int);
/* do this with an opaque pointer so we don't have to include
ASDCP headers
*/
-
struct ASDCPState;
std::shared_ptr<ASDCPState> _state;
};
#include "name_format.h"
#include <boost/optional.hpp>
-#include <boost/foreach.hpp>
using std::string;
using std::map;
#include "raw_convert.h"
#include "dcp_assert.h"
#include <libxml++/libxml++.h>
-#include <boost/foreach.hpp>
#include <iostream>
using std::string;
#include "reel_atmos_asset.h"
#include "reel_closed_caption_asset.h"
#include <libxml++/nodes/element.h>
-#include <boost/foreach.hpp>
#include <stdint.h>
/* Centos 6 does not have this */
/*
- Copyright (C) 2019 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2019-2021 Carl Hetherington <cth@carlh.net>
This file is part of libdcp.
#include "raw_convert.h"
#include "dcp_assert.h"
#include <libxml++/libxml++.h>
-#include <boost/foreach.hpp>
using std::string;
using std::map;
ReelMarkersAsset::ReelMarkersAsset (cxml::ConstNodePtr node)
: ReelAsset (node)
{
- cxml::ConstNodePtr list = node->node_child ("MarkerList");
+ auto list = node->node_child ("MarkerList");
DCP_ASSERT (list);
- BOOST_FOREACH (cxml::ConstNodePtr i, list->node_children("Marker")) {
+ for (auto i: list->node_children("Marker")) {
set (marker_from_string(i->string_child("Label")), dcp::Time(i->number_child<int64_t>("Offset"), edit_rate().as_float(), edit_rate().numerator));
}
}
#include <asdcp/KM_util.h>
#include <asdcp/KM_log.h>
#include <libxml++/libxml++.h>
-#include <boost/foreach.hpp>
#include <boost/algorithm/string.hpp>
using std::string;
/* Try to read PNG files from the same folder that the XML is in; the wisdom of this is
debatable, at best...
*/
- BOOST_FOREACH (shared_ptr<Subtitle> i, _subtitles) {
- shared_ptr<SubtitleImage> im = dynamic_pointer_cast<SubtitleImage>(i);
+ for (auto i: _subtitles) {
+ 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 */
- boost::filesystem::path p = file.parent_path() / String::compose("%1.png", im->id());
+ auto p = file.parent_path() / String::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:")) {
}
/* Check that all required image data have been found */
- BOOST_FOREACH (shared_ptr<Subtitle> i, _subtitles) {
- shared_ptr<SubtitleImage> im = dynamic_pointer_cast<SubtitleImage>(i);
+ for (auto i: _subtitles) {
+ auto im = dynamic_pointer_cast<SubtitleImage>(i);
if (im && im->png_image().size() == 0) {
throw MissingSubtitleImageError (im->id());
}
_language = xml->optional_string_child ("Language");
/* This is supposed to be two numbers, but a single number has been seen in the wild */
- string const er = xml->string_child ("EditRate");
+ auto const er = xml->string_child ("EditRate");
vector<string> er_parts;
split (er_parts, er, is_any_of (" "));
if (er_parts.size() == 1) {
/* Now we need to drop down to xmlpp */
vector<ParseState> ps;
- xmlpp::Node::NodeList c = xml->node()->get_children ();
- for (xmlpp::Node::NodeList::const_iterator i = c.begin(); i != c.end(); ++i) {
- xmlpp::Element const * e = dynamic_cast<xmlpp::Element const *> (*i);
+ for (auto i: xml->node()->get_children()) {
+ auto const e = dynamic_cast<xmlpp::Element const *>(i);
if (e && e->get_name() == "SubtitleList") {
parse_subtitles (e, ps, _time_code_rate, Standard::SMPTE);
}
/* Load fonts and images */
for (
- ASDCP::TimedText::ResourceList_t::const_iterator i = descriptor.ResourceList.begin();
+ auto i = descriptor.ResourceList.begin();
i != descriptor.ResourceList.end();
++i) {
/* Our data was encrypted; now we can decrypt it */
- shared_ptr<ASDCP::TimedText::MXFReader> reader (new ASDCP::TimedText::MXFReader ());
- Kumu::Result_t r = reader->OpenRead (_file->string().c_str ());
+ auto reader = make_shared<ASDCP::TimedText::MXFReader>();
+ auto r = reader->OpenRead (_file->string().c_str ());
if (ASDCP_FAILURE (r)) {
boost::throw_exception (
ReadError (
root->add_child("StartTime", "dcst")->add_child_text(_start_time.get().as_string(Standard::SMPTE));
}
- BOOST_FOREACH (shared_ptr<SMPTELoadFontNode> i, _load_font_nodes) {
- xmlpp::Element* load_font = root->add_child("LoadFont", "dcst");
+ for (auto i: _load_font_nodes) {
+ auto load_font = root->add_child("LoadFont", "dcst");
load_font->add_child_text ("urn:uuid:" + i->urn);
load_font->set_attribute ("ID", i->id);
}
/* Font references */
- BOOST_FOREACH (shared_ptr<dcp::SMPTELoadFontNode> i, _load_font_nodes) {
+ for (auto i: _load_font_nodes) {
auto j = _fonts.begin();
while (j != _fonts.end() && j->load_id != i->id) {
++j;
/* Image subtitle references */
- BOOST_FOREACH (shared_ptr<Subtitle> i, _subtitles) {
- shared_ptr<SubtitleImage> si = dynamic_pointer_cast<SubtitleImage>(i);
+ for (auto i: _subtitles) {
+ auto si = dynamic_pointer_cast<SubtitleImage>(i);
if (si) {
ASDCP::TimedText::TimedTextResourceDescriptor res;
unsigned int c;
/* Font payload */
- BOOST_FOREACH (shared_ptr<dcp::SMPTELoadFontNode> i, _load_font_nodes) {
+ for (auto i: _load_font_nodes) {
auto j = _fonts.begin();
while (j != _fonts.end() && j->load_id != i->id) {
++j;
/* Image subtitle payload */
- BOOST_FOREACH (shared_ptr<Subtitle> i, _subtitles) {
- shared_ptr<SubtitleImage> si = dynamic_pointer_cast<SubtitleImage>(i);
+ for (auto i: _subtitles) {
+ auto si = dynamic_pointer_cast<SubtitleImage>(i);
if (si) {
ASDCP::TimedText::FrameBuffer buffer;
buffer.SetData (si->png_image().data(), si->png_image().size());
/*
- Copyright (C) 2012-2020 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2012-2021 Carl Hetherington <cth@carlh.net>
This file is part of libdcp.
#include "crypto_context.h"
#include <asdcp/AS_DCP.h>
#include <asdcp/Metadata.h>
-#include <boost/foreach.hpp>
#include <iostream>
using std::min;
_state->mxf_writer.OP1aHeader().AddChildObject(soundfield);
essence_descriptor->SubDescriptors.push_back(soundfield->InstanceUID);
- BOOST_FOREACH (Channel i, _active_channels) {
+ for (auto i: _active_channels) {
ASDCP::MXF::AudioChannelLabelSubDescriptor* channel = new ASDCP::MXF::AudioChannelLabelSubDescriptor(asdcp_smpte_dict);
GenRandomValue (channel->MCALinkID);
channel->SoundfieldGroupLinkID = soundfield->MCALinkID;
#include <boost/algorithm/string.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/shared_array.hpp>
-#include <boost/foreach.hpp>
using std::dynamic_pointer_cast;
using std::string;
}
ParseState ps;
- BOOST_FOREACH (ParseState const & i, parse_state) {
+ for (auto const& i: parse_state) {
if (i.font_id) {
ps.font_id = i.font_id.get();
}
these features go into part's font.
*/
part->font = part->children.front()->font;
- BOOST_FOREACH (shared_ptr<order::Part> i, part->children) {
+ for (auto i: part->children) {
part->font.take_intersection (i->font);
}
/* Remove common values from part's children's fonts */
- BOOST_FOREACH (shared_ptr<order::Part> i, part->children) {
+ for (auto i: part->children) {
i->font.take_difference (part->font);
}
}
SubtitleAsset::font_data () const
{
map<string, ArrayData> out;
- BOOST_FOREACH (Font const & i, _fonts) {
+ for (auto const& i: _fonts) {
out[i.load_id] = i.data;
}
return out;
SubtitleAsset::font_filenames () const
{
map<string, boost::filesystem::path> out;
- BOOST_FOREACH (Font const& i, _fonts) {
+ for (auto const& i: _fonts) {
if (i.file) {
out[i.load_id] = *i.file;
}
{
bool have_empty = false;
vector<string> ids;
- BOOST_FOREACH (shared_ptr<LoadFontNode> i, load_font_nodes()) {
+ for (auto i: load_font_nodes()) {
if (i->id == "") {
have_empty = true;
} else {
string const empty_id = unique_string (ids, "font");
- BOOST_FOREACH (shared_ptr<LoadFontNode> i, load_font_nodes()) {
+ for (auto i: load_font_nodes()) {
if (i->id == "") {
i->id = empty_id;
}
}
- BOOST_FOREACH (shared_ptr<Subtitle> i, _subtitles) {
- shared_ptr<SubtitleString> j = dynamic_pointer_cast<SubtitleString> (i);
+ for (auto i: _subtitles) {
+ auto j = dynamic_pointer_cast<SubtitleString> (i);
if (j && j->font() && j->font().get() == "") {
j->set_font (empty_id);
}
parent = as_xml (parent, context);
- BOOST_FOREACH (std::shared_ptr<order::Part> i, children) {
+ for (auto i: children) {
i->write_xml (parent, context);
}
}
#include "types.h"
#include "dcp_time.h"
#include <libxml++/libxml++.h>
-#include <boost/foreach.hpp>
struct take_intersection_test;
struct take_difference_test;
#include "dcp_assert.h"
#include <libxml++/libxml++.h>
#include <boost/algorithm/string.hpp>
-#include <boost/foreach.hpp>
#include <string>
#include <vector>
#include <cmath>
throw MainSoundConfigurationError (s);
}
- BOOST_FOREACH (string i, channels) {
+ for (auto i: channels) {
if (i == "-") {
_channels.push_back(optional<Channel>());
} else {
#include <openssl/sha.h>
#include <boost/filesystem.hpp>
#include <boost/algorithm/string.hpp>
-#include <boost/foreach.hpp>
#include <stdexcept>
#include <iostream>
#include <iomanip>
dcp::indent (xmlpp::Element* element, int initial)
{
xmlpp::Node* last = 0;
- BOOST_FOREACH (xmlpp::Node * n, element->get_children()) {
- xmlpp::Element* e = dynamic_cast<xmlpp::Element*>(n);
+ for (auto n: element->get_children()) {
+ auto e = dynamic_cast<xmlpp::Element*>(n);
if (e) {
element->add_child_text_before (e, "\n" + spaces(initial + 2));
indent (e, initial + 2);
/*
- Copyright (C) 2020 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2020-2021 Carl Hetherington <cth@carlh.net>
This file is part of libdcp.
#include "verify.h"
#include "reel_markers_asset.h"
#include <boost/algorithm/string.hpp>
-#include <boost/foreach.hpp>
#include <boost/optional.hpp>
#include <boost/test/unit_test.hpp>
#include <iostream>
void
dump_notes (vector<dcp::VerificationNote> const & notes)
{
- BOOST_FOREACH (dcp::VerificationNote i, notes) {
+ for (auto i: notes) {
std::cout << dcp::note_to_string(i) << "\n";
}
}
shared_ptr<T>
pointer_to_id_in_vector (shared_ptr<T> needle, vector<shared_ptr<T> > haystack)
{
- BOOST_FOREACH (shared_ptr<T> i, haystack) {
+ for (auto i: haystack) {
if (i->id() == needle->id()) {
return i;
}
#include "raw_convert.h"
#include "stream_operators.h"
#include <boost/test/unit_test.hpp>
-#include <boost/foreach.hpp>
#include <boost/algorithm/string.hpp>
#include <cstdio>
#include <iostream>
vector<dcp::VerificationNote> notes;
dcp->read (¬es);
filter_notes (notes, ignore_missing_assets);
- BOOST_FOREACH (dcp::VerificationNote i, notes) {
+ for (auto i: notes) {
cerr << dcp::note_to_string(i) << "\n";
}
if (key) {
auto assets = dcp->assets ();
for (auto i: assets) {
- shared_ptr<MXF> mxf = dynamic_pointer_cast<MXF>(i);
+ auto mxf = dynamic_pointer_cast<MXF>(i);
if (mxf) {
mxf->set_key (Key (key.get ()));
}
dcp::EncryptedKDM encrypted_kdm (dcp::file_to_string (kdm_file.get ()));
dcp::DecryptedKDM decrypted_kdm (encrypted_kdm, dcp::file_to_string (private_key_file.get()));
bool done = false;
- BOOST_FOREACH (dcp::DecryptedKDMKey const & i, decrypted_kdm.keys()) {
+ for (auto const& i: decrypted_kdm.keys()) {
if (i.id() == *sub.key_id()) {
sub.set_key (i.key ());
done = true;
/*
- Copyright (C) 2012-2020 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2012-2021 Carl Hetherington <cth@carlh.net>
This file is part of libdcp.
#include "compose.hpp"
#include <getopt.h>
#include <boost/filesystem.hpp>
-#include <boost/foreach.hpp>
#include <boost/algorithm/string.hpp>
#include <iostream>
#include <cstdlib>
OUTPUT_DCP_PATH("DCP: %1\n", boost::filesystem::path(argv[optind]).string());
dcp::filter_notes (notes, ignore_missing_assets);
- BOOST_FOREACH (dcp::VerificationNote i, notes) {
+ for (auto i: notes) {
cerr << "Error: " << note_to_string(i) << "\n";
}
dcp::Time total_time;
- BOOST_FOREACH (shared_ptr<CPL> i, cpls) {
+ for (auto i: cpls) {
OUTPUT_CPL_NAME_ID(" CPL: %1 %2\n", i->annotation_text().get_value_or(""), i->id());
int R = 1;
- BOOST_FOREACH (shared_ptr<Reel> j, i->reels()) {
+ for (auto j: i->reels()) {
if (should_output(only, "picture") || should_output(only, "sound") || should_output(only, "subtitle")) {
cout << " Reel " << R << "\n";
}
cout << "Signer chain:\n";
dcp::CertificateChain signer = enc_kdm.signer_certificate_chain ();
- BOOST_FOREACH (dcp::Certificate const & i, signer.root_to_leaf()) {
+ for (auto const& i: signer.root_to_leaf()) {
cout << "\tCertificate:\n";
cout << "\t\tSubject: " << i.subject() << "\n";
cout << "\t\tSubject common name: " << i.subject_common_name() << "\n";
try {
dcp::DecryptedKDM dec_kdm (enc_kdm, dcp::file_to_string (private_key_file.get()));
cout << "\nKeys:";
- BOOST_FOREACH (dcp::DecryptedKDMKey i, dec_kdm.keys ()) {
+ for (auto i: dec_kdm.keys()) {
cout << "\n";
cout << "\tID: " << i.id() << "\n";
cout << "\tStandard: " << (i.standard() == dcp::Standard::SMPTE ? "SMPTE" : "Interop") << "\n";
/*
- Copyright (C) 2018 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2018-2021 Carl Hetherington <cth@carlh.net>
This file is part of libdcp.
#include <getopt.h>
#include <libxml++/libxml++.h>
#include <boost/filesystem.hpp>
-#include <boost/foreach.hpp>
#include <iostream>
using std::cerr;
cout << "Error:" << e.what() << "\n";
}
- BOOST_FOREACH (dcp::VerificationNote i, notes) {
+ for (auto i: notes) {
cout << "Error: " << dcp::note_to_string(i) << "\n";
}
dcp::filter_notes (notes, ignore_missing_assets);
bool failed = false;
- BOOST_FOREACH (dcp::VerificationNote i, notes) {
+ for (auto i: notes) {
if (ignore_bv21_smpte && i.code() == dcp::VerificationNote::Code::INVALID_STANDARD) {
continue;
}