LeviLamina
Loading...
Searching...
No Matches
PhotoStorage.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/core/file/PathBuffer.h"
7#include "mc/deps/core/string/BasicStackString.h"
8
9// auto generated forward declare list
10// clang-format off
11class Actor;
12class Player;
14namespace Core { class Path; }
15// clang-format on
16
17class PhotoStorage {
18public:
19 // member variables
20 // NOLINTBEGIN
21 ::ll::TypedStorage<8, 32, ::Core::PathBuffer<::std::string>> mBaseDir;
22 ::ll::TypedStorage<8, 32, ::Core::PathBuffer<::std::string>> mBookDir;
23 ::ll::TypedStorage<8, 32, ::Core::PathBuffer<::std::string>> mPhotoDir;
24 ::ll::TypedStorage<8, 32, ::Core::PathBuffer<::std::string>> mPhotoItemDir;
25 ::ll::TypedStorage<8, 32, ::Core::PathBuffer<::std::string>> mManifestDir;
26 ::ll::TypedStorage<8, 64, ::std::unordered_set<::std::string>> mChecksums;
27 // NOLINTEND
28
29public:
30 // prevent constructor by default
31 PhotoStorage();
32
33public:
34 // member functions
35 // NOLINTBEGIN
36 MCAPI explicit PhotoStorage(::Core::Path const& baseDir);
37
38#ifdef LL_PLAT_C
39 MCAPI bool _addValidFile(::Core::Path path);
40
41 MCAPI bool _isValidFile(::Core::Path file);
42
43 MCAPI bool _readFile(::Core::Path path, ::std::string& resultData);
44#endif
45
46 MCAPI void _readManifest();
47
48#ifdef LL_PLAT_C
49 MCAPI bool _writeFile(::Core::Path path, ::std::string const& photoData);
50
51 MCAPI void _writeManifest();
52
53 MCAPI ::Core::PathBuffer<::std::string> getBookPath(::std::string const& bookId);
54
55 MCAPI void getLoosePhotos(::Player& owner, ::std::vector<::Core::PathBuffer<::std::string>>& result);
56
57 MCAPI ::Core::PathBuffer<::std::string> getPath(::PhotoStorageContainer const& container);
58
59 MCAPI void
60 getPhoto(::PhotoStorageContainer const& container, ::std::string const& photoName, ::std::string& resultData);
61
62 MCFOLD ::Core::PathBuffer<::std::string> const& getPhotoItemPath();
63
64 MCAPI ::Core::PathBuffer<::std::string> getPhotoPath(::Actor const& owner) const;
65
66 MCAPI ::Core::PathBuffer<::std::string> getPhotoPathRelative(::Actor& owner);
67
68 MCAPI bool isValidPhoto(::PhotoStorageContainer const& container, ::std::string const& photoName);
69
70 MCAPI void setValidLoosePhoto(::PhotoStorageContainer const& container, ::std::string const& photoName);
71
72 MCAPI void storePhoto(
73 ::PhotoStorageContainer const& container,
74 ::std::string const& photoName,
75 ::std::string const& photoData
76 );
77
78 MCAPI ::Core::PathBuffer<::Core::BasicStackString<char, 1024>> storePhotoFront(
79 ::Player& owner,
80 ::PhotoStorageContainer const& container,
81 ::std::string const& photoName,
82 ::std::string const& photoData
83 );
84#endif
85
86 MCAPI ~PhotoStorage();
87 // NOLINTEND
88
89public:
90 // static functions
91 // NOLINTBEGIN
92#ifdef LL_PLAT_C
93 MCAPI static ::Core::PathBuffer<::std::string> getScreenshotFilename();
94#endif
95 // NOLINTEND
96
97public:
98 // static variables
99 // NOLINTBEGIN
100 MCAPI static ::std::string const& BOOKS_DIR();
101
102 MCAPI static ::std::string const& MANIFEST_NAME();
103
104 MCAPI static ::std::string const& PHOTOITEM_DIR();
105
106 MCAPI static ::std::string const& PHOTO_DIR();
107 // NOLINTEND
108
109public:
110 // constructor thunks
111 // NOLINTBEGIN
112 MCAPI void* $ctor(::Core::Path const& baseDir);
113 // NOLINTEND
114
115public:
116 // destructor thunk
117 // NOLINTBEGIN
118 MCAPI void $dtor();
119 // NOLINTEND
120};
Definition Actor.h:125
Definition PathBuffer.h:8
Definition Path.h:12
Definition Player.h:137
Definition PhotoStorageContainer.h:9