X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Futil.h;h=8c4e475c094377ba2e97f10c8744da5fcd853b87;hb=f443c3161460c1b927ec9072fdc4e76a2f156cab;hp=fe662dd4766512f7f827df6521ff3aeea2d8ef71;hpb=d4270052ecfd3f75314fc8ea0e22c20384ff8b3c;p=libdcp.git diff --git a/src/util.h b/src/util.h index fe662dd4..8c4e475c 100644 --- a/src/util.h +++ b/src/util.h @@ -55,6 +55,10 @@ LIBDCP_ENABLE_WARNINGS #include +/* windows.h defines this but we want to use it */ +#undef ERROR + + #define LIBDCP_UNUSED(x) (void)(x) @@ -81,11 +85,11 @@ extern std::string make_uuid (); /** Create a digest for a file * @param filename File name - * @param progress Optional progress reporting function. The function will be called - * with a progress value between 0 and 1 + * @param progress Optional progress reporting function, called with a number of bytes done + * and a total number of bytes. * @return Digest */ -extern std::string make_digest (boost::filesystem::path filename, boost::function); +extern std::string make_digest(boost::filesystem::path filename, boost::function); extern std::string make_digest (ArrayData data); @@ -116,12 +120,12 @@ extern int base64_decode (std::string const & in, unsigned char* out, int out_le extern boost::optional relative_to_root (boost::filesystem::path root, boost::filesystem::path file); extern std::string file_to_string (boost::filesystem::path, uintmax_t max_length = 1048576); +extern void write_string_to_file(std::string const& string, boost::filesystem::path const& path); /** @param key RSA private key in PEM format (optionally with -----BEGIN... / -----END...) * @return SHA1 fingerprint of key */ extern std::string private_key_fingerprint (std::string key); -extern xmlpp::Node* find_child (xmlpp::Node const * node, std::string name); extern std::string openjpeg_version(); extern std::string spaces (int n); extern void indent (xmlpp::Element* element, int initial);