#include <Console.h>
Inheritance diagram for clawsoft::Console:
Public Methods | |
Console () | |
Default constructor, this will set the standard output TextOutput to stdout,. | |
~Console () | |
If you didnt changed the output and error TextOuputs then this destructor will clear the references to out and err. | |
void | setOutput (TextOutput *to=0) |
This will reset the standard output to stdout by default or to to. | |
void | setInput (TextInput *ti=0) |
This will reset the standard input to stdin by default or to ti. | |
void | setErrorOutput (TextOutput *te=0) |
This will reset the standard error to stderr by default or to te. | |
void | outWrite (const void *buf, Uint32 siz) |
this will write siz bytes of buf buffer to the current out TextOutput | |
void | outWrite (const String &text) |
This will write the contents of text to the current out TextOutput. | |
void | outWriteLine (const void *buf, Uint32 siz) |
this will write siz bytes of buf buffer to the current out TextOutput plus a newline character | |
void | outWriteLine (const String &text) |
This will write the contents of text to the current out TextOutput plus a newline. | |
void | errWrite (const void *buf, Uint32 siz) |
this will write siz bytes of buf buffer to the current err TextOutput | |
void | errWrite (const String &text) |
This will write the contents of text to the current err TextOutput. | |
void | errWriteLine (const void *buf, Uint32 siz) |
this will write siz bytes of buf buffer to the current err TextOutput plus a newline character | |
void | errWriteLine (const String &text) |
This will write the contents of text to the current err TextOutput plus a newline. | |
void | read (void *buf, Uint32 size) |
This will read size bytes from the current in and will store them on buf. | |
void | readLine (String &line) |
This will read a line of text, a line is a string terminated by \n or \0 the result will be stored on line. | |
void | getKernelInfo () |
This method will update the name and information about the current running kernel. | |
const char * | getUnixName () |
Use this method to retreives the name of the UNIX version you are currently using. | |
const char * | getNodeName () |
This method will give you the nodename of your current host machine. | |
const char * | getKernelRelease () |
This will return your current kernel release string. | |
const char * | getKernelReleaseVersion () |
This will return your current kernel release version string. | |
const char * | getHostMachine () |
This will return your current architecture description. | |
const char * | getClassName () |
Returns the name of the current class. | |
Static Public Methods | |
int | getuid () |
Obtains the current (running) user id. | |
int | getuid (const String &username) |
Obtain uid from username. | |
int | getgid () |
Obtains the current (running) user id. | |
int | getgid (const String &groupname) |
Obtain uid from username. | |
int | chown (const String &fname, int userid, int groupid=-1) |
Changes the owner of the file by its numeric userid. | |
int | chown (const String &fname, const String &owner) |
Changes the owner of the file by its username. | |
int | chgrp (const String &fname, int userid) |
Changes the group owner of the file by its numeric userid. | |
int | chgrp (const String &fname, const String &groupname) |
Changes the group owner of the file by its groupname. | |
int | installedCPUs () |
This will return how many CPUs are installed in the system. | |
double | cpuSpeed () |
This will return the CPU speed in megahertz. | |
int | totalMemory () |
Will return the total amount of system memory. | |
int | freeMemory () |
Will return the total amount of free system memory. | |
void | usleep (Uint32 usec) |
Will freeze the software for usec microseconds. | |
Protected Methods | |
void | setClassName (const char *n) |
Call this method when you need to set the name of the class you're creating, typically in it's constructor, remember that you must set the classname for every class you create, that way you can have more information while debugging. | |
Protected Attributes | |
TextOutput * | err |
This will represent the stderr. | |
TextOutput * | out |
This will represent the stdout. | |
TextInput * | in |
This will represent the stdin. | |
bool | using_builtin_out |
This flag will say if you are using the builtin TextOutput object or a user-defined one for stdout. | |
bool | using_builtin_err |
This flag will say if you are using the builtin TextOutput object or a user-defined one for stderr. | |
bool | using_builtin_in |
This flag will say if you are using the builtin TextInput object or a user-defined one for stdin. | |
char * | sysname |
Pointer to system name. |
|
Default constructor, this will set the standard output TextOutput to stdout,. standard error TextOutput to stderr |
|
If you didnt changed the output and error TextOuputs then this destructor will clear the references to out and err.
|
|
Changes the group owner of the file by its groupname.
|
|
Changes the group owner of the file by its numeric userid.
|
|
Changes the owner of the file by its username.
|
|
Changes the owner of the file by its numeric userid.
|
|
This will return the CPU speed in megahertz.
|
|
This will write the contents of text to the current err TextOutput.
|
|
this will write siz bytes of buf buffer to the current err TextOutput
|
|
This will write the contents of text to the current err TextOutput plus a newline.
|
|
this will write siz bytes of buf buffer to the current err TextOutput plus a newline character
|
|
Will return the total amount of free system memory.
|
|
Returns the name of the current class.
|
|
Obtain uid from username.
|
|
Obtains the current (running) user id.
|
|
This will return your current architecture description.
|
|
This method will update the name and information about the current running kernel.
|
|
This will return your current kernel release string.
|
|
This will return your current kernel release version string.
|
|
This method will give you the nodename of your current host machine.
|
|
Obtain uid from username.
|
|
Obtains the current (running) user id.
|
|
Use this method to retreives the name of the UNIX version you are currently using.
|
|
This will return how many CPUs are installed in the system.
|
|
This will write the contents of text to the current out TextOutput.
|
|
this will write siz bytes of buf buffer to the current out TextOutput
|
|
This will write the contents of text to the current out TextOutput plus a newline.
|
|
this will write siz bytes of buf buffer to the current out TextOutput plus a newline character
|
|
This will read size bytes from the current in and will store them on buf.
|
|
This will read a line of text, a line is a string terminated by \n or \0 the result will be stored on line.
|
|
Call this method when you need to set the name of the class you're creating, typically in it's constructor, remember that you must set the classname for every class you create, that way you can have more information while debugging.
|
|
This will reset the standard error to stderr by default or to te.
|
|
This will reset the standard input to stdin by default or to ti.
|
|
This will reset the standard output to stdout by default or to to.
|
|
Will return the total amount of system memory.
|
|
Will freeze the software for usec microseconds.
|
|
This will represent the stderr.
|
|
This will represent the stdin.
|
|
This will represent the stdout.
|
|
Pointer to system name.
|
|
This flag will say if you are using the builtin TextOutput object or a user-defined one for stderr.
|
|
This flag will say if you are using the builtin TextInput object or a user-defined one for stdin.
|
|
This flag will say if you are using the builtin TextOutput object or a user-defined one for stdout.
|
Authors:
Juan V. Guerrero
Jannette C. Mejia
Juan C. Guevara
Powered by: