/*
* SchemaStringCollection.h
* Copyright (c) 2011 Antillia.com TOSHIYUKI ARAI. ALL RIGHTS RESERVED.
*/
// SOL9
// 2011/02/06
#pragma once
#include <sol/xml/XMLObject.h>
namespace SOL {
class SchemaStringCollection : public XMLObject {
private:
MSXML2::ISchemaStringCollectionPtr pCollection;
public:
SchemaStringCollection(MSXML2::ISchemaStringCollectionPtr collection)
:pCollection(collection)
{
}
~SchemaStringCollection()
{
pCollection = NULL;
}
public:
MSXML2::ISchemaStringCollectionPtr getCollectionPtr()
{
if (pCollection == NULL) {
throw Exception("Error: SchemaStringCollection is NULL");
}
return pCollection;
}
_bstr_t getItem (long index )
{
return getCollectionPtr()->Getitem (index );
}
long getLength ( )
{
return getCollectionPtr()->Getlength ();
}
IUnknownPtr getNewEnum ( )
{
return getCollectionPtr()->Get_newEnum ();
}
public:
void display(const TCHAR* name=NULL)
{
try {
long length = getLength();
if (length>0) {
if (name == NULL) {
name = _T("SchemaStringCollection");
}
_tprintf(_T("<%s length=\"%d\">\n"), name, length);
for (long i=0; i<length; i++) {
_bstr_t item = getItem(i);
_tprintf(_T("<Item>%s</Item>\n"), (const TCHAR*)item);
}
_tprintf(_T("</%s>\n"), name);
}
} catch (...) {
}
}
};
}
|