Initial
This commit is contained in:
47
yproxy/NNTPCommands.hpp
Normal file
47
yproxy/NNTPCommands.hpp
Normal file
@@ -0,0 +1,47 @@
|
||||
#ifndef _YPROXY_NNTPCOMMANDS_HPP_
|
||||
#define _YPROXY_NNTPCOMMANDS_HPP_
|
||||
#ifndef _COMMON_WINDOWS_HPP_
|
||||
#include <common/windows.hpp>
|
||||
#endif
|
||||
#ifndef _COMMON_STRING_HPP_
|
||||
#include <common/string.hpp>
|
||||
#endif
|
||||
#ifndef _COMMON_BLOCK_HPP_
|
||||
#include <common/block.hpp>
|
||||
#endif
|
||||
|
||||
class NNTPCommands
|
||||
{
|
||||
public:
|
||||
typedef enum NNTPCommand{Article,Body,Group,Head,Help,IHave,Last,List,NewGroups,NewNews,
|
||||
Next,Post,Quit,Slave,Stat,ListGroup,AuthInfoUser,AuthInfoPass,AuthInfo,ModeReader,XOver,InvalidCommand};
|
||||
static NNTPCommands &getInstance(void);
|
||||
NNTPCommand interpretCommand(const String &string);
|
||||
String toString(NNTPCommand command);
|
||||
private:
|
||||
NNTPCommands();
|
||||
virtual ~NNTPCommands();
|
||||
void buildCommands(void);
|
||||
|
||||
Block<String> mNNTPCmds;
|
||||
static NNTPCommands *smInstance;
|
||||
};
|
||||
|
||||
inline
|
||||
NNTPCommands::NNTPCommands()
|
||||
{
|
||||
buildCommands();
|
||||
}
|
||||
|
||||
inline
|
||||
NNTPCommands::~NNTPCommands()
|
||||
{
|
||||
}
|
||||
|
||||
inline
|
||||
NNTPCommands &NNTPCommands::getInstance()
|
||||
{
|
||||
if(0==smInstance)smInstance=::new NNTPCommands();
|
||||
return *smInstance;
|
||||
}
|
||||
#endif
|
||||
Reference in New Issue
Block a user