ReactOS  0.4.14-dev-50-g13bb5e2
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 ()
 

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 }
#define TRUE
Definition: types.h:120
BOOL SetMachineName(LPCTSTR pszMachineName)
#define _tcsicmp
Definition: xmlstorage.h:205
virtual const TCHAR * GetHelpString()
BOOL ChangeCurrentKey(const TCHAR *pchRelativePath)
unsigned int BOOL
Definition: ntddk_ex.h:94
TCHAR * GetNextArgument()
smooth NULL
Definition: ftsmooth.c:416
char TCHAR
Definition: xmlstorage.h:189
#define _T(x)
Definition: vfdio.h:22
#define VERIFY(e)
Definition: ph.h:34
const TCHAR * GetLastErrorDescription()
BOOL Write(const TCHAR *p, DWORD dwChars=0)
Definition: Console.cpp:90

◆ GetHelpShortDescriptionString()

const TCHAR * CShellCommandConnect::GetHelpShortDescriptionString ( )
virtual

Implements CShellCommand.

Definition at line 99 of file ShellCommandConnect.cpp.

100 {
101  return CONNECT_CMD_SHORT_DESC;
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 }
GLdouble n
Definition: glext.h:7729
#define CONNECT_CMD_SHORT_DESC
#define _T(x)
Definition: vfdio.h:22
Definition: dhcpd.h:61
static const char machine[]
Definition: profile.c:104
#define CONNECT_CMD
Definition: name.c:36
int help
Definition: sort.c:20

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 }
#define _tcsicmp
Definition: xmlstorage.h:205
#define CONNECT_CMD

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: