* @brief Classes used to parse a AssetMap.
*/
+#include <boost/algorithm/string.hpp>
#include "asset_map.h"
#include "util.h"
string const prefix = "file://";
- if (starts_with (path, prefix)) {
+ if (boost::algorithm::starts_with (path, prefix)) {
path = path.substr (prefix.length());
}
#include <cassert>
#include <iostream>
#include <boost/filesystem.hpp>
+#include <boost/algorithm/string.hpp>
#include <libxml++/libxml++.h>
#include "dcp.h"
#include "asset.h"
boost::filesystem::path t = _directory;
t /= (*i)->chunks.front()->path;
- if (ends_with (t.string(), ".mxf") || ends_with (t.string(), ".ttf")) {
+ if (boost::algorithm::ends_with (t.string(), ".mxf") || boost::algorithm::ends_with (t.string(), ".ttf")) {
continue;
}
assert (false);
}
-/** @param big A string.
- * @param little A string which is the same length as, or shorter than, big.
- * @return true if `big' starts with `little'.
- */
-bool
-libdcp::starts_with (string big, string little)
-{
- if (little.size() > big.size()) {
- return false;
- }
-
- return big.substr (0, little.length()) == little;
-}
-
-/** @param big A string.
- * @param little A string which is the same length as, or shorter than, big.
- * @return true if `big' ends with `little'.
- */
-bool
-libdcp::ends_with (string big, string little)
-{
- if (little.size() > big.size()) {
- return false;
- }
-
- return big.compare (big.length() - little.length(), little.length(), little) == 0;
-}
-
/** Decompress a JPEG2000 image to a bitmap.
* @param data JPEG2000 data.
* @param size Size of data in bytes.
extern std::string make_digest (std::string filename);
extern std::string content_kind_to_string (ContentKind kind);
extern ContentKind content_kind_from_string (std::string kind);
-extern bool starts_with (std::string big, std::string little);
-extern bool ends_with (std::string big, std::string little);
extern bool empty_or_white_space (std::string s);
extern opj_image_t* decompress_j2k (uint8_t* data, int64_t size, int reduce);
extern boost::shared_ptr<ARGBFrame> xyz_to_rgb (opj_image_t* xyz_frame);