allow loading of std::string, README update

This commit is contained in:
Syping 2021-09-03 17:59:54 +02:00
parent dfeafa3368
commit 1049c8e383
3 changed files with 7 additions and 0 deletions

View file

@ -35,4 +35,5 @@ RagePhoto::Error error = ragePhoto.error();
```bash
ragephoto-extract PGTA5123456789 photo.jpg
ragephoto-extract PRDR3123456789 photo.jpg
```

View file

@ -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;

View file

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