mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-26 17:20:53 +01:00
[ion] Ion::Storage is not a global variable anymore
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#ifndef CODE_SCRIPT_STORE_H
|
||||
#define CODE_SCRIPT_STORE_H
|
||||
|
||||
#include <ion.h>
|
||||
#include "script.h"
|
||||
#include "script_template.h"
|
||||
#include <python/port/port.h>
|
||||
@@ -8,8 +9,6 @@ extern "C" {
|
||||
#include "py/parse.h"
|
||||
}
|
||||
|
||||
extern Ion::Storage storage;
|
||||
|
||||
namespace Code {
|
||||
|
||||
class ScriptStore : public MicroPython::ScriptProvider {
|
||||
@@ -20,13 +19,13 @@ public:
|
||||
|
||||
ScriptStore();
|
||||
Script scriptAtIndex(int index) {
|
||||
return Script(storage.recordWithExtensionAtIndex(k_scriptExtension, index));
|
||||
return Script(Ion::Storage::sharedStorage()->recordWithExtensionAtIndex(k_scriptExtension, index));
|
||||
}
|
||||
Script scriptNamed(const char * name) {
|
||||
return Script(storage.recordNamed(name));
|
||||
return Script(Ion::Storage::sharedStorage()->recordNamed(name));
|
||||
}
|
||||
int numberOfScripts() {
|
||||
return storage.numberOfRecordsWithExtension(k_scriptExtension);
|
||||
return Ion::Storage::sharedStorage()->numberOfRecordsWithExtension(k_scriptExtension);
|
||||
}
|
||||
Ion::Storage::Record::ErrorStatus addNewScript() {
|
||||
return addScriptFromTemplate(ScriptTemplate::Empty());
|
||||
|
||||
Reference in New Issue
Block a user