uCalc API Version: 5.7.0-preview.1 Released: 7/30/2026
Warning
uCalc API Preview Release Notice:This preview documentation describes the intended behavior of the API. It is not fully accurate or complete.The current preview build contains incomplete features, unoptimized performance, and is subject to breaking changes.Use of the preview version in your production code is not recommended.
Explains the different syntaxes for accessing uCalc properties, including native C#/VB property syntax, C++ method calls, and universal Get/Set methods.
uCalc is designed with a consistent cross-platform API, but it also embraces idiomatic language features to provide a natural developer experience. Many members documented as "properties" can be accessed in several ways, depending on the language and coding style.
For C# and VB.NET developers, properties can be accessed using the familiar assignment (=) syntax. The uCalc engine maps these property accesses to the underlying getter and setter methods.
// Gettervar value = myObject.PropertyName;// SettermyObject.PropertyName = "new value";' GetterDim value = myObject.PropertyName' SettermyObject.PropertyName = "new value"C++ does not have a direct equivalent to C#/VB.NET properties. Instead, all property interactions are performed through explicit method calls. The getter is a parameterless method, and the setter is a method with one parameter.
// Getterauto value = myObject.PropertyName();// SettermyObject.PropertyName("new value");For complete cross-platform consistency, every property also has explicit Get... and Set... methods. These are available in all languages and are useful for library authors or teams working in multiple languages.
var value = myObject.GetPropertyName();myObject.SetPropertyName("new value");Dim value = myObject.GetPropertyName()myObject.SetPropertyName("new value")auto value = myObject.GetPropertyName();myObject.SetPropertyName("new value");The Set... methods have a special feature: they return the object instance itself. This enables a fluent interface, allowing you to chain multiple setter calls together into a single, readable statement.
// C# Example of chaining multiple Set... calls on DefaultRuleSett.GetDefaultRuleSet() .SetBracketSensitive(false) .SetCaseSensitive(false) .SetQuoteSensitive(false);| Feature | C# | VB.NET | C++ |
|---|---|---|---|
| Getter | var x = t.MyProp; | Dim x = t.MyProp | auto x = t.MyProp(); |
| Setter | t.MyProp = "v"; | t.MyProp = "v" | t.MyProp("v"); |
| Prefixed getter | var x = t.GetMyProp(); | Dim x = t.GetMyProp() | auto x = t.GetMyProp(); |
| Fluent Setter | t.SetMyProp("v"); | t.SetMyProp("v") | t.SetMyProp("v"); |
This multi-faceted API design reflects a pragmatic approach. Instead of forcing a single "one-size-fits-all" method, uCalc provides:
Get/Set methods) for library authors or teams working in multiple languages.This is a distinct advantage over libraries that either expose a C-style method-only API (which feels unnatural in C#) or a property-only API (which is unusable in C++). uCalc's translation layer provides the best of all worlds.
ID: 1160
using uCalcSoftware;
var uc = new uCalc();
var t = new uCalc.Transformer();
// Set the description using the property setter syntax
t.Description = "My Transformer";
// Get the description using the property getter syntax
Console.WriteLine($"Description: {t.Description}");
Description: My Transformer using uCalcSoftware; var uc = new uCalc(); var t = new uCalc.Transformer(); // Set the description using the property setter syntax t.Description = "My Transformer"; // Get the description using the property getter syntax Console.WriteLine($"Description: {t.Description}");
#include
#include "uCalc.h"
using namespace std;
using namespace uCalcSoftware;
int main() {
uCalc uc;
uCalc::Transformer t;
// Set the description using the property setter syntax
t.Description("My Transformer");
// Get the description using the property getter syntax
cout << "Description: " << t.Description() << endl;
}
Description: My Transformer #include <iostream> #include "uCalc.h" using namespace std; using namespace uCalcSoftware; int main() { uCalc uc; uCalc::Transformer t; // Set the description using the property setter syntax t.Description("My Transformer"); // Get the description using the property getter syntax cout << "Description: " << t.Description() << endl; }
Imports System
Imports uCalcSoftware
Public Module Program
Public Sub Main()
Dim uc As New uCalc()
Dim t As New uCalc.Transformer()
'// Set the description using the property setter syntax
t.Description = "My Transformer"
'// Get the description using the property getter syntax
Console.WriteLine($"Description: {t.Description}")
End Sub
End Module
Description: My Transformer Imports System Imports uCalcSoftware Public Module Program Public Sub Main() Dim uc As New uCalc() Dim t As New uCalc.Transformer() '// Set the description using the property setter syntax t.Description = "My Transformer" '// Get the description using the property getter syntax Console.WriteLine($"Description: {t.Description}") End Sub End Module
ID: 1161
using uCalcSoftware;
var uc = new uCalc();
var t = uc.NewTransformer();
var rule = t.FromTo("A", "B");
// Chain multiple Set... methods for a clean configuration
rule.SetCaseSensitive(true)
.SetWhitespaceSensitive(false)
.SetQuoteSensitive(false);
// Verify the properties were set using their corresponding getters
Console.WriteLine($"Case Sensitive: {rule.CaseSensitive}");
Console.WriteLine($"Whitespace Sensitive: {rule.WhitespaceSensitive}");
Console.WriteLine($"Quote Sensitive: {rule.QuoteSensitive}");
Case Sensitive: True
Whitespace Sensitive: False
Quote Sensitive: False using uCalcSoftware; var uc = new uCalc(); var t = uc.NewTransformer(); var rule = t.FromTo("A", "B"); // Chain multiple Set... methods for a clean configuration rule.SetCaseSensitive(true) .SetWhitespaceSensitive(false) .SetQuoteSensitive(false); // Verify the properties were set using their corresponding getters Console.WriteLine($"Case Sensitive: {rule.CaseSensitive}"); Console.WriteLine($"Whitespace Sensitive: {rule.WhitespaceSensitive}"); Console.WriteLine($"Quote Sensitive: {rule.QuoteSensitive}");
#include
#include "uCalc.h"
using namespace std;
using namespace uCalcSoftware;
#define tf(IsTrue) ((IsTrue) ? "True" : "False")
int main() {
uCalc uc;
auto t = uc.NewTransformer();
auto rule = t.FromTo("A", "B");
// Chain multiple Set... methods for a clean configuration
rule.SetCaseSensitive(true)
.SetWhitespaceSensitive(false)
.SetQuoteSensitive(false);
// Verify the properties were set using their corresponding getters
cout << "Case Sensitive: " << tf(rule.CaseSensitive()) << endl;
cout << "Whitespace Sensitive: " << tf(rule.WhitespaceSensitive()) << endl;
cout << "Quote Sensitive: " << tf(rule.QuoteSensitive()) << endl;
}
Case Sensitive: True
Whitespace Sensitive: False
Quote Sensitive: False #include <iostream> #include "uCalc.h" using namespace std; using namespace uCalcSoftware; #define tf(IsTrue) ((IsTrue) ? "True" : "False") int main() { uCalc uc; auto t = uc.NewTransformer(); auto rule = t.FromTo("A", "B"); // Chain multiple Set... methods for a clean configuration rule.SetCaseSensitive(true) .SetWhitespaceSensitive(false) .SetQuoteSensitive(false); // Verify the properties were set using their corresponding getters cout << "Case Sensitive: " << tf(rule.CaseSensitive()) << endl; cout << "Whitespace Sensitive: " << tf(rule.WhitespaceSensitive()) << endl; cout << "Quote Sensitive: " << tf(rule.QuoteSensitive()) << endl; }
Imports System
Imports uCalcSoftware
Public Module Program
Public Sub Main()
Dim uc As New uCalc()
Dim t = uc.NewTransformer()
Dim rule = t.FromTo("A", "B")
'// Chain multiple Set... methods for a clean configuration
rule.SetCaseSensitive(true).SetWhitespaceSensitive(false).SetQuoteSensitive(false)
'// Verify the properties were set using their corresponding getters
Console.WriteLine($"Case Sensitive: {rule.CaseSensitive}")
Console.WriteLine($"Whitespace Sensitive: {rule.WhitespaceSensitive}")
Console.WriteLine($"Quote Sensitive: {rule.QuoteSensitive}")
End Sub
End Module
Case Sensitive: True
Whitespace Sensitive: False
Quote Sensitive: False Imports System Imports uCalcSoftware Public Module Program Public Sub Main() Dim uc As New uCalc() Dim t = uc.NewTransformer() Dim rule = t.FromTo("A", "B") '// Chain multiple Set... methods for a clean configuration rule.SetCaseSensitive(true).SetWhitespaceSensitive(false).SetQuoteSensitive(false) '// Verify the properties were set using their corresponding getters Console.WriteLine($"Case Sensitive: {rule.CaseSensitive}") Console.WriteLine($"Whitespace Sensitive: {rule.WhitespaceSensitive}") Console.WriteLine($"Quote Sensitive: {rule.QuoteSensitive}") End Sub End Module