StringValue
is a C++ string class much like the Java
and C# built-in string classes, with Unicode as default.
StringValue
s are immutable. Like in Java and
C# you can freely copy StringValue
s, e.g.
assign them, but you can not directly modify the string value itself. Immutability
confers the following advantages:
-
Constant time for many operations, including assignment,
copy construction and construction from literal, as well as (not yet
implemented) substring extraction.
-
Ability to avoid costly dynamic allocation for many operations,
including copy construction, construction from literal and assignment.
-
Ability to wrap string pointers obtained from e.g. API
functions, with customizable guaranteed destruction, where
StringValue
provides a common interface no matter what kind of string is being passed around.
In addition StringValue
supports “tied strings”, strings that
are nothing but pointers into a reference-counted buffer, e.g. for retrieving
Windows
Unicode command line arguments.
How you can help.
If there are any problems or obvious improvements, please report them.