Initial
This commit is contained in:
116
ftp/INTERPRT.HPP
Normal file
116
ftp/INTERPRT.HPP
Normal file
@@ -0,0 +1,116 @@
|
||||
#ifndef _FTP_INTERPRETER_HPP_
|
||||
#define _FTP_INTERPRETER_HPP_
|
||||
#ifndef _COMMON_STRING_HPP_
|
||||
#include <common/string.hpp>
|
||||
#endif
|
||||
#ifndef _DISPLAY_EDITWINDOW_HPP_
|
||||
#include <display/editwnd.hpp>
|
||||
#endif
|
||||
#ifndef _PARSE_TABLE_HPP_
|
||||
#include <parse/table.hpp>
|
||||
#endif
|
||||
#ifndef _PARSE_SCAN_HPP_
|
||||
#include <parse/scan.hpp>
|
||||
#endif
|
||||
#ifndef _PARSE_PARSE_HPP_
|
||||
#include <parse/parse.hpp>
|
||||
#endif
|
||||
#ifndef _PARSE_ASSEMBLER_HPP_
|
||||
#include <parse/assemble.hpp>
|
||||
#endif
|
||||
#ifndef _FTP_FTPCLIENT_HPP_
|
||||
#include <ftp/ftp.hpp>
|
||||
#endif
|
||||
#ifndef _FTP_RESINC_HPP_
|
||||
#include <ftp/resinc.hpp>
|
||||
#endif
|
||||
#ifndef _THREAD_MONITOR_HPP_
|
||||
#include <thread/monitor.hpp>
|
||||
#endif
|
||||
|
||||
class FTPInterpreter : private FTPClient, private Assembler
|
||||
{
|
||||
public:
|
||||
FTPInterpreter(void);
|
||||
virtual ~FTPInterpreter();
|
||||
void interpretFile(const String &pathFileName);
|
||||
void interpretLine(const String &lineString);
|
||||
void setDisplay(Monitor<EditWindow> &editMonitor);
|
||||
protected:
|
||||
virtual void message(const String &lineString);
|
||||
virtual void message(Block<String> &lineStrings);
|
||||
private:
|
||||
void setText(const String &lineString);
|
||||
void setText(Block<String> &lineStrings);
|
||||
void symbolLoad(void);
|
||||
void interpret(FileMap &srcMap);
|
||||
void appendHandler(const String &localPathFileName,const String &remotePathFileName);
|
||||
void remotehelpHandler(const String &remoteHelpTopic);
|
||||
void literalHandler(const String &literalString);
|
||||
void mdeleteHandler(const String ¶mString);
|
||||
void deleteHandler(const String &pathFileName);
|
||||
void openHandler(const String &hostName);
|
||||
void openHandler(const String &hostName,const String &userName,const String &password);
|
||||
void dirHandler(const String ¶mString);
|
||||
void lsHandler(const String ¶mString);
|
||||
void mdirHandler(const String &pathDirectory);
|
||||
void putHandler(const String &pathFileName);
|
||||
void sendHandler(const String &pathFileName);
|
||||
void typeHandler(const String ¶mString);
|
||||
void getHandler(const String &pathFileName);
|
||||
void mgetHandler(const String ¶mString);
|
||||
void mkdirHandler(const String &pathDirectory);
|
||||
void mlsHandler(const String &pathDirectory);
|
||||
void quoteHandler(const String &commandString);
|
||||
void recvHandler(const String &pathFileName);
|
||||
void userHandler(const String &userInfo);
|
||||
void cdHandler(const String &pathDirectory);
|
||||
void mputHandler(const String &pathFileName);
|
||||
void renameHandler(const String &oldPathFileName,const String &newPathFileName);
|
||||
void lcdHandler(const String &pathDirectory);
|
||||
void rmdirHandler(const String &pathDirectory);
|
||||
void disconnectHandler(void);
|
||||
void asciiHandler(void);
|
||||
void debugHandler(void);
|
||||
void promptHandler(void);
|
||||
void pwdHandler(void);
|
||||
void quitHandler(void);
|
||||
void statusHandler(void);
|
||||
void traceHandler(void);
|
||||
void bellHandler(void);
|
||||
void binaryHandler(void);
|
||||
void byeHandler(void);
|
||||
void globHandler(void);
|
||||
void hashHandler(void);
|
||||
void verboseHandler(void);
|
||||
void helpHandler(void);
|
||||
void closeHandler(void);
|
||||
String mNotConnected;
|
||||
String mNotLoggedIn;
|
||||
Monitor<EditWindow> *mlpEditMonitor;
|
||||
Table mSymbolTable;
|
||||
};
|
||||
|
||||
inline
|
||||
FTPInterpreter::~FTPInterpreter()
|
||||
{
|
||||
}
|
||||
|
||||
inline
|
||||
void FTPInterpreter::setDisplay(Monitor<EditWindow> &editMonitor)
|
||||
{
|
||||
mlpEditMonitor=&editMonitor;
|
||||
mlpEditMonitor->enter();
|
||||
(*mlpEditMonitor)->setText(STRING_VERSIONMSG);
|
||||
mlpEditMonitor->leave();
|
||||
}
|
||||
|
||||
inline
|
||||
void FTPInterpreter::setText(const String &lineString)
|
||||
{
|
||||
if(!mlpEditMonitor)return;
|
||||
mlpEditMonitor->enter();
|
||||
(*mlpEditMonitor)->setText(lineString);
|
||||
mlpEditMonitor->leave();
|
||||
}
|
||||
#endif
|
||||
Reference in New Issue
Block a user