Ghidra Decompiler Analysis Engine
ifaceterm.hh
Go to the documentation of this file.
1 /* ###
2  * IP: GHIDRA
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
18 
19 #include "interface.hh"
20 
21 #ifdef __TERMINAL__
22 extern "C" {
23 #include <termios.h>
24 #include <errno.h>
25 }
26 #endif
27 
34 class IfaceTerm : public IfaceStatus {
35 #ifdef __TERMINAL__
36  bool is_terminal;
37  int4 ifd;
38  struct termios itty;
39 #endif
40  istream *sptr;
41  vector<istream *> inputstack;
42  int4 doCompletion(string &line,int4 cursor);
43  virtual void readLine(string &line);
44 public:
45  IfaceTerm(const string &prmpt,istream &is,ostream &os);
46  virtual ~IfaceTerm(void);
47  virtual void pushScript(const string &filename,const string &newprompt);
48  virtual void popScript(void);
49  virtual bool isStreamFinished(void) const;
50 };
IfaceTerm::popScript
virtual void popScript(void)
Return to processing the parent stream.
Definition: ifaceterm.cc:251
IfaceStatus
A generic console mode interface and command executor.
Definition: interface.hh:195
IfaceTerm::pushScript
virtual void pushScript(const string &filename, const string &newprompt)
Provide a new script file to execute, with an associated command prompt.
Definition: ifaceterm.cc:240
IfaceTerm::isStreamFinished
virtual bool isStreamFinished(void) const
Return true if the current stream is finished.
Definition: ifaceterm.cc:259
IfaceTerm::IfaceTerm
IfaceTerm(const string &prmpt, istream &is, ostream &os)
Constructor.
Definition: ifaceterm.cc:18
IfaceTerm
Implement the command-line interface on top of a specific input stream.
Definition: ifaceterm.hh:34
interface.hh
Classes and utilities for a generic command-line interface.