diff --git a/.github/workflows/pkgrelease.yml b/.github/workflows/publish.yml
similarity index 85%
rename from .github/workflows/pkgrelease.yml
rename to .github/workflows/publish.yml
index 9f0db8c..3a5642b 100644
--- a/.github/workflows/pkgrelease.yml
+++ b/.github/workflows/publish.yml
@@ -21,4 +21,4 @@ jobs:
env:
NUGET_KEY: ${{ secrets.NUGET_KEY }}
NUGET_API: https://api.nuget.org/v3/index.json
- run: dotnet nuget push CSTNet.*.nupkg -k $NUGET_KEY -s $NUGET_API
+ run: dotnet nuget push CSTNet.*.nupkg -k $DEPLOY_KEY -s https://api.nuget.org/v3/index.json
diff --git a/.vscode/launch.json b/.vscode/launch.json
index 4e5f761..383db6a 100644
--- a/.vscode/launch.json
+++ b/.vscode/launch.json
@@ -1,27 +1,27 @@
{
- // Use IntelliSense to find out which attributes exist for C# debugging
- // Use hover for the description of the existing attributes
- // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
- "version": "0.2.0",
- "configurations": [
- {
- "name": ".NET Core Launch (console)",
- "type": "coreclr",
- "request": "launch",
- "preLaunchTask": "build",
- // If you have changed target frameworks, make sure to update the program path.
- "program": "${workspaceFolder}/CSTNet.Tests/bin/Debug/netcoreapp3.1/CSTNet.Tests.dll",
- "args": [],
- "cwd": "${workspaceFolder}/CSTNet.Tests",
- // For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console
- "console": "internalConsole",
- "stopAtEntry": false
- },
- {
- "name": ".NET Core Attach",
- "type": "coreclr",
- "request": "attach",
- "processId": "${command:pickProcess}"
- }
- ]
-}
\ No newline at end of file
+ // Use IntelliSense to find out which attributes exist for C# debugging
+ // Use hover for the description of the existing attributes
+ // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
+ "version": "0.2.0",
+ "configurations": [
+ {
+ "name": ".NET Core Launch (console)",
+ "type": "coreclr",
+ "request": "launch",
+ "preLaunchTask": "build",
+ // If you have changed target frameworks, make sure to update the program path.
+ "program": "${workspaceFolder}/CSTNet.Tests/bin/Debug/netcoreapp3.1/CSTNet.Tests.dll",
+ "args": [],
+ "cwd": "${workspaceFolder}/CSTNet.Tests",
+ // For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console
+ "console": "internalConsole",
+ "stopAtEntry": false
+ },
+ {
+ "name": ".NET Core Attach",
+ "type": "coreclr",
+ "request": "attach",
+ "processId": "${command:pickProcess}"
+ }
+ ]
+}
diff --git a/.vscode/tasks.json b/.vscode/tasks.json
index 4b8e54d..a59a3e4 100644
--- a/.vscode/tasks.json
+++ b/.vscode/tasks.json
@@ -1,42 +1,53 @@
{
- "version": "2.0.0",
- "tasks": [
- {
- "label": "build",
- "command": "dotnet",
- "type": "process",
- "args": [
- "build",
- "${workspaceFolder}/CSTNet.Tests/CSTNet.Tests.csproj",
- "/property:GenerateFullPaths=true",
- "/consoleloggerparameters:NoSummary"
- ],
- "problemMatcher": "$msCompile"
- },
- {
- "label": "publish",
- "command": "dotnet",
- "type": "process",
- "args": [
- "publish",
- "${workspaceFolder}/CSTNet.Tests/CSTNet.Tests.csproj",
- "/property:GenerateFullPaths=true",
- "/consoleloggerparameters:NoSummary"
- ],
- "problemMatcher": "$msCompile"
- },
- {
- "label": "watch",
- "command": "dotnet",
- "type": "process",
- "args": [
- "watch",
- "run",
- "${workspaceFolder}/CSTNet.Tests/CSTNet.Tests.csproj",
- "/property:GenerateFullPaths=true",
- "/consoleloggerparameters:NoSummary"
- ],
- "problemMatcher": "$msCompile"
- }
- ]
-}
\ No newline at end of file
+ "version": "2.0.0",
+ "tasks": [
+ {
+ "label": "build",
+ "command": "dotnet",
+ "type": "process",
+ "args": [
+ "build",
+ "${workspaceFolder}/CSTNet.Tests/CSTNet.Tests.csproj",
+ "/property:GenerateFullPaths=true",
+ "/consoleloggerparameters:NoSummary"
+ ],
+ "problemMatcher": "$msCompile"
+ },
+ {
+ "label": "publish",
+ "command": "dotnet",
+ "type": "process",
+ "args": [
+ "publish",
+ "${workspaceFolder}/CSTNet.Tests/CSTNet.Tests.csproj",
+ "/property:GenerateFullPaths=true",
+ "/consoleloggerparameters:NoSummary"
+ ],
+ "problemMatcher": "$msCompile"
+ },
+ {
+ "label": "watch",
+ "command": "dotnet",
+ "type": "process",
+ "args": [
+ "watch",
+ "run",
+ "${workspaceFolder}/CSTNet.Tests/CSTNet.Tests.csproj",
+ "/property:GenerateFullPaths=true",
+ "/consoleloggerparameters:NoSummary"
+ ],
+ "problemMatcher": "$msCompile"
+ },
+ {
+ "label": "test",
+ "command": "dotnet",
+ "type": "process",
+ "args": [
+ "test",
+ "${workspaceFolder}/CSTNet.Tests/CSTNet.Tests.csproj",
+ "/property:GenerateFullPaths=true"
+ ],
+ "problemMatcher": "$msCompile"
+ }
+ ]
+}
diff --git a/CSTNet.Tests/MultilineTests.cs b/CSTNet.Tests/MultilineTests.cs
index ec564e4..11cfa83 100644
--- a/CSTNet.Tests/MultilineTests.cs
+++ b/CSTNet.Tests/MultilineTests.cs
@@ -1,6 +1,5 @@
// This project is licensed under the BSD 3-Clause license.
// See the LICENSE file in the project root for more information.
-
namespace CSTNet.Tests;
public class MultilineTests
diff --git a/CSTNet/CSTNet.csproj b/CSTNet/CSTNet.csproj
index 3bfa41e..8aa2b8d 100644
--- a/CSTNet/CSTNet.csproj
+++ b/CSTNet/CSTNet.csproj
@@ -2,7 +2,7 @@
netstandard2.1;net6.0
- 1.0.400-beta1
+ 2.0.100-beta1
enable
latest
enable
@@ -16,4 +16,4 @@
BSD 3-Clause
-
+
\ No newline at end of file
diff --git a/CSTNet/IUIText.cs b/CSTNet/IUIText.cs
new file mode 100644
index 0000000..a31d2d5
--- /dev/null
+++ b/CSTNet/IUIText.cs
@@ -0,0 +1,9 @@
+// This project is licensed under the BSD 3-Clause license.
+// See the LICENSE file in the project root for more information.
+namespace CSTNet;
+
+public interface IUIText
+{
+ string[] BasePath { get; set; }
+ string GetText(int id, int key);
+}
\ No newline at end of file
diff --git a/CSTNet/UIText.cs b/CSTNet/UIText.cs
index 2b6b3a7..3d6e107 100644
--- a/CSTNet/UIText.cs
+++ b/CSTNet/UIText.cs
@@ -1,9 +1,8 @@
// This project is licensed under the BSD 3-Clause license.
// See the LICENSE file in the project root for more information.
-
namespace CSTNet;
-public class UIText
+public class UIText : IUIText
{
string Language { get; set; } = "english";
diff --git a/README.md b/README.md
index 7be1e98..63c7f6b 100644
--- a/README.md
+++ b/README.md
@@ -1,20 +1,16 @@
-# CSTNet
+# CST.NET
[](https://github.com/tonytins/cstdotnet/blob/main/LICENSE)   [](code_of_conduct.md)
Caret-Separated Text (or CST) is a key-value pair format represented by digits or words as keys and the value as text enclosed between carets. (e.g. `` ^^``) Any text which is not enclosed with carets is considered a comment and ignored. Neither strings nor comments may use the caret character. CST.NET is a library for parsing the CST format.
-## Architecture
-
-CST.NET uses .NET's built-in indexing extension function to accomplish locating of each respective key. As a consequence, it does not matter what you use for keys. I added an additional normalization to the pipeline that converts the document's line endings to the system's, in order to prevent crashes.
-
## Usage
See [usage.md](./usage.md).
## To-do
-- [ ] Support for arguments (e.g. ``%1``)
+- [ ] Support for parameters (e.g. ``%1``)
## Known issues
@@ -27,8 +23,8 @@ See [usage.md](./usage.md).
- [Visual Studio Code](https://code.visualstudio.com/)
- [Visual Studio 2022](https://visualstudio.microsoft.com/)
- [.NET Interactive](https://github.com/dotnet/interactive/blob/main/README.md) for notebooks (optional).
- - [VSCode Extension](https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.dotnet-interactive-vscode) or [nteract](https://nteract.io/).
+ - [VSCode Extension](https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.dotnet-interactive-vscode) or [nteract](https://nteract.io/).
## License
-I license this project under the BSD-3-Clause license - see [LICENSE](LICENSE) for details.
\ No newline at end of file
+I license this project under the BSD-3-Clause license - see [LICENSE](LICENSE) for details.
diff --git a/changelog.md b/changelog.md
index 1201d3e..a0c51cf 100644
--- a/changelog.md
+++ b/changelog.md
@@ -1,24 +1,16 @@
# Change Log
-## 1.0.400
+## 2.0.100
This version supports both .NET Standard 2.1 and .NET 6 and brings with it (much needed) quality of life changes on the project side of things. Apart from that, nothing has changed to the API itself apart from much needed documentation.
From this version onward, CSTNet will only target LTS releases. This is why .NET 5 was skipped, despite the initial platform unification.
-### Project Changes
+### UIText class and interface
-With the move to .NET 6.0, this version brings with it a lot of quality of life changes to the project. This includes file-scoped namespaces, implicit and global usings. For a full list of language changes see [Welcome to C# 10](https://devblogs.microsoft.com/dotnet/welcome-to-csharp-10/).
+The ``UIText`` class implants the ``IUITEext`` interface. It allows for traversing in ``//.dir`` directories and searching for CST files by their Id number. (e.g. _*154*_miscstrings.cst). By defualt, the base path is ``//uitext/.dir``. For more info, see [usage.md](./usage.md).
-### Nullable Reference Types
-
-The only significant architectural change that was finally enabled with this release is [nullable reference types](https://docs.microsoft.com/en-us/dotnet/csharp/whats-new/tutorials/nullable-reference-types). This feature was introduced in .NET Core 3.0 and .NET Standard 2.1, respectfully, but not the .NET Framework. Nullable values are already taken care of by the library but this ensures that it is always enforced.
-
-Due to the Sims community historically using the .NET Framework, this feature was not enabled by default. Starting with this version, it is enabled as modern tools now use latest .NET SDK.
-
-### UIText class
-
-The UIText class allows for travseing in ``//.dir`` directories and searching for CST files by their Id number. (e.g. _*154*_miscstrings.cst). By defualt, the base path is ``//uitext/.dir``. For more info, see [usage.md](./usage.md).
+You can build your own version the
## 1.0.300
diff --git a/usage.md b/usage.md
index b9a6856..926ad3e 100644
--- a/usage.md
+++ b/usage.md
@@ -21,7 +21,7 @@ Console.WriteLine(example);
## In Production
-Based on FreeSO's public APIs, the UIText class provides a basic production infrastructure to be used in production. Starting with 0.1.400, the UIText class provides methods that directory map to these directories relative to the application's.
+The Sims Online, and by extension FreeSO, are the only known example of CST files ever being used in production. CST.NET's APIs is based on FreeSO's and is meant to function both as drop-in replacement and general purpose API.
```csharp
#r "nuget:CSTNet,1.0.300"
@@ -41,7 +41,7 @@ In The Sims Online, it was required translation were prefixed with numbers enclo
- ``uitext/english.dir/_154_miscstrings.cst``
- ``uitext/swedish.dir/_154_miscstrings.cst``
-Note that that ``UIText`` class uses the above mentioned ``CST.Parse()`` method to parse the files.
+Note that the ``UIText`` class uses the above mentioned ``CST.Parse()`` method internally. Any changes made to the CST class.
### Changing base directories