Main Page   Modules   Alphabetical List   Compound List   File List   Compound Members  

database Class Reference
[The database Class]

a simple abstraction layer to an xml database More...

#include <database.h>

List of all members.

Public Methods

 database ()
 contructor with empty parameters

 database (const QString qs_Location)
 contructor with a string param

 ~database ()
 destructor

QPtrVector< QString > search_software (const QString qs_String)
 searches for software matching the search term

QPtrVector< QString > search_class (const QString qs_String)
 searches for all classes that match the given term

QPtrVector< QString > get_software (const QString qs_Software)
 returns the information on a piece of software

QPtrVector< QString > get_class (const QString qs_Class)
 returns the various pieces of software for a given class

QPtrVector< QString > get_all_classes ()
 returns an array of all classes

QPtrVector< QString > get_all_software (QString qs_Class)
 returns an array of all pieces for the given course

bool update (const QString qs_Url)
 updates the xml database with one pulled from a server


Private Attributes

QDomDocument qdd_Xml
 needed crap for the xml stuffs


Detailed Description

a simple abstraction layer to an xml database

The database class allows for simple, easy, access to the xml database that stores information on various classes and the software that would nicely complement them.

Definition at line 16 of file database.h.


Constructor & Destructor Documentation

database::database  
 

contructor with empty parameters

If no params are passed, it will use the default locations for the xml, looking in ~/.class-soft/class.xml and then /etc/class-soft/class.xml

Definition at line 12 of file database.cpp.

References qdd_Xml.

database::database const QString    qs_Location
 

contructor with a string param

Parameters:
qs_Location  a QString containing the path to the database file you wish to load

Definition at line 52 of file database.cpp.

References qdd_Xml.

database::~database  
 

destructor

Really just here because it should be.

Definition at line 71 of file database.cpp.


Member Function Documentation

QPtrVector< QString > database::get_all_classes  
 

returns an array of all classes

Returned data will be of the form:

  • [0] = division + number of first course
  • .
  • .
  • .
  • [n] = last course

Definition at line 252 of file database.cpp.

References qdd_Xml.

Referenced by Listing::Listing().

QPtrVector< QString > database::get_all_software QString    qs_Class
 

returns an array of all pieces for the given course

Returned data will be of the form:

  • [0] = package name of first piece of software
  • .
  • .
  • .
  • [n] = last package
Parameters:
qs_Class  A QString containing the name of the class in the division + number form

Definition at line 279 of file database.cpp.

References qdd_Xml.

Referenced by Listing::Listing().

QPtrVector< QString > database::get_class const QString    qs_Class
 

returns the various pieces of software for a given class

Returned data will be of the form:

  • [0] = name of class
  • [1] = first piece of software
  • .
  • .
  • .
  • [n] = nth piece of software
Parameters:
qs_Class  a QString containing the class to show in the division + number form (eg CS180).

Definition at line 128 of file database.cpp.

References qdd_Xml.

Referenced by fShowClass(), and TextView::showInfo().

QPtrVector< QString > database::get_software const QString    qs_Software
 

returns the information on a piece of software

Returned data will be of the form:

  • [0] = name of package (eg. gnat)
  • [1] = nice name of software (eg. GNU ADA Compiler)
  • [2] = version
  • [3] = description
  • [4] = location of download
Parameters:
qs_Software  a QString containing the WHOLE of the package name to retrieve info for

Definition at line 76 of file database.cpp.

References qdd_Xml.

Referenced by fShowSoftware(), and TextView::showInfo().

QPtrVector< QString > database::search_class const QString    qs_String
 

searches for all classes that match the given term

search_class will return an array of string containing the course names (in the department number form) of all matching classes.

Parameters:
qs_String  a QString containing the string to search for. Note that should be a portion of the full name of the course (eg Foundations of Computer Science)

Definition at line 175 of file database.cpp.

References qdd_Xml.

Referenced by fSearchClass().

QPtrVector< QString > database::search_software const QString    qs_String
 

searches for software matching the search term

search_software will return an array of strings containing the name of all matching pieces of software

Parameters:
qs_String  a QString containing the string to search for. It should be a substring of the package name.

Definition at line 210 of file database.cpp.

References qdd_Xml.

Referenced by fSearchSoftware().

bool database::update const QString    qs_Url
 

updates the xml database with one pulled from a server

It will attempt to save the new file in /etc/class-soft/class.xml. If that fails it next tries ~/.class-soft/class.xml If anything doesn't work, false will be returned, otherwise true is.

Parameters:
qs_Url  a QString that should contain the URL of the xml file on a given server. It can be http:// ftp://

Definition at line 245 of file database.cpp.


The documentation for this class was generated from the following files:
Generated on Wed Feb 12 21:57:01 2003 for class-soft by doxygen1.2.16