![]() ![]() ![]()
|
BREW C++ Class Library & GUI Framework & XML Middleware : SophiaFramework 4.1 |
The SFXProperty class is similar to the SFXArray or SFXHashmap class, but different in that both key and value are of string type and more than one element may have the same string key.
Example 481. Set an element
property.Set("unix", "??");
property.Append("macos", "CR");
property.Insert(1, "windows", "CRLF");
property.Set("unix", "LF");
property.Append("macos", "LF");
| Constructor/Destructor |
|---|
|
SFXProperty( Void ) Constructor of SFXProperty class.
|
|
~SFXProperty( Void ) Destructor of SFXProperty class.
|
| Public Functions | |
|---|---|
| SFCError |
Append(
SFXAnsiStringConstRef key
, SFXAnsiStringConstRef value
) Append a pair element of string key and its string value. ( more than two pair elements can have the same string key )
|
| Void |
Clear(
SFXAnsiStringConstRef key
, Bool sensitive = true
) Clear( Void ) Clear the elements related with the specified key or all the elements.
|
| Bool |
Contains(
SFXAnsiStringConstRef key
, Bool sensitive = true
) Check whether the element with specified key is contained or not.
|
| static SFXPropertyConstRef |
EmptyInstance( Void ) Get an empty property.
|
| SInt32 |
FirstIndexOf(
SFXAnsiStringConstRef key
, SInt32 index = SINT32_MINIMUM
, Bool sensitive = true
) Get the first index of the element to match with the specified key, searching from the beginning.
|
| SFXAnsiStringConstRef |
Get(
SFXAnsiStringConstRef key
, Bool sensitive = true
) Get the value of pair element to match with the specified key.
|
| SFXAnsiStringConstRef |
GetKey(
SInt32 index
) Get the key of element at the specified index.
|
| SInt32 |
GetSize( Void ) Get the size. ( the number of pair elements of string key and its string value )
|
| SFXAnsiStringConstRef |
GetValue(
SInt32 index
) Get the value of element at the specified index.
|
| SFCError |
Insert(
SInt32 index
, SFXAnsiStringConstRef key
, SFXAnsiStringConstRef value
) Insert an element of string key and its string value at the specified index.
|
| Bool |
IsEmpty( Void ) Check whether the property is empty or not.
|
| SInt32 |
LastIndexOf(
SFXAnsiStringConstRef key
, SInt32 index = SINT32_MAXIMUM
, Bool sensitive = true
) Get the last index of the element to match with the specified key, searching from the end.
|
| Void |
Remove(
SInt32 begin
, SInt32 end
) Remove( SInt32 index ) Remove the elements at the specified index or range.
|
| SFCError |
Set(
SFXAnsiStringConstRef key
, SFXAnsiStringConstRef value
, Bool sensitive = true
) Set the value of pair element with the specified key.
|
| SFCError |
SetKey(
SInt32 index
, SFXAnsiStringConstRef key
) Set the key of element at the specified index.
|
| SFCError |
SetValue(
SInt32 index
, SFXAnsiStringConstRef value
) Get the value of element at the specified index.
|
[ public, explicit ] SFXProperty(Void);
[ public ] ~SFXProperty(Void);
[ public ] SFCError Append( SFXAnsiStringConstRef key // key of string SFXAnsiStringConstRef value // value of string );
[ public ] Void Clear( SFXAnsiStringConstRef key // key of string Bool sensitive = true // case-sensitive on string key or not );
[ public ] Void Clear(Void);
If the "key" argument is specified, the elements related with it are deleted.
If the argument is empty, all the elements are deleted.
[ public, const ] Bool Contains( SFXAnsiStringConstRef key // key of string Bool sensitive = true // case-sensitive on string key or not );
[ public, static ] SFXPropertyConstRef EmptyInstance(Void);
Get an instance that represents an empty property.
[ public, const ] SInt32 FirstIndexOf( SFXAnsiStringConstRef key // key of string to match with SInt32 index = SINT32_MINIMUM // starting index to search from Bool sensitive = true // case-sensitive on string key or not );
Search from beginning to end, and get the first index of the element to match with the specified key.
By specifying a starting index, you can search from any position other than the beginning. (The origin index is 0.)
[ public, const ] SFXAnsiStringConstRef Get( SFXAnsiStringConstRef key // key of string to match with Bool sensitive = true // case-sensitive on string key or not );
If there is an element to match with the specified key, rerurn its value.
If not , return null.
[ public, const ] SFXAnsiStringConstRef GetKey( SInt32 index // index );
If there is an element at the specified index, rerurn its key.
If not , return null.
[ public, const ] SInt32 GetSize(Void);
[ public, const ] SFXAnsiStringConstRef GetValue( SInt32 index // index );
If there is an element at the specified index, rerurn its value.
If not , return null.
[ public ] SFCError Insert( SInt32 index // index to insert at SFXAnsiStringConstRef key // key of string SFXAnsiStringConstRef value // value of string );
[ public, const ] Bool IsEmpty(Void);
[ public, const ] SInt32 LastIndexOf( SFXAnsiStringConstRef key // key of string to match with SInt32 index = SINT32_MAXIMUM // starting index to search from Bool sensitive = true // case-sensitive on string key or not );
Search from end to beginning, and get the last index of the element to match with the specified key.
By specifying a starting index, you can search from any position other than the end. (The origin index is 0.)
[ public ] Void Remove( SInt32 begin // beginning index to remove SInt32 end // end index to remove );
[ public ] Void Remove( SInt32 index // index to remove );
[ public ] SFCError Set( SFXAnsiStringConstRef key // key of string SFXAnsiStringConstRef value // value of string Bool sensitive = true // case-sensitive on string key or not );
If there are already elements with the specified key, the element of which index is minimum is overwritten.
[ public ] SFCError SetKey( SInt32 index // index SFXAnsiStringConstRef key // key of string );
[ public ] SFCError SetValue( SInt32 index // index SFXAnsiStringConstRef value // value of string );
If there is an element at the specified index, rerurn its key.
If not , return null.
|
Copyright (C) 2002 - 2009 Sophia Cradle, Inc. All Rights Reserved. |
![]() ![]() ![]()
|