Logo Search packages:      
Sourcecode: afnix version File versions

afnix::Terminal Class Reference

#include <Terminal.hpp>

Inheritance diagram for afnix::Terminal:

afnix::InputTerm afnix::OutputTerm afnix::Input afnix::Output afnix::Stream afnix::Stream afnix::Transcoder afnix::Transcoder afnix::Object afnix::Object

List of all members.


Detailed Description

The Terminal class implements the functionnality of a terminal. The class holds one input stream and two output streams. The associated streams can be retreived by using the appropriate get method. By default the class works on a line reading basis. A primary and secondary prompt can be associated with it. When a call to readline is made, the terminal set the input streams with that line. The eol character is not returned.
Author:
amaury darsch

Definition at line 46 of file Terminal.hpp.


Public Types

enum  t_mode { OUTPUT, ERROR }
 the terminal mode type
enum  t_oper {
  ADD, SUB, MUL, DIV,
  UMN, EQL, NEQ, GEQ,
  LEQ, GTH, LTH
}
 the operator enumeration

Public Member Functions

virtual Objectapply (class Runnable *robj, class Nameset *nset, Object *object, class Vector *argv)
virtual Objectapply (class Runnable *robj, class Nameset *nset, Object *object, class Cons *args)
virtual Objectapply (class Runnable *robj, class Nameset *nset, const long quark, class Cons *args)
virtual Objectapply (class Runnable *robj, class Nameset *nset, class Cons *args)
Objectapply (Runnable *robj, Nameset *nset, const long quark, Vector *argv)
void bkchr (void)
 delete a character in backspace mode
virtual long buflen (void) const
virtual Objectcdef (class Runnable *robj, class Nameset *nset, const long quark, Object *object)
virtual Objectcdef (class Runnable *robj, class Nameset *nset, Object *object)
virtual bool chdel (void)
 delete one character in position
bool clear (void)
virtual Objectclone (void) const
virtual char * decode (const t_quad *s, const long size) const
virtual char * decode (const t_quad *s) const
virtual char decode (const t_quad c) const
virtual t_quad * encode (const char *s, const long size) const
virtual t_quad * encode (const char *s) const
virtual t_quad encode (const char c) const
void error (const String &value)
void errorln (const Exception &e)
void errorln (const String &line)
virtual Objecteval (class Runnable *robj, class Nameset *nset, const long quark)
virtual Objecteval (class Runnable *robj, class Nameset *nset)
virtual void flush (const t_quad value)
virtual void flush (const char value)
long getcols (void) const
virtual System::t_emod getemod (void) const
String getpp (void) const
int getsid (void) const
int getsid (void) const
String getsp (void) const
System::t_tmod gettmod (void) const
virtual void insert (const String &s)
 insert a string depending on the character mode /
virtual void insert (const t_quad *s)
virtual void insert (const char *s)
virtual void insert (const char c)
void insert (const t_quad c)
bool iseof (void) const
bool isquark (const long quark, const bool hflg) const
virtual bool issho (void) const
bool istty (void) const
bool istty (void) const
virtual bool isvalid (const t_quad c) const
virtual bool isvalid (const char c) const
void kachr (void)
 kill all characters in the buffer
void kbchr (void)
 kill all characters from the current position
virtual Objectmini (void) const
virtual void mksho (void)
 make this object shared
virtual bool moved (const long num)
virtual bool movel (const long num)
bool movel (void)
 move the cursor terminal to the left
virtual bool mover (const long num)
bool mover (void)
 move the cursor terminal to the right
virtual bool moveu (const long num)
void mvbol (const long pos, const long num)
bool mvbol (void)
 move to the beginning of line
void mveol (const long pos, const long num)
bool mveol (void)
 move to the end of line
void newline (void)
bool nocanon (void)
virtual Objectoper (t_oper type, Object *object)
void operator delete (void *handle)
void operator delete[] (void *handle)
void * operator new (const t_size size)
void * operator new[] (const t_size size)
Outputoperator<< (const long value)
Outputoperator<< (const String &value)
Outputoperator<< (const char value)
virtual void pushback (const String &value)
 pushback a string on this input stream
virtual void pushback (const char *s, const long size)
virtual void pushback (const char *s)
virtual void pushback (const char value)
virtual t_quad rbyte (void)
virtual void rdlock (void) const
 get a read lock for this object
virtual t_quad rduc (void)
virtual Bufferread (const long size)
char read (void)
String readline (bool pflag)
virtual String readln (void)
String repr (void) const
void restore (void)
 restore the terminal attribute
void rfrsh (void)
 refresh the terminal with the current editing
void rline (const String &line)
void rmchr (void)
 delete a character in place
virtual void rmsho (void)
 clean the shared structure
virtual t_quad rutf8 (void)
void save (void)
 save the terminal attributes
virtual void setemod (const String &mode)
virtual void setemod (const System::t_emod emod)
void seteofmap (const char c)
 set the ctrl-d remap character
void setigneof (const bool flag)
 set the ignore eof flag
void setim (void)
 toggle the terminal insert mode
void setpp (const String &value)
void setsp (const String &value)
void settmod (const System::t_tmod tmod)
void temode (const bool mode)
 Terminal (void)
 create a new default terminal
virtual void unlock (void) const
 unlock this object
bool valid (const long tout) const
virtual Objectvdef (class Runnable *robj, class Nameset *nset, const long quark, Object *object)
virtual Objectvdef (class Runnable *robj, class Nameset *nset, Object *object)
t_quad wread (void)
virtual void write (const String &value)
virtual void write (const t_quad *value, const long size)
virtual void write (const char *value, const long size)
virtual void write (const t_quad *value)
virtual void write (const t_quad value)
void write (const char *value)
void write (const char value)
void writeln (const String &line)
virtual void wrlock (void) const
 get a write lock for this object
 ~Terminal (void)
 destroy this terminal

Static Public Member Functions

static void cref (Object *object)
static void dref (Object *object)
static Objectiref (Object *object)
static bool isbs (const t_quad w)
static bool isdel (const t_quad w)
static bool isdo (const t_quad w)
static bool isins (const t_quad w)
static bool isle (const t_quad w)
static bool ispr (const t_quad w)
static bool isri (const t_quad w)
static bool isup (const t_quad w)
static bool iswide (const t_quad w)
static Objectmeval (Runnable *robj, Nameset *nset, const long quark)
static Objectmeval (Runnable *robj, Nameset *nset, const long quark)
static Objectmkerr (Vector *argv)
static Objectmknew (Vector *argv)
static Objectmkout (Vector *argv)
static class String repr (Object *object)
static void tref (Object *object)
static bool uref (Object *object)

Static Public Attributes

static const t_quad WIDE_BS = 0x80000000
static const t_quad WIDE_DEL = 0x80000001
static const t_quad WIDE_DO = 0x80000003
static const t_quad WIDE_INSCH = 0x80000006
static const t_quad WIDE_LE = 0x80000004
static const t_quad WIDE_RI = 0x80000005
static const t_quad WIDE_STDBL = 0x00000001
static const t_quad WIDE_STDBS = 0x00000008
 supported wide character code
static const t_quad WIDE_STDDE = 0x8000000b
static const t_quad WIDE_STDDO = 0x80000008
static const t_quad WIDE_STDEF = 0x00000004
static const t_quad WIDE_STDEL = 0x00000005
static const t_quad WIDE_STDIM = 0x00000009
static const t_quad WIDE_STDIN = 0x8000000c
static const t_quad WIDE_STDKB = 0x00000015
static const t_quad WIDE_STDKL = 0x0000000b
static const t_quad WIDE_STDLE = 0x80000009
static const t_quad WIDE_STDNL = 0x0000000a
static const t_quad WIDE_STDRF = 0x0000000c
static const t_quad WIDE_STDRI = 0x8000000a
static const t_quad WIDE_STDUP = 0x80000007
static const t_quad WIDE_UP = 0x80000002

Protected Attributes

Buffer d_buffer
 the local buffer
System::t_emod d_emod
 the encoding mode
System::t_emod d_emod
 the encoding mode
bool d_eof
 the eof flag
bool d_insert
 the insert mode flag
struct s_shared * p_shared
 the shared object structure

Private Member Functions

Terminaloperator= (const Terminal &)
 Terminal (const Terminal &)

Private Attributes

Cilo d_cilo
 the circular loop
Cursor d_lbuf
 the readline buffer
String d_prt1
 the primary prompt
String d_prt2
 the secondary prompt

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

Generated by  Doxygen 1.6.0   Back to index