diff --git a/README.md b/README.md index 56414fd..329790a 100644 --- a/README.md +++ b/README.md @@ -35,4 +35,5 @@ RagePhoto::Error error = ragePhoto.error(); ```bash ragephoto-extract PGTA5123456789 photo.jpg +ragephoto-extract PRDR3123456789 photo.jpg ``` diff --git a/src/RagePhoto.cpp b/src/RagePhoto.cpp index 8bf36bc..20881ee 100644 --- a/src/RagePhoto.cpp +++ b/src/RagePhoto.cpp @@ -349,6 +349,11 @@ bool RagePhoto::load(const char *data, size_t length) return false; } +bool RagePhoto::load(const std::string &data) +{ + return load(data.data(), data.size()); +} + RagePhoto::Error RagePhoto::error() { return p_error; diff --git a/src/RagePhoto.h b/src/RagePhoto.h index 18e38d9..2b244c1 100644 --- a/src/RagePhoto.h +++ b/src/RagePhoto.h @@ -72,6 +72,7 @@ public: ~RagePhoto(); void clear(); bool load(const char *data, size_t length); + bool load(const std::string &data); Error error(); const char *photoData(); const uint32_t photoSize();