Files
Work/nntp/NEWSREG.HPP
2024-08-07 09:16:27 -04:00

69 lines
1.6 KiB
C++

#ifndef _NNTP_NEWSREG_HPP_
#define _NNTP_NEWSREG_HPP_
#ifndef _COMMON_STDIO_HPP_
#include <common/stdio.hpp>
#endif
#ifndef _COMMON_WINDOWS_HPP_
#include <common/windows.hpp>
#endif
#ifndef _COMMON_BLOCK_HPP_
#include <common/block.hpp>
#endif
#ifndef _COMMON_STRING_HPP_
#include <common/string.hpp>
#endif
#ifndef _NNTP_RESOURCE_HPP_
#include <nntp/resource.hpp>
#endif
#ifndef _NNTP_NEWSGROUP_HPP_
#include <nntp/newsgrp.hpp>
#endif
class NewsGroup;
class NewsReg
{
public:
enum QueryType{QueryActive,QueryAll};
NewsReg(void);
virtual ~NewsReg();
WORD queryGroups(Block<NewsGroup> &subscriberList,QueryType queryType=QueryAll);
WORD addGroup(const String &groupName,DWORD active=TRUE);
WORD addGroup(const NewsGroup &someNewsGroup);
WORD setGroup(const String &newsGroup,DWORD active);
WORD removeGroup(const String &groupName);
private:
NewsReg(const NewsReg &someNewsReg);
String mNewsGroupsKeyName;
String mNewsGroupsKeyValuePrefix;
String mApplicationKeyName;
String mNewsGroupsShortName;
};
inline
NewsReg::NewsReg(void)
: mNewsGroupsKeyValuePrefix(STRING_NEWSGROUPSKEYVALUEPREFIX),
mNewsGroupsKeyName(STRING_NEWSGROUPSKEYNAME),
mApplicationKeyName(STRING_NNTPKEYNAME),
mNewsGroupsShortName(STRING_NEWSGROUPSSHORTNAME)
{
}
inline
NewsReg::~NewsReg()
{
}
inline
NewsReg::NewsReg(const NewsReg &someNewsReg)
: mNewsGroupsKeyValuePrefix(STRING_NEWSGROUPSKEYVALUEPREFIX),
mNewsGroupsKeyName(STRING_NEWSGROUPSKEYNAME)
{ // no implementation
}
inline
WORD NewsReg::addGroup(const NewsGroup &someNewsGroup)
{
return addGroup(someNewsGroup.newsGroup(),someNewsGroup.active());
}
#endif