98 lines
1.9 KiB
C++
98 lines
1.9 KiB
C++
#ifndef _NNTP_GROUPITERATOR_HPP_
|
|
#define _NNTP_GROUPITERATOR_HPP_
|
|
#ifndef _COMMON_WINDOWS_HPP_
|
|
#include <common/windows.hpp>
|
|
#endif
|
|
#ifndef _NNTP_MESSAGEID_HPP_
|
|
#include <nntp/msgid.hpp>
|
|
#endif
|
|
|
|
class GroupIterator
|
|
{
|
|
public:
|
|
GroupIterator(void);
|
|
GroupIterator(const GroupIterator &someGroupIterator);
|
|
virtual ~GroupIterator();
|
|
GroupIterator &operator=(const GroupIterator &someGroupIterator);
|
|
GroupIterator &operator<<(String lineString);
|
|
const MsgID &messageID(void)const;
|
|
void messageID(const MsgID &messageID);
|
|
DWORD articleNumber(void)const;
|
|
void articleNumber(DWORD articleNumber);
|
|
String toString(void)const;
|
|
private:
|
|
MsgID mMessageID;
|
|
DWORD mArticleNumber;
|
|
};
|
|
|
|
inline
|
|
GroupIterator::GroupIterator(void)
|
|
: mArticleNumber(0)
|
|
{
|
|
}
|
|
|
|
inline
|
|
GroupIterator::GroupIterator(const GroupIterator &someGroupIterator)
|
|
{
|
|
*this=someGroupIterator;
|
|
}
|
|
|
|
inline
|
|
GroupIterator::~GroupIterator()
|
|
{
|
|
}
|
|
|
|
inline
|
|
GroupIterator &GroupIterator::operator=(const GroupIterator &someGroupIterator)
|
|
{
|
|
messageID(someGroupIterator.messageID());
|
|
articleNumber(someGroupIterator.articleNumber());
|
|
return *this;
|
|
}
|
|
|
|
inline
|
|
const MsgID &GroupIterator::messageID(void)const
|
|
{
|
|
return mMessageID;
|
|
}
|
|
|
|
inline
|
|
void GroupIterator::messageID(const MsgID &messageID)
|
|
{
|
|
mMessageID=messageID;
|
|
}
|
|
|
|
inline
|
|
DWORD GroupIterator::articleNumber(void)const
|
|
{
|
|
return mArticleNumber;
|
|
}
|
|
|
|
inline
|
|
void GroupIterator::articleNumber(DWORD articleNumber)
|
|
{
|
|
mArticleNumber=articleNumber;
|
|
}
|
|
|
|
inline
|
|
GroupIterator &GroupIterator::operator<<(String lineString)
|
|
{
|
|
char *strPtr=(LPSTR)lineString;
|
|
|
|
strPtr=::strtok(strPtr," ");
|
|
if(!strPtr)return *this;
|
|
strPtr=::strtok(0," ");
|
|
if(!strPtr)return *this;
|
|
articleNumber(::atoi(strPtr));
|
|
strPtr=::strtok(0," \0");
|
|
if(!strPtr)return *this;
|
|
messageID(strPtr);
|
|
return *this;
|
|
}
|
|
|
|
inline
|
|
String GroupIterator::toString(void)const
|
|
{
|
|
return String().fromInt(mArticleNumber)+String(" ")+mMessageID;
|
|
}
|
|
#endif |