Files
Work/nntp/NEWSITEM.CPP
2024-08-07 09:16:27 -04:00

36 lines
1001 B
C++

#include <nntp/newsitem.hpp>
NewsItem &NewsItem::operator=(const String &pathFileName)
{
(Header&)*this=pathFileName;
this->pathFileName(pathFileName);
*this=(Header&)*this;
return *this;
}
NewsItem &NewsItem::operator=(const Header &someHeader)
{
String strName(subject());
char *ptrString;
String partString(subject().betweenString('(',')'));
if(partString.isNull())return *this;
ptrString=(LPSTR)partString;
ptrString=::strtok(ptrString,"/");
if(!ptrString)return *this;
part(::atoi(ptrString));
ptrString=::strtok(0,"\0");
if(!ptrString)return *this;
parts(::atoi(ptrString));
partString=subject();
ptrString=(LPSTR)partString+partString.length();
while(*ptrString!='('&&ptrString>(LPSTR)partString)ptrString--;
if(ptrString==(LPSTR)partString&&*ptrString!='(')return *this;
*(--ptrString)=0;
while(*ptrString!=' '&&ptrString>(LPSTR)partString)ptrString--;
if(ptrString==(LPSTR)partString&&*ptrString!=' ')return *this;
ptrString++;
name(ptrString);
return *this;
}