ReactOS 0.4.15-dev-7918-g2a2556c
CShellCommandConnect Class Reference

#include <ShellCommandConnect.h>

Inheritance diagram for CShellCommandConnect:
Collaboration diagram for CShellCommandConnect:

Public Member Functions

 CShellCommandConnect (CRegistryTree &rTree)
 
virtual ~CShellCommandConnect ()
 
virtual BOOL Match (const TCHAR *pchCommand)
 
virtual int Execute (CConsole &rConsole, CArgumentParser &rArguments)
 
virtual const TCHARGetHelpString ()
 
virtual const TCHARGetHelpShortDescriptionString ()
 
- Public Member Functions inherited from CShellCommand
 CShellCommand ()
 
virtual ~CShellCommand ()
 
virtual BOOL Match (const TCHAR *pchCommand)=0
 
virtual int Execute (CConsole &rConsole, CArgumentParser &rArguments)=0
 
virtual const TCHARGetHelpString ()=0
 
virtual const TCHARGetHelpShortDescriptionString ()=0
 

Private Attributes

CRegistryTreem_rTree
 

Detailed Description

Definition at line 12 of file ShellCommandConnect.h.

Constructor & Destructor Documentation

◆ CShellCommandConnect()

CShellCommandConnect::CShellCommandConnect ( CRegistryTree rTree)

Definition at line 36 of file ShellCommandConnect.cpp.

36 :m_rTree(rTree)
37{
38}

◆ ~CShellCommandConnect()

CShellCommandConnect::~CShellCommandConnect ( )
virtual

Definition at line 40 of file ShellCommandConnect.cpp.

41{
42}

Member Function Documentation

◆ Execute()

int CShellCommandConnect::Execute ( CConsole rConsole,
CArgumentParser rArguments 
)
virtual

Implements CShellCommand.

Definition at line 49 of file ShellCommandConnect.cpp.

50{
51 const TCHAR *pchArg;
52 const TCHAR *pchMachine = NULL;
53 BOOL blnHelp = FALSE;
54
56
57 while ((pchArg = rArguments.GetNextArgument()) != NULL)
58 {
59 if ((_tcsicmp(pchArg,_T("/?")) == 0)
60 ||(_tcsicmp(pchArg,_T("-?")) == 0))
61 {
62 blnHelp = TRUE;
63 }
64// else if ((_tcsicmp(pchArg,_T("-a")) == 0)||
65// (_tcsicmp(pchArg,_T("/a")) == 0))
66// {
67// }
68 else
69 {
70 pchMachine = pchArg;
71 }
72 }
73
74 if (blnHelp)
75 rConsole.Write(GetHelpString());
76
77 if (!m_rTree.SetMachineName(pchMachine))
78 {
80 rConsole.Write(_T("\n"));
81 }
82
83 return 0;
84}
TCHAR * GetNextArgument()
BOOL Write(const TCHAR *p, DWORD dwChars=0)
Definition: Console.cpp:90
BOOL SetMachineName(LPCTSTR pszMachineName)
const TCHAR * GetLastErrorDescription()
BOOL ChangeCurrentKey(const TCHAR *pchRelativePath)
virtual const TCHAR * GetHelpString()
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
#define VERIFY(e)
Definition: ph.h:34
#define _T(x)
Definition: vfdio.h:22
char TCHAR
Definition: xmlstorage.h:189
#define _tcsicmp
Definition: xmlstorage.h:205

◆ GetHelpShortDescriptionString()

const TCHAR * CShellCommandConnect::GetHelpShortDescriptionString ( )
virtual

Implements CShellCommand.

Definition at line 99 of file ShellCommandConnect.cpp.

100{
102}
#define CONNECT_CMD_SHORT_DESC

◆ GetHelpString()

const TCHAR * CShellCommandConnect::GetHelpString ( )
virtual

Implements CShellCommand.

Definition at line 86 of file ShellCommandConnect.cpp.

87{
89// _T("Syntax: ") CONNECT_CMD _T(" [Switches] [/?] machine\n\n")
90 _T("Syntax: ") CONNECT_CMD _T(" /? | MACHINE\n\n")
91 _T(" /? - This help.\n\n")
92// _T("Switches are:\n")
93// _T(" -a anonymous login.\n")
94 _T(" MACHINE is name/ip of the remote machine.\n")
95 _T("Example:\n")
96 _T(" ") CONNECT_CMD _T(" BOB");
97}
#define CONNECT_CMD
int help
Definition: sort.c:20
GLdouble n
Definition: glext.h:7729
static const char machine[]
Definition: profile.c:104
Definition: dhcpd.h:62
Definition: name.c:39

Referenced by Execute().

◆ Match()

BOOL CShellCommandConnect::Match ( const TCHAR pchCommand)
virtual

Implements CShellCommand.

Definition at line 44 of file ShellCommandConnect.cpp.

45{
46 return _tcsicmp(pchCommand,CONNECT_CMD) == 0;
47}

Member Data Documentation

◆ m_rTree

CRegistryTree& CShellCommandConnect::m_rTree
private

Definition at line 22 of file ShellCommandConnect.h.

Referenced by Execute().


The documentation for this class was generated from the following files: