Unicorn XML Toolkit
Version 1.00.00

Namespace EcmaScript
Class CPropertyMap

class CPropertyMap: public CInterface {
public:
    CPropertyMap();
    ~CPropertyMap();
public:
    void Add(
        const CPropertyName &propertyName,
        int nSelector,
        bool bReadOnly=false);
    int Find(const CPropertyName &propertyName);
    CString GetName(int nIndex);
    int GetSelector(int nIndex);
    int GetAttributes(int nIndex);
    int Next(int nIndex);
    };

The property map of a native object.

A property map is a collection of object properties which require custom implementation of get and/or put operations. Each property in the property map has associated integer selector. Selectors are unique within property maps; they are used by the interpreter to select appropriate get/put procedures for each property in the property map.

Property maps can be attached to native objects (see the CNativeObject class).

Since:
1.00.00
Version:
1.00.00
Author:
Alexey Gokhberg
See Also:
CPropertyName
Constructor/Destructor Summary
CPropertyMap ();
����������Constructs the property map.
~CPropertyMap ();
����������Destroys the property map.

Function Summary
void Add (const CPropertyName &propertyName, int nSelector, bool bReadOnly=false);
����������Adds a property to this property map.
int Find (const CPropertyName &propertyName);
����������Looks up a property in this property map.
CString GetName (int nIndex);
����������Returns a string representation of a property name at the specified index in this property map.
int GetSelector (int nIndex);
����������Returns a selector at the specified index in this property map.
int GetAttributes (int nIndex);
����������Returns attributes at the specified index in this property map.
int Next (int nIndex);
����������Returns the index of the property in this property map which follows the property with the given index.

Constructor/Destructor Detail

CPropertyMap

CPropertyMap();

Constructs the property map.

~CPropertyMap

~CPropertyMap();

Destroys the property map.

Function Detail

Add

void Add(
    const CPropertyName &propertyName,
    int nSelector,
    bool bReadOnly=false);

Adds a property to this property map.

Parameters:
propertyName - the property name
nSelector - the selector
bReadOnly - indicates whether the property has the ReadOnly attribute

Find

int Find(const CPropertyName &propertyName);

Looks up a property in this property map.

Parameters:
propertyName - the property name to look up
Returns:
the index (zero-based) of the specified property in this property map; -1 if the property is not found

GetName

CString GetName(int nIndex);

Returns a string representation of a property name at the specified index in this property map.

Parameters:
nIndex - the index (zero-based)
Returns:
the string representation of a property name at the specified index in this property map

GetSelector

int GetSelector(int nIndex);

Returns a selector at the specified index in this property map.

Parameters:
nIndex - the index (zero-based)
Returns:
the selector at the specified index in this property map

GetAttributes

int GetAttributes(int nIndex);

Returns attributes at the specified index in this property map.

Parameters:
nIndex - the index (zero-based)
Returns:
the attributes at the specified index in this property map

Next

int Next(int nIndex);

Returns the index of the property in this property map which follows the property with the given index.

Parameters:
nIndex - the starting index (zero-based)
Returns:
the index (zero-based) of the property in this property map which follows the property with the given index; -1 if there is no such property (that is, the starting index points to the last property in this property map)

Unicorn XML Toolkit
Version 1.00.00


This document was created using Unicorn DOC++.

Copyright 1999-2001 Unicorn Enterprises SA.
All Rights Reserved.