bug-commoncpp
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A ost::Keydata Question


From: David Sugar
Subject: Re: A ost::Keydata Question
Date: Fri, 28 Jun 2002 12:03:59 -0400 (EDT)

You are the first to ask this :).  I think we can probably come up with a 
table walking function that can count the entries, and call it "getCount".  
In fact, I think I will add this, as usually I just have been creating an
array as big as I think it might need to be for my projects :).

On Fri, 28 Jun 2002, Vivek Sawant wrote:

> Hi David,
> 
> Thanks to you and othe contributors for creating this useful library. I 
> don't know if you actively support CommonC++ yourself. If you don't, can 
> you forward my question to someone who can answer it? Thanks.
> 
> I am using the Keydata class of CommonC++ for implementing configuration 
> files for my application. As I understand from the documentation, the 
> getIndex () function must be passed an array of pointers preallocated by 
> the caller. Now, how does the caller know how big an array to allocate 
> if it wants to retrieve all the keys contained in the list? In other 
> words, what value of "max" should be used in such a case? Allocating a 
> huge array (much bigger than ever needed) is not an appealing solution 
> to me. There is no function that returns the number of keys in 
> "keydata". Also, I don't suppose that getIndex works as an Iterator 
> either. That is, repeated calls to getIndex won't allow me to go down 
> the list. Just wanted check this with the authors before run and 
> implement a new method myself.
> 
> Please advise.
> 
> Thanks.
> 
> \vivek
> 
> 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]