# WOK
TKWOK
WOKNT

# WOKNT_Shell Class Reference

creates and manages processes

`#include <WOKNT_Shell.hxx>`

## Public Member Functions

Standard_EXPORT | WOKNT_Shell (const WOKNT_ExecutionMode anExecMode=WOKNT_SynchronousMode, const WOKNT_OutputMode anOutMode=WOKNT_OutErrMixed)
| creates a class instance
Standard_EXPORT void | Destroy ()
| destrouys all resources attached to the Shell
| ~WOKNT_Shell ()
Standard_EXPORT void | Launch ()
| launches a process
Standard_Boolean | IsLaunched () const
| checks whether a process launched or not
Standard_EXPORT void | Kill ()
| terminates a process
Standard_EXPORT void | Lock ()
Standard_EXPORT void | UnLock ()
Standard_Boolean | IsLocked () const
Standard_Integer | Status () const
| returns process's exit status
Standard_EXPORT Handle_TColStd_HSequenceOfHAsciiString | Errors ()
| returns process output
Standard_EXPORT void | ClearOutput ()
| clears process's output
Standard_EXPORT void | Send (const Handle(TCollection_HAsciiString)&aString)
| sends a string to the shell
Standard_EXPORT void | Execute (const Handle(TCollection_HAsciiString)&aCmdLine)
| executes a shell command
Standard_EXPORT Standard_Integer | SyncAndStatus ()
| waits for process termination and returns its exit status
Standard_EXPORT void | AddEnvironmentVariable (const Handle(TCollection_HAsciiString)&aName, const Handle(TCollection_HAsciiString)&aValue)
| adds environment variable to the shell's environment block
Standard_EXPORT void | RemoveEnvironmentVariable (const Handle(TCollection_HAsciiString)&aName)
| removes specified variable from the shell's environment block
Standard_EXPORT Handle_TCollection_HAsciiString | EnvironmentVariable (const Handle(TCollection_HAsciiString)&aName) const
| returns a value for a given environment variable Warning: returns a null string if specified variable does not exists
Standard_EXPORT void | Echo (const Handle(TCollection_HAsciiString)&aStr) const
| echoes a string
void | SetEcho ()
| turns echo on
void | UnsetEcho ()
| turns echo off
Standard_EXPORT void | Log (const Handle(TCollection_HAsciiString)&aStr) const
| logs a string to the file
Standard_EXPORT void | LogInFile (const Handle(WOKNT_Path)&aPath)
| creates log file and turns on logging to the file
Standard_EXPORT void | NoLog ()
| turns off logging to file
Standard_EXPORT const | Handle (Standard_Type)&DynamicType() const

## Protected Member Functions

Standard_EXPORT Standard_Boolean | BuiltInCommand (Handle(TCollection_HAsciiString)&aCmd, const Standard_Boolean doParse=Standard_True)
| checks whether a specified command built-in or not. Also provides primary parsing of the commend line ( extraction of the environment variables ).
Standard_EXPORT Standard_Address | BuildEnvironment (const Standard_Boolean aRebuildFlag=Standard_False)
| builds environment block for sub-process

## Private Attributes

WOKNT_OutputMode | myOutMode
WOKNT_ExecutionMode | myExecMode
Standard_Integer | myStatus
Standard_Boolean | myLocked
Standard_Boolean | myEcho
Standard_Boolean | myExeFlag
Standard_Boolean | myKillFlag
Standard_Address | myOutput
Standard_Integer | myProcess
Handle_TCollection_HAsciiString | myCmdLine
Handle_TColStd_HSequenceOfHAsciiString | myStdOut
Handle_TColStd_HSequenceOfHAsciiString | myStdErr
Handle_TColStd_HSequenceOfHAsciiString | myEnvironment
Standard_Integer | myChannel
Handle_TCollection_HAsciiString | myDirectory
Handle_WOKNT_Path | myLogFile

## Constructor & Destructor Documentation

Standard_EXPORT WOKNT_Shell::WOKNT_Shell | ( | const WOKNT_ExecutionMode | anExecMode = `WOKNT_SynchronousMode`,
|  | const WOKNT_OutputMode | anOutMode = `WOKNT_OutErrMixed`
| ) |

WOKNT_Shell::~WOKNT_Shell | ( |  | ) | `[inline]`

## Member Function Documentation

Standard_EXPORT void WOKNT_Shell::AddEnvironmentVariable | ( | const Handle(TCollection_HAsciiString)& | aName,
|  | const Handle(TCollection_HAsciiString)& | aValue
| ) |

Standard_EXPORT Standard_Address WOKNT_Shell::BuildEnvironment | ( | const Standard_Boolean | aRebuildFlag = `Standard_False` | ) | `[protected]`

Standard_EXPORT Standard_Boolean WOKNT_Shell::BuiltInCommand | ( | Handle(TCollection_HAsciiString)& | aCmd,
|  | const Standard_Boolean | doParse = `Standard_True`
| ) | `[protected]`

Standard_EXPORT void WOKNT_Shell::ClearOutput | ( |  | ) |

Standard_EXPORT void WOKNT_Shell::Destroy | ( |  | ) |

Standard_EXPORT void WOKNT_Shell::Echo | ( | const Handle(TCollection_HAsciiString)& | aStr | ) | const

Standard_EXPORT Handle_TCollection_HAsciiString WOKNT_Shell::EnvironmentVariable | ( | const Handle(TCollection_HAsciiString)& | aName | ) | const

Standard_EXPORT Handle_TColStd_HSequenceOfHAsciiString WOKNT_Shell::Errors | ( |  | ) |

Standard_EXPORT void WOKNT_Shell::Execute | ( | const Handle(TCollection_HAsciiString)& | aCmdLine | ) |

Standard_EXPORT const WOKNT_Shell::Handle | ( | Standard_Type |  | ) | const

Standard_Boolean WOKNT_Shell::IsLaunched | ( |  | ) | const`[inline]`

Standard_Boolean WOKNT_Shell::IsLocked | ( |  | ) | const`[inline]`

Standard_EXPORT void WOKNT_Shell::Kill | ( |  | ) |

Standard_EXPORT void WOKNT_Shell::Launch | ( |  | ) |

Standard_EXPORT void WOKNT_Shell::Lock | ( |  | ) |

Standard_EXPORT void WOKNT_Shell::Log | ( | const Handle(TCollection_HAsciiString)& | aStr | ) | const

Standard_EXPORT void WOKNT_Shell::LogInFile | ( | const Handle(WOKNT_Path)& | aPath | ) |

Standard_EXPORT void WOKNT_Shell::NoLog | ( |  | ) |

Standard_EXPORT void WOKNT_Shell::RemoveEnvironmentVariable | ( | const Handle(TCollection_HAsciiString)& | aName | ) |

Standard_EXPORT void WOKNT_Shell::Send | ( | const Handle(TCollection_HAsciiString)& | aString | ) |

void WOKNT_Shell::SetEcho | ( |  | ) | `[inline]`

Standard_Integer WOKNT_Shell::Status | ( |  | ) | const`[inline]`

Standard_EXPORT Standard_Integer WOKNT_Shell::SyncAndStatus | ( |  | ) |

Standard_EXPORT void WOKNT_Shell::UnLock | ( |  | ) |

void WOKNT_Shell::UnsetEcho | ( |  | ) | `[inline]`

## Field Documentation

Standard_Integer WOKNT_Shell::myChannel `[private]`

Handle_TCollection_HAsciiString WOKNT_Shell::myCmdLine `[private]`

Handle_TCollection_HAsciiString WOKNT_Shell::myDirectory `[private]`

Standard_Boolean WOKNT_Shell::myEcho `[private]`

Handle_TColStd_HSequenceOfHAsciiString WOKNT_Shell::myEnvironment `[private]`

WOKNT_ExecutionMode WOKNT_Shell::myExecMode `[private]`

Standard_Boolean WOKNT_Shell::myExeFlag `[private]`

Standard_Boolean WOKNT_Shell::myKillFlag `[private]`

Standard_Boolean WOKNT_Shell::myLocked `[private]`

Handle_WOKNT_Path WOKNT_Shell::myLogFile `[private]`

WOKNT_OutputMode WOKNT_Shell::myOutMode `[private]`

Standard_Address WOKNT_Shell::myOutput `[private]`

Standard_Integer WOKNT_Shell::myProcess `[private]`

Standard_Integer WOKNT_Shell::myStatus `[private]`

Handle_TColStd_HSequenceOfHAsciiString WOKNT_Shell::myStdErr `[private]`

Handle_TColStd_HSequenceOfHAsciiString WOKNT_Shell::myStdOut `[private]`

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

- WOKNT_Shell.hxx
- WOKNT_Shell.lxx