BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

C++ class iterator - How use ?

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Language C++)
View previous topic :: View next topic  
Author Message
Jim Davis
Guest





PostPosted: Fri May 18, 2007 6:19 am    Post subject: C++ class iterator - How use ? Reply with quote



I want to use an imported C++ class iterator
GetNext() ,
but I don't have the correct syntax ,
and I get BCB6 compile errors .

Any help coding this appreciated ;
here is snip from imported header :

class ID3_CPP_EXPORT ID3_Tag
{
public:
class Iterator
{
public:
virtual ID3_Frame* GetNext() = 0;
};
Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Fri May 18, 2007 6:31 am    Post subject: Re: C++ class iterator - How use ? Reply with quote



"Jim Davis" <jim46dd (AT) hotmail (DOT) com> wrote in message
news:Xns9933BA6F21BACjim46ddhotmailcom (AT) 207 (DOT) 105.83.66...

Quote:
here is snip from imported header :

Please show more of the Iterator class declaration. At the very
least, you need to show the constructor. I am assuming that it takes
a ID3_Tag as a parameter, so that it knows which tag to operate on.
In which case, the syntax will be similar to the following:

ID3_Tag tag(...whatever...);
ID3_Tag::Iterator iter(tag);
ID3_Frame frame = iter.GetNext();


Gambit
Back to top
Alan Bellingham
Guest





PostPosted: Fri May 18, 2007 2:06 pm    Post subject: Re: C++ class iterator - How use ? Reply with quote



Jim Davis <jim46dd (AT) hotmail (DOT) com> wrote:

Quote:
I want to use an imported C++ class iterator
GetNext() ,
but I don't have the correct syntax ,
and I get BCB6 compile errors .

Any help coding this appreciated ;
here is snip from imported header :

class ID3_CPP_EXPORT ID3_Tag
{
public:
class Iterator
{
public:
virtual ID3_Frame* GetNext() = 0;
};

The first question has to be - how has ID3_CPP_EXPORT been defined?

Alan Bellingham
--
ACCU Conference 2008: 2-5 April 2008 - Oxford (probably), UK
Back to top
Jim Davis
Guest





PostPosted: Sat May 19, 2007 8:10 am    Post subject: Re: C++ class iterator - How use ? Reply with quote

Quote:
you need to show the constructor.
Iterator* CreateIterator();

ConstIterator* CreateIterator() const;

Quote:
I am assuming that it takes a ID3_Tag as a parameter
In which case, the syntax will be similar to the following:
ID3_Tag tag(...whatever...);
ID3_Tag::Iterator iter(tag);
ID3_Frame frame = iter.GetNext();

//---- this syntax compiles in BCB6 -------------
ObjectDad* ODad ;
ObjectSon* OSon ;
ObjectDad::Iterator* ODadIter = ODad->CreateIterator() ;
OSon = ODadIter->GetNext(); // W8060 Possibly incorrect assign - const???
if(NULL == OSon) ...
Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Sun May 20, 2007 12:54 am    Post subject: Re: C++ class iterator - How use ? Reply with quote

"Jim Davis" <jim46dd (AT) hotmail (DOT) com> wrote in message
news:Xns99357F941594jim46ddhotmailcom (AT) 207 (DOT) 105.83.66...

Quote:
Iterator* CreateIterator();
ConstIterator* CreateIterator() const;

Are those members of the ID3_Tag class itself?

Quote:
//---- this syntax compiles in BCB6 -------------

That is not the class you showed earlier.

Quote:
OSon = ODadIter->GetNext(); // W8060 Possibly incorrect assign -
const???


You did not show the delaration of GetNext().


Gambit
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Language C++) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.