| | Wide Studio Object Reference
| |
Class Name
WSCindexVariantData
Specification of methods
WSCindexVariantData Function Description
- Form
- WSCindexVariantData()
- Function
- Constructor of an indexed variant type data list structure
Create an instance of an indexed variant type data list
- Description
-
- Parameters
- None.
- Return value
- A pointer to an instance of an indexed variant type data list
- Notice
-
- Samples
-
WSCindexVariantData indexdata;
long data1 = 100;
char* str1 = "data";
//Memorize values by attaching the index
indexdata["data1"] = data1;
indexdata["data2"] = str1;
//When you want to do the same using setData()
indexdata.setData("data1",data1);
indexdata.setData("data2",str1);
//Obtain memorized data by specifying the index
long val1 = indexdata["data1"];
WSCstring val2 = indexdata["data2"];
//When you want to do the same using getData()
long val3 = indexdata.getData("data1");
WSCstring val4 = indexdata.getData("data2");
//Obtaining the index:
char* index1 = indexdata.getIndex(0); //"data1" is returned
char* index2 = indexdata.getIndex(1); //"data2" is returned
//Obtaining a value by a position
long val5 = indexdata.getData(0);
WSCstring val6 = indexdata.getData(1);
//Obtaining the number of data:
long num = indexdata.getNum();
//Deleting data by specifying the index
indexdata.del("data2");
//Deleting data by specifying a position
indexdata.delPos(0);
//Clearing all data at once
indexdata.clear();
WSCindexVariantData Function Description
- Form
- WSCindexVariantData(WSCindexVariantData&)
- Function
- Copy constructor of an indexed variant type data
Duplicate the given list
- Description
-
- Parameters
- None.
- Return value
- A pointer to an instance of indexed variant type data list
- Notice
-
- Samples
-
//Memorize values attaching the index
WSCindexVariantData indexdata;
indexdata["data1"] = (void*)data1;
indexdata["data2"] = (void*)data2;
//Copy another indexdata2 by a copy constructor
WSCindexVariantData indexdata2(indexdata);
setData Function Description
- Form
- long setData(char* index,WSCvariant data)
- Function
- Store variant type data specifying the index
Various type data can be specified because it is variant type.
- Description
-
- Parameters
-
(in)char* index | Index name |
(in)WSCvariant data | Daata |
- Return value
- WS_NO_ERR= Normal, otherwise error
- Notice
-
- Samples
- Refer to WSCindexVariantData()
getIndex Function Description
- Form
- char* getIndex(long pos)
- Function
- Obtain a specified position index
- Description
-
- Parameters
-
(in)long pos | Data position (Top is 0) |
- Return value
- Index name
- Notice
-
- Samples
- Refer to WSCindexVariantData()
getData Function Description
- Form
- WSCvariant &getData(char* index)
- Function
- Obtain data corresponding to a specified index
- Description
-
- Parameters
-
- Return value
- Stored data
- Notice
- When there is no data corresponding to the index, it returns 0
- Samples
- Refer to WSCindexVariantData()
getData Function Description
- Form
- WSCvariant &getData(long pos)
- Function
- Obtain data of a specified position
- Description
-
- Parameters
-
(in)long pos | Data position (Top is 0) |
- Return value
- Data
- Notice
-
- Samples
- Refer to WSCindexVariantData()
getNum Function Description
- Form
- long getNum()
- Function
- Obtain the number of data that have list
- Description
-
- Parameters
- None.
- Return value
- The number of data
- Notice
-
- Samples
- Refer to WSCindexVariantData()
del Function Description
- Form
- long del(char* index);
- Function
- Delete data corresponding to a specified index
- Description
-
- Parameters
-
- Return value
- WS_NO_ERR= Normal, otherwise error
- Notice
-
- Samples
- Refeer to WSCindexVariantData()
delPos Function Description
- Form
- long delPos(long pos);
- Function
- Delete data of a specified position
- Description
-
- Parameters
-
(in)long pos | Data position (Top is 0) |
- Return value
- WS_NO_ERR= Normal, otherwise error
- Notice
-
- Samples
- Refer to WSCindexVariantData()
clear Function Description
- Form
- void clear();
- Function
- Delete all retained data
- Description
-
- Parameters
- None.
- Return value
- None.
- Notice
-
- Samples
- Refer to WSCindexVariantData()
[ ] Operator Description
- Form
- WSCvariant& operator [] (char* index)
- Function
- Obtain data corresponding to a specified index
- Description
-
- Parameters
-
Used as follows
- Return value
- Data
- Notice
-
- Samples
- Refer to WSCindexVariantData()
= Operator Description
- Form
- WSCindexVariantData& operator = (WSCindexVariantData& src)
- Function
- Copy operator
- Description
-
- Parameters
-
(in)WSCindexVariant& src | Copy source instance |
- Return value
- Copied instance
- Notice
-
- Samples
-
//Memorize values attached to the index
WSCindexData indexdata;
indexdata["data1"] = (void*)data1;
indexdata["data2"] = (void*)data2;
//Copy another indexdata2 by a copy constructor
WSCindexData indexdata2;
//Execute copy operator
indexdata2 = indexdata;
Document Release 3.20 For use with Wide Studio Release 3.20, Spring 2003 Wide Studio Home | Up to Copyright(C) T. Hirabayashi, 1999-2003 | | Last modified: February 3, 2003 | |