SLProject  4.2.000
A platform independent 3D computer graphics framework for desktop OS, Android, iOS and online in web browsers
SLIOLocalStorage.h
Go to the documentation of this file.
1 /**
2  * \file SLIOLocalStorage.h
3  * \date October 2022
4  * \authors Marino von Wattenwyl
5  * \copyright http://opensource.org/licenses/GPL-3.0
6  * \remarks Please use clangformat to format the code. See more code style on
7  * https://github.com/cpvrlab/SLProject4/wiki/SLProject-Coding-Style
8 */
9 
10 #ifndef SLPROJECT_SLIOLOCALSTORAGE_H
11 #define SLPROJECT_SLIOLOCALSTORAGE_H
12 
13 #include <SLFileStorage.h>
14 #include <SLIOMemory.h>
15 
16 #ifdef SL_STORAGE_WEB
17 //-----------------------------------------------------------------------------
18 //! Collection of functions for accessing browser local storage
20 {
21 bool exists(std::string path);
22 }
23 //-----------------------------------------------------------------------------
24 //! SLIOStream implementation for reading from browser local storage
25 /*!
26  * The constructor loads the file from local storage into memory using the
27  * JavaScript API provided by the web browser.
28  */
30 {
31 public:
32  SLIOReaderLocalStorage(std::string path);
34 };
35 //-----------------------------------------------------------------------------
36 //! SLIOStream implementation for writing to browser local storage
37 /*!
38  * When calling flush, the memory is written from memory to local storage using
39  * the JavaScript API provided by the web browser.
40  */
42 {
43 public:
44  SLIOWriterLocalStorage(std::string path);
45  void flush();
46 };
47 //-----------------------------------------------------------------------------
48 #endif
49 
50 #endif // SLPROJECT_SLIOLOCALSTORAGE_H
SLIOStream implementation for reading from browser local storage.
SLIOReaderLocalStorage(std::string path)
SLIOStream implementation for reading from memory.
Definition: SLIOMemory.h:28
SLIOStream implementation for writing to browser local storage.
SLIOWriterLocalStorage(std::string path)
SLIOStream implementation for reading to memory.
Definition: SLIOMemory.h:43
Collection of functions for accessing browser local storage.
bool exists(std::string path)