SequenceSequencesc++cppgetAvailableServiceNamesPierre-André GalmesHowto acces to the content of a Sequence ?
A function returns a Sequence<class T>. Is there any function
associated with the class to acces its data ?
In fact, Sequences are manipulated like array.
/* Copyright (C) 2005 - StarXpert - http://www.starxpert.fr */
#include <iostream>
#include <exception>
#include <rtl/ustring.hxx>
#include <cppuhelper/bootstrap.hxx>
#include <com/sun/star/bridge/XUnoUrlResolver.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
using namespace std;
using namespace ::rtl;
main()
{
[...]
// Returns a sequence of OUString.
Sequence< ::rtl::OUString > sq =
rxOfficeServiceManager->getAvailableServiceNames();
// Returns he number of objects in the sequence.
sq.getLength();
// Access the content of the sequence.
OUString a = sq[1];
OUString b = sq[801]; // sq.getLength() - 1
}added #include directivesInitial version