-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Core - StorageFile #175
Open
EmmmaTech
wants to merge
62
commits into
natinusala:main
Choose a base branch
from
EmmmaTech:storage-file
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Core - StorageFile #175
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
See natinusala#140 in the upstream repo for more information.
It checks in the brls.json file for a key called "appname" and sets the config folder to, for example, /config/borealis_demo
If the client is on Switch, then config_folder is set to /config/borealis_demo. If it's on PC, then config_folder is set to ./config/borealis_demo. (Where . is the folder where the executable is)
Also changed the documentation comment above writeToFile to make it more descriptive.
I'm open to suggestions on this, I doubt the forever while loop would be good for performance and the QueryAttribute function works correctly.
This is here because TinyXML2 doesn't support STL types like std::string (I'm pretty sure from my research). So if the brls::StorageFile template is std::string or any other STL type, it might not work correctly.
Currently, the app will abort due to a buffer overflow. I'm going to work on it and try to fix it.
Turns out it was because the XML file is empty and the root element is NULL. For some reason though, tinyxml2 is not actually saving the file.
A StorageObject is pretty much a value in the XML file, but in the code. The idea here is that writeToFile can take in a StorageObject and call its getters.
And the other way around
Quick commit for fixing up functions charToOther and otherToChar. Compilation test successful, runtime test hasn't been done yet.
So, I just tested everything, and it actually works! No issues, besides making two XML elements with the same name but different values...
There is a new class called StorageFile, the original StorageFile class is now BasicStorageFile. This new StorageFile class includes some functions that make this Pull Request closer to the original design.
When I mean overwrite, I mean it'll delete an existing element with the same name attribute as the one that needs to be added. If this is off (it's on by default), then writeToFile will never finish and quit.
Added some additional comments about a compiler error (I have no idea how to fix it)
This is only for testing purposes.
Tested via the GLFW Platform. Finally was able to compile and run Borealis on macOS.
Macros - Added and changed up the macros BasicStorageFile - Switched from using vectors to maps BasicStorageFile - Slightly changed some of the logic in writeToFile BasicStorageFile - Removed the createStorageObject functions
Demo - Changed Font Size for the text
Util - Fixed the conversion functions borealis.hpp - Added Util.hpp
Now I love VSCode more. BasicStorageFile - Added statement to clear up an already used allStorageObjects map (might've caused a segmentation fault)
Util.cpp - Removed copyright
BasicStorageFile - Fixed bug where the app would crash when the config folder doesn't exist BasicStorageFile - Fixed bug where the saving document part never got it's error code SettingsFile - Changed from class to struct
BasicStorageFile - Changed error handling logic with saving Macros - Changed the name of some parameters to make it less confusing
The Switch build complained about std::filesystem::current_path().
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This implements the feature described in #140.
This PR was originally located at #146, however due to branch reorganization, I had to reopen it in a new PR.