@@ -35,11 +35,14 @@ class PseudoTerminal {
3535
3636 // / Destructor
3737 // /
38- // / The destructor will close the primary and secondary file descriptors if
39- // / they are valid and ownership has not been released using one of: @li
40- // / PseudoTerminal::ReleasePrimaryFileDescriptor() @li
41- // / PseudoTerminal::ReleaseSaveFileDescriptor()
42- ~PseudoTerminal ();
38+ // / The destructor will close the primary and secondary file
39+ // / descriptor/HANDLEs if they are valid and ownership has not been released
40+ // / using PseudoTerminal::Close().
41+ virtual ~PseudoTerminal ();
42+
43+ // / Close all the file descriptors or Handles of the PseudoTerminal if they
44+ // / are valid.
45+ virtual void Close ();
4346
4447 // / Close the primary file descriptor if it is valid.
4548 void ClosePrimaryFileDescriptor ();
@@ -59,8 +62,7 @@ class PseudoTerminal {
5962 // /
6063 // / This class will close the file descriptors for the primary/secondary when
6164 // / the destructor is called. The file handles can be released using either:
62- // / @li PseudoTerminal::ReleasePrimaryFileDescriptor() @li
63- // / PseudoTerminal::ReleaseSaveFileDescriptor()
65+ // / @li PseudoTerminal::ReleasePrimaryFileDescriptor()
6466 // /
6567 // / \return
6668 // / \b Parent process: a child process ID that is greater
@@ -82,6 +84,16 @@ class PseudoTerminal {
8284 // / \see PseudoTerminal::ReleasePrimaryFileDescriptor()
8385 int GetPrimaryFileDescriptor () const ;
8486
87+ // / The primary HANDLE accessor.
88+ // /
89+ // / This object retains ownership of the primary HANDLE when this
90+ // / accessor is used.
91+ // /
92+ // / \return
93+ // / The primary HANDLE, or INVALID_HANDLE_VALUE if the primary HANDLE is
94+ // / not currently valid.
95+ virtual void *GetPrimaryHandle () const { return ((void *)(long long )-1 ); };
96+
8597 // / The secondary file descriptor accessor.
8698 // /
8799 // / This object retains ownership of the secondary file descriptor when this
@@ -96,6 +108,8 @@ class PseudoTerminal {
96108 // / \see PseudoTerminal::ReleaseSecondaryFileDescriptor()
97109 int GetSecondaryFileDescriptor () const ;
98110
111+ virtual void *GetSecondaryHandle () const { return ((void *)(long long )-1 ); };
112+
99113 // / Get the name of the secondary pseudo terminal.
100114 // /
101115 // / A primary pseudo terminal should already be valid prior to
@@ -105,7 +119,17 @@ class PseudoTerminal {
105119 // / The name of the secondary pseudo terminal.
106120 // /
107121 // / \see PseudoTerminal::OpenFirstAvailablePrimary()
108- std::string GetSecondaryName () const ;
122+ virtual std::string GetSecondaryName () const ;
123+
124+ // / The underlying Windows Pseudo Terminal HANDLE's accessor.
125+ // /
126+ // / This object retains ownership of the ConPTY's HANDLE when this
127+ // / accessor is used.
128+ // /
129+ // / \return
130+ // / The primary HANDLE, or INVALID_HANDLE_VALUE if the primary HANDLE is
131+ // / not currently valid.
132+ virtual void *GetPseudoTerminalHandle () { return ((void *)(long long )-1 ); };
109133
110134 // / Open the first available pseudo terminal.
111135 // /
@@ -126,7 +150,7 @@ class PseudoTerminal {
126150 // /
127151 // / \see PseudoTerminal::GetPrimaryFileDescriptor() @see
128152 // / PseudoTerminal::ReleasePrimaryFileDescriptor()
129- llvm::Error OpenFirstAvailablePrimary (int oflag);
153+ virtual llvm::Error OpenFirstAvailablePrimary (int oflag);
130154
131155 // / Open the secondary for the current primary pseudo terminal.
132156 // /
0 commit comments