[xsd-users] Help me: How to find out what is the type of a class

James Mei jxmei3 at gmail.com
Fri Oct 23 06:03:06 EDT 2009


Hi Boris

I found the reference for the name:

gsec->type()._xsd_tGSEControlTypeEnum_literals_[2]

But is there any variable stores the number of values in the enum ? in this
case it is 2.

Regards
James

On Fri, Oct 23, 2009 at 4:50 PM, James Mei <jxmei3 at gmail.com> wrote:

> Hi Boris
>
> May I know how to get the text value of the Enum from the generated class ?
> With the following class, I want to get GSSE and GOOSE as text.
>
>  class tGSEControlTypeEnum: public ::xml_schema::name
>   {
>     public:
>     enum value
>     {
>       GSSE,
>       GOOSE
>     };
>
>     tGSEControlTypeEnum (value v);
>
>     tGSEControlTypeEnum (const char* v);
>
>     tGSEControlTypeEnum (const ::std::string& v);
>
>     tGSEControlTypeEnum (const ::xml_schema::name& v);
>
>  .......
> }
>
> Regards
> James
>
>
> On Thu, Oct 22, 2009 at 8:44 PM, Boris Kolpackov <boris at codesynthesis.com>wrote:
>
>> Hi James,
>>
>> James Mei <jxmei3 at gmail.com> writes:
>>
>> > The sample code below works with normal pointer to a class. But when it
>> is a
>> > TreeNode->Data is "const sequence <tDataSet> &", then the following code
>> > crashed.
>>
>> sequence (and other containers) are not derived from xml_schema::type so
>> this won't work. Only C++ classes corresponding to XML Schema types are
>> derived from xml_schema::type. If you need to store a pointer to sequence
>> then you will need to invent your own type information.
>>
>> Boris
>>
>
>


More information about the xsd-users mailing list