def dependencies(target):
if target.platform == 'windows' and target.version == 'xp':
- return (('libcxml', 'v0.15.1'), ('openjpeg-cdist', '5d8bffd'), ('asdcplib-cth', 'v0.1.2'))
+ return (('libcxml', 'b08e6b4'), ('openjpeg-cdist', '5d8bffd'), ('asdcplib-cth', 'v0.1.2'))
else:
- return (('libcxml', 'v0.15.1'), ('openjpeg2-cdist', '94bdab1'), ('asdcplib-cth', 'v0.1.2'))
+ return (('libcxml', 'b08e6b4'), ('openjpeg2-cdist', '94bdab1'), ('asdcplib-cth', 'v0.1.2'))
def build(target, options):
cmd = './waf configure --disable-examples --prefix=%s' % target.directory
using std::string;
using std::ostream;
using std::min;
-using std::stringstream;
using namespace dcp;
static string const begin_certificate = "-----BEGIN CERTIFICATE-----";
See http://comments.gmane.org/gmane.comp.encryption.openssl.user/55593
*/
- stringstream s (cert);
+ locked_stringstream s (cert);
string line;
/* BEGIN */
#include <boost/algorithm/string.hpp>
#include <boost/foreach.hpp>
#include <fstream>
-#include <sstream>
using std::string;
using std::ofstream;
using std::ifstream;
using std::runtime_error;
-using std::stringstream;
using namespace dcp;
/** Run a shell command.
int const code = WEXITSTATUS (r);
#endif
if (code) {
- stringstream s;
+ locked_stringstream s;
s << "error " << code << " in " << cmd << " within " << boost::filesystem::current_path();
throw dcp::MiscError (s.str());
}
boost::filesystem::path public_name = private_key.string() + ".public";
/* Create the public key from the private key */
- stringstream s;
+ locked_stringstream s;
s << "\"" << openssl.string() << "\" rsa -outform PEM -pubout -in " << private_key.string() << " -out " << public_name.string ();
command (s.str().c_str ());
"/dnQualifier=" + public_key_digest ("ca.key", openssl);
{
- stringstream c;
+ locked_stringstream c;
c << quoted_openssl
<< " req -new -x509 -sha256 -config ca.cnf -days 3650 -set_serial 5"
<< " -subj \"" << ca_subject << "\" -key ca.key -outform PEM -out ca.self-signed.pem";
"/dnQualifier=" + public_key_digest ("intermediate.key", openssl);
{
- stringstream s;
+ locked_stringstream s;
s << quoted_openssl
<< " req -new -config intermediate.cnf -days 3649 -subj \"" << inter_subject << "\" -key intermediate.key -out intermediate.csr";
command (s.str().c_str());
"/dnQualifier=" + public_key_digest ("leaf.key", openssl);
{
- stringstream s;
+ locked_stringstream s;
s << quoted_openssl << " req -new -config leaf.cnf -days 3648 -subj \"" << leaf_subject << "\" -key leaf.key -outform PEM -out leaf.csr";
command (s.str().c_str());
}
#ifndef STRING_COMPOSE_H
#define STRING_COMPOSE_H
-#include <sstream>
+#include <locked_sstream.h>
#include <string>
#include <list>
#include <map> // for multimap
std::string str() const;
private:
- std::ostringstream os;
+ locked_stringstream os;
int arg_no;
// we store the output as a list - when the output string is requested, the
case '8':
case '9':
return true;
-
+
default:
return false;
}
os << obj;
std::string rep = os.str();
-
+
if (!rep.empty()) { // manipulators don't produce output
for (specification_map::const_iterator i = specs.lower_bound(arg_no),
end = specs.upper_bound(arg_no); i != end; ++i) {
output_list::iterator pos = i->second;
++pos;
-
+
output.insert(pos, rep);
}
-
+
os.str(std::string());
//os.clear();
++arg_no;
}
-
+
return *this;
}
: arg_no(1)
{
std::string::size_type b = 0, i = 0;
-
+
// fill in output with the strings between the %1 %2 %3 etc. and
// fill in specs with the positions
while (i < fmt.length()) {
else if (is_number(fmt[i + 1])) { // aha! a spec!
// save string
output.push_back(fmt.substr(b, i - b));
-
+
int n = 1; // number of digits
int spec_no = 0;
spec_no /= 10;
output_list::iterator pos = output.end();
--pos; // safe since we have just inserted a string>
-
+
specs.insert(specification_map::value_type(spec_no, pos));
-
+
// jump over spec string
i += n;
b = i;
else
++i;
}
-
+
if (i - b > 0) // add the rest of the string
output.push_back(fmt.substr(b, i - b));
}
{
// assemble string
std::string str;
-
+
for (output_list::const_iterator i = output.begin(), end = output.end();
i != end; ++i)
str += *i;
-
+
return str;
}
}
// now for the real thing(s)
-namespace String
+namespace String
{
// a series of functions which accept a format string on the form "text %1
// more %2 less %3" and a number of templated parameters and spits out the
.arg(o10);
return c.str();
}
-
+
template <typename T1, typename T2, typename T3, typename T4, typename T5,
typename T6, typename T7, typename T8, typename T9, typename T10,
typename T11>
string
Time::as_string (Standard standard) const
{
- stringstream str;
+ locked_stringstream str;
str << setw(2) << setfill('0') << h << ":"
<< setw(2) << setfill('0') << m << ":"
<< setw(2) << setfill('0') << s << ":";
using std::list;
using std::vector;
using std::string;
-using std::stringstream;
using std::setw;
using std::setfill;
using std::hex;
{
id.erase (std::remove (id.begin(), id.end(), '-'));
for (int i = 0; i < 32; i += 2) {
- stringstream s;
+ locked_stringstream s;
s << id[i] << id[i + 1];
int h;
s >> hex >> h;
static string
get_uuid (unsigned char ** p)
{
- stringstream g;
+ locked_stringstream g;
for (int i = 0; i < 16; ++i) {
g << setw(2) << setfill('0') << hex << static_cast<int> (**p);
char out[encrypted_len * 2];
Kumu::base64encode (encrypted, encrypted_len, out, encrypted_len * 2);
int const N = strlen (out);
- stringstream lines;
+ locked_stringstream lines;
for (int i = 0; i < N; ++i) {
if (i > 0 && (i % 64) == 0) {
lines << "\n";
*/
#include "key.h"
+#include <locked_sstream.h>
#include <asdcp/AS_DCP.h>
#include <asdcp/KM_prng.h>
#include <asdcp/KM_util.h>
-#include <sstream>
#include <string>
#include <iomanip>
using std::string;
-using std::stringstream;
using std::setw;
using std::setfill;
using namespace dcp;
string
Key::hex () const
{
- stringstream g;
+ locked_stringstream g;
for (unsigned int i = 0; i < ASDCP::KeyLen; ++i) {
g << setw(2) << setfill('0') << std::hex << static_cast<int> (_value[i]);
#ifndef LIBDCP_RAW_CONVERT_H
#define LIBDCP_RAW_CONVERT_H
-#include <sstream>
+#include <locked_sstream.h>
#include <iomanip>
namespace dcp {
P
raw_convert (Q v, int precision = 16, bool fixed = false)
{
- std::stringstream s;
+ locked_stringstream s;
s.imbue (std::locale::classic ());
s << std::setprecision (precision);
if (fixed) {
string
Colour::to_argb_string () const
{
- stringstream s;
+ locked_stringstream s;
s << "FF";
s << hex
<< setw(2) << setfill('0') << r
#include "util.h"
#include "exceptions.h"
+#include <locked_sstream.h>
#include <boost/test/unit_test.hpp>
-using std::stringstream;
-
/** Check that dcp::Colour works */
BOOST_AUTO_TEST_CASE (colour)
{
BOOST_CHECK_THROW (dcp::Colour ("001234"), dcp::XMLError);
- stringstream s;
+ locked_stringstream s;
s << c;
BOOST_CHECK_EQUAL (s.str(), "(255, 0, 0)");
}
along with libdcp. If not, see <http://www.gnu.org/licenses/>.
*/
-#include <boost/test/unit_test.hpp>
-#include <libxml++/libxml++.h>
#include "encrypted_kdm.h"
#include "decrypted_kdm.h"
#include "util.h"
+#include <libxml++/libxml++.h>
+#include <boost/test/unit_test.hpp>
using std::list;
-using std::stringstream;
using boost::shared_ptr;
/** Check reading and decryption of a KDM */
);
shared_ptr<xmlpp::DomParser> parser (new xmlpp::DomParser ());
- stringstream s;
- s << kdm.as_xml ();
- parser->parse_stream (s);
+ parser->parse_memory (kdm.as_xml ());
parser->get_document()->write_to_file_formatted ("build/kdm.xml", "UTF-8");
int const r = system (
"xmldiff -c test/data/kdm_TONEPLATES-SMPTE-ENC_.smpte-430-2.ROOT.NOT_FOR_PRODUCTION_20130706_20230702_CAR_OV_t1_8971c838.xml build/kdm.xml"
#define BOOST_TEST_MODULE libdcp_test
#include "util.h"
#include "test.h"
+#include <locked_sstream.h>
#include <libxml++/libxml++.h>
#include <boost/test/unit_test.hpp>
#include <cstdio>
using std::string;
using std::min;
-using std::stringstream;
using std::list;
boost::filesystem::path private_test;
uint8_t* ref_buffer = new uint8_t[buffer_size];
uint8_t* check_buffer = new uint8_t[buffer_size];
- stringstream error;
+ locked_stringstream error;
error << "File " << check.string() << " differs from reference " << ref.string();
while (N) {