This page will go over how to format folder/file paths in Reyveld.
Making folder paths for different platforms at once can be tricky, so Reyveld tries to make paths easier for developers by having a few path formatting features to make sure your logic works on every platform.
Formatting
Rule 1: Never Use Absolute Paths
Incorrect
C:/Users/Default/AppData/Roaming
Correct
:appdata:
Rule 2: No backslashes.
Incorrect
:appdata:\reyveld\constellations\
Correct
:appdata:/reyveld/constellations/
Environment Variables
Windows, Linux, and MacOS all have their own way of accessing environment variables, and if want to port Reyveld to more than just those three platforms, we need a universal way of representing variables.
So, I decided to use colons to act as our universal way of expressing variables, as it is not a valid character on most platforms.
Incorrect
Correct
Platform Tags
There are many cases when we may want a different path for a specific platform, however we would need to write logic to do so. Platform tags an easy alternative.
Structure
<[platform identifier here]>'[path-to]'
Every tag takes a unique three letter identifier to represent a specific platform, and a string right after.
Example
You can even have different versions for each platform.
Example
If you need a fallback on other platforms, use the any identifier.
Example
You can even have one string for multiple identifiers.