#include <DBase.hpp>
Public Methods | |
DBase () | |
DBase (const char *cmd) | |
DBase (const char *id, const char *name, const char *tel) | |
DBase (JString &id, JString &name, JString &tel) | |
DBase (DBase &db) | |
DBase & | operator= (DBase &db) |
const bool | operator== (DBase &db) |
const bool | operator!= (DBase &db) |
const bool | operator< (DBase &db) |
const bool | operator> (DBase &db) |
const bool | CompareID (DBase &db) |
const char * | string () const |
const bool | valid () const |
void | DBase::display () const |
DBase () | |
DBase (int pos) | |
DBase (DBase &db) | |
DBase & | operator= (DBase &db) |
virtual | ~DBase () |
const bool | operator== (DBase &db) |
const bool | operator!= (DBase &db) |
const char * | string () const |
void | DBase::display () const |
int | pos () const |
int | valid () const |
Public Attributes | |
JString * | _id |
JString * | _name |
JString * | _tel |
Private Attributes | |
int | _pos |
Friends | |
ostream & | operator<< (ostream &os, DBase &db) |
ostream & | operator<< (ostream &os, DBase &db) |
|
|
|
Definition at line 18 of file DBase.cpp. 00019 { 00020 _id = new String( cmd, 3, 6 ); 00021 _name = new String( cmd, 13, 17 ); 00022 00023 if ( _name->parseInt() > 0 ) { // If it's a 2 parameters command 00024 _tel = _name; // with a phone number only. 00025 _name = new String( 17, ' ' ); 00026 00027 } else { 00028 _tel = new String( cmd, 32, 7 ); 00029 } 00030 00031 int l = _name->length(); 00032 l -= 17; 00033 00034 00035 if ( l < 0 ) { // Fill the rest of name with space 00036 int m = (-1 * l) + 2; 00037 _name->addChar( m, ' '); 00038 } 00039 } |
|
|
|
|
|
|
|
|
|
Definition at line 9 of file DBase.cpp. 00010 { 00011 if ( pos >= 0 ) { 00012 _pos = pos; 00013 } else { 00014 _pos = 0; 00015 } 00016 } |
|
|
|
Definition at line 19 of file DBase.hpp. 00019 { }; |
|
|
|
Definition at line 27 of file DBase.hpp. 00028 { // on the Screen. 00029 cout << string() << endl; 00030 } |
|
Definition at line 35 of file DBase.hpp. 00035 { 00036 cout << string() << endl; 00037 } |
|
|
|
|
|
Definition at line 98 of file DBase.cpp. 00098 { 00099 return ( *_id < *db._id ); 00100 } |
|
|
|
|
|
|
|
|
|
Definition at line 102 of file DBase.cpp. 00102 { 00103 return ( *_id > *db._id ); 00104 } |
|
Definition at line 36 of file DBase.hpp. Referenced by Parenth::read().
00036 { 00037 return _pos; 00038 } |
|
|
|
Definition at line 73 of file DBase.cpp. Referenced by DBase::display(), operator<<(), and BinNode::operator<<().
00073 { // return a char* result 00074 00075 String* result = new String(); // Give a formatted output 00076 00077 result->add(" "); 00078 result->add( _id->string() ); 00079 result->add(" "); 00080 result->add( _name->string() ); 00081 result->add(" "); 00082 result->add( _tel->string() ); 00083 result->add(" "); 00084 return result->string(); 00085 } |
|
Definition at line 40 of file DBase.hpp. 00040 { 00041 return ( _pos >= 0 ); 00042 } |
|
Definition at line 110 of file DBase.cpp. 00110 { 00111 if ( this == NULL ) { 00112 return FALSE; 00113 } else { 00114 return ( _id != NULL ) && ( _name != NULL ) && ( _tel != NULL ); 00115 } 00116 } |
|
Definition at line 32 of file DBase.hpp. 00032 { 00033 return os << db.string(); 00034 } |
|
Definition at line 39 of file DBase.hpp. 00039 { 00040 return os << db.string() << endl; 00041 } |
|
Definition at line 50 of file DBase.hpp. Referenced by CompareID(), DataBase::findID(), operator!=(), operator<(), operator=(), operator==(), and operator>().
|
|
Definition at line 51 of file DBase.hpp. Referenced by operator!=(), operator=(), operator==(), and DataBase::read().
|
|
|
|
Definition at line 52 of file DBase.hpp. Referenced by operator!=(), operator=(), operator==(), and DataBase::read().
|