PrevNextUpHome SophiaFramework UNIVERSE 5.3

20.6. SFXProperty Class: for managing the key / value pair elements

The SFXProperty class is used to manage the set of the key / value pair elements in the appended order.

The SFXProperty class is similar to the SFXArray or SFXHashmap class, but different in that both key and value are of the SFXAnsiString type and more than one element may have the same string key.

Example 20.23. Defining an instance variable

SFXProperty property;

Example 20.24. Setting an element

property.Set("unix", "??");
property.Append("macos", "CR");
property.Insert(1, "windows", "CRLF");
property.Set("unix", "LF");
property.Append("macos", "LF");

Example 20.25. Getting an element

SFXAnsiString str1 = property.Get("unix");
SFXAnsiString str2 = property.GetKey(2);
SFXAnsiString str3 = property.GetValue(2);

Example 20.26. Getting the number of the elements

SInt32 n = property.GetSize();

Example 20.27. Deleting an element

property.Remove(2);
property.Clear("macos");
property.Clear();