-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathHybridRiveFileFactorySpec.hpp
More file actions
70 lines (56 loc) · 2.21 KB
/
HybridRiveFileFactorySpec.hpp
File metadata and controls
70 lines (56 loc) · 2.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
///
/// HybridRiveFileFactorySpec.hpp
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
/// https://github.com/mrousavy/nitro
/// Copyright © 2025 Marc Rousavy @ Margelo
///
#pragma once
#if __has_include(<NitroModules/HybridObject.hpp>)
#include <NitroModules/HybridObject.hpp>
#else
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
#endif
// Forward declaration of `HybridRiveFileSpec` to properly resolve imports.
namespace margelo::nitro::rive { class HybridRiveFileSpec; }
#include <memory>
#include "HybridRiveFileSpec.hpp"
#include <NitroModules/Promise.hpp>
#include <string>
#include <NitroModules/ArrayBuffer.hpp>
namespace margelo::nitro::rive {
using namespace margelo::nitro;
/**
* An abstract base class for `RiveFileFactory`
* Inherit this class to create instances of `HybridRiveFileFactorySpec` in C++.
* You must explicitly call `HybridObject`'s constructor yourself, because it is virtual.
* @example
* ```cpp
* class HybridRiveFileFactory: public HybridRiveFileFactorySpec {
* public:
* HybridRiveFileFactory(...): HybridObject(TAG) { ... }
* // ...
* };
* ```
*/
class HybridRiveFileFactorySpec: public virtual HybridObject {
public:
// Constructor
explicit HybridRiveFileFactorySpec(): HybridObject(TAG) { }
// Destructor
~HybridRiveFileFactorySpec() override = default;
public:
// Properties
public:
// Methods
virtual std::shared_ptr<Promise<std::shared_ptr<HybridRiveFileSpec>>> fromURL(const std::string& url, bool loadCdn) = 0;
virtual std::shared_ptr<Promise<std::shared_ptr<HybridRiveFileSpec>>> fromFileURL(const std::string& fileURL, bool loadCdn) = 0;
virtual std::shared_ptr<Promise<std::shared_ptr<HybridRiveFileSpec>>> fromResource(const std::string& resource, bool loadCdn) = 0;
virtual std::shared_ptr<Promise<std::shared_ptr<HybridRiveFileSpec>>> fromBytes(const std::shared_ptr<ArrayBuffer>& bytes, bool loadCdn) = 0;
protected:
// Hybrid Setup
void loadHybridMethods() override;
protected:
// Tag for logging
static constexpr auto TAG = "RiveFileFactory";
};
} // namespace margelo::nitro::rive