libragephoto: add C++ namespaces (API change)

- RagePhoto::saveFile() -> use const char* instead of std::string
- RagePhoto C++ -> C API: try catch for throwable functions (to match C
impl. behaviour)
- Rename header files and classes
This commit is contained in:
Syping 2024-01-15 17:05:54 +01:00
parent b94e66624b
commit e1cf6df258
14 changed files with 275 additions and 249 deletions

View file

@ -16,7 +16,7 @@
* responsible for anything with use of the software, you are self responsible.
*****************************************************************************/
#include <RagePhotoB>
#include <RagePhoto>
#include <QApplication>
#include <QHBoxLayout>
#include <QVBoxLayout>
@ -35,11 +35,11 @@ bool readPhotoFile(const QString &filename, QMainWindow *mainWindow, QLabel *pho
if (file.open(QIODevice::ReadOnly)) {
const QByteArray fileData = file.readAll();
file.close();
RagePhotoB ragePhoto;
RagePhoto ragePhoto;
const bool loaded = ragePhoto.load(fileData.data(), static_cast<size_t>(fileData.size()));
if (!loaded) {
const int32_t error = ragePhoto.error();
if (error <= RagePhotoB::PhotoReadError) {
if (error <= RagePhoto::PhotoReadError) {
QMessageBox::warning(mainWindow, "Open Photo", "Failed to read photo: " + filename);
return false;
}