Rigs of Rods 2026.01
Soft-body Physics Simulation
Loading...
Searching...
No Matches
LocalStorageAngelscriptWrappers.h
Go to the documentation of this file.
1/*
2 This source file is part of Rigs of Rods
3 Copyright 2005-2012 Pierre-Michel Ricordel
4 Copyright 2007-2012 Thomas Fischer
5 Copyright 2013-2023 Petr Ohlidal
6
7 For more information, see http://www.rigsofrods.org/
8
9 Rigs of Rods is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License version 3, as
11 published by the Free Software Foundation.
12
13 Rigs of Rods is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with Rigs of Rods. If not, see <http://www.gnu.org/licenses/>.
20*/
21
27
28#pragma once
29
30#include "LocalStorage.h"
31
32#include <string>
33
35
36using namespace RoR;
37
38static LocalStorage* LocalStorageFactory(std::string filename, const std::string& section_name, const std::string& rg_name)
39{
40 return new LocalStorage(filename, section_name, rg_name);
41}
42
43// The script declares `const bool &in` - the C++ `set()` takes `bool` by value.
44static void LocalStorage_setBool(LocalStorage* self, std::string key, const bool& value)
45{
46 self->set(key, value);
47}
48
49// The script declares `string &in` - the C++ `exists()` takes `std::string` by value.
50static bool LocalStorage_exists(LocalStorage* self, const std::string& key)
51{
52 return self->exists(key);
53}
54
55// The script declares `string &in` - the C++ `eraseKey()` takes `std::string` by value.
56static void LocalStorage_eraseKey(LocalStorage* self, const std::string& key)
57{
58 self->eraseKey(key);
59}
60
61} // namespace LocalStorageAngelscriptWrappers
A class that allows scripts to store data persistently.
void eraseKey(std::string key)
bool exists(std::string key)
void set(std::string key, const std::string &value)
static void LocalStorage_setBool(LocalStorage *self, std::string key, const bool &value)
static void LocalStorage_eraseKey(LocalStorage *self, const std::string &key)
static LocalStorage * LocalStorageFactory(std::string filename, const std::string &section_name, const std::string &rg_name)
static bool LocalStorage_exists(LocalStorage *self, const std::string &key)