From 1049c8e383ffe47deabece59c03f5781e13935df Mon Sep 17 00:00:00 2001
From: Syping <schiedelrafael@keppe.org>
Date: Fri, 3 Sep 2021 17:59:54 +0200
Subject: [PATCH] allow loading of std::string, README update

---
 README.md         | 1 +
 src/RagePhoto.cpp | 5 +++++
 src/RagePhoto.h   | 1 +
 3 files changed, 7 insertions(+)

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();