.NET Parser for The Sims Online's CST format.
Find a file
Tony Bark 6dea456a25
1.0.300 (#4)
- Switched to Sixam.CST namespace and marked CSTNet namespace as obsolete.
- Renumbered patch version from single to triple digits.
- Performance improvements.
2020-12-13 06:54:54 -05:00
.github Uncommented push to NuGet 2020-12-11 01:52:10 -05:00
.vscode Added VSCode tasks 2020-12-08 19:09:34 -05:00
CSTNet 1.0.300 (#4) 2020-12-13 06:54:54 -05:00
CSTNet.Tests 1.0.300 (#4) 2020-12-13 06:54:54 -05:00
notebooks Showed the right Multiline v2 output in notebook 2020-12-12 03:51:45 -05:00
.editorconfig Add project files. 2020-12-08 17:56:38 -05:00
.gitattributes Add .gitignore and .gitattributes. 2020-12-08 17:56:36 -05:00
.gitignore Rewrote normalizing algorithm 2020-12-11 01:05:46 -05:00
changelog.md 1.0.300 (#4) 2020-12-13 06:54:54 -05:00
code_of_conduct.md Migrated CST notebook from .NET Labs 2020-12-08 18:46:52 -05:00
LICENSE Add project files. 2020-12-08 17:56:38 -05:00
README.md 1.0.300 (#4) 2020-12-13 06:54:54 -05:00
Sixam.CST.sln 1.0.300 (#4) 2020-12-13 06:54:54 -05:00
Sixam.CST.sln.licenseheader 1.0.300 (#4) 2020-12-13 06:54:54 -05:00

Sixam.CST

License: MIT Contributor Covenant

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. <key> ^<text>^) Any text which is not enclosed with carets is considered a comment and ignored. Neither strings nor comments may use the caret character. Sixam.CST is a library for parsing the CST format.

Usage

1 ^The quick brown fox jumps over the lazy dog.^
#r "nuget:CSTNet,1.0.300"
using System;
using System.IO;
using CSTNet;

var file = File.ReadAllText("example.cst");
var example = CaretSeparatedText.Parse(file, 1);

Console.WriteLine(example);

See working example on .NET Fiddle.

In production, CST files were used in The Sims Online (TSO) to provide translations. Each translation was split into their respective directories:

  • uitext/english.dir/_154_miscstrings.cst
  • uitext/swedish.dir/_154_miscstrings.cst

Sixam.CST only provides the basic parsing functionality.

To-do

  • Support for arguments (e.g. %1)

Known issues

  • Skipping comments is a little buggy.

Requirements

Prerequisites

License

I license this project under the MIT license - see LICENSE for details.