Main Page | Class List | File List | Class Members | File Members

Database Class Reference

#include <database.h>

List of all members.


Detailed Description

Simple text-file based database for use in the demo_db application.

Definition at line 43 of file database.h.

Public Member Functions

void Load (string filename)
 Load a database-text file into memory.
string Find (string key)
 Find an item in the database and return its data.
void Clear ()
 Clear the Database in memory.
void Insert (string key, string data)
 Insert one database-item (key + data) into the DB_Map.


Member Function Documentation

void Database::Clear  ) 
 

Clear the Database in memory.

The DB_Map is erased. Definition at line 134 of file database.cpp.

string Database::Find string  key  ) 
 

Find an item in the database and return its data.

Whitespace at begin and end of key is ignored.

Parameters:
key string containing the key to search for
Returns:
string containing data stored with key; empty when key not found.
Definition at line 111 of file database.cpp.

void Database::Insert string  key,
string  data
 

Insert one database-item (key + data) into the DB_Map.

Expand any escape-strings. Replace "<ESC>" with the escape-code for the PCxx's (\x1b)

Parameters:
key 
data 
Definition at line 92 of file database.cpp.

void Database::Load string  filename  ) 
 

Load a database-text file into memory.

Multiple files can be loaded. Any duplicate entries are overwritten.

Parameters:
filename 
Returns:
Definition at line 24 of file database.cpp.


The documentation for this class was generated from the following files:
Generated on Thu Jun 16 15:47:18 for pc_demo.kdevelop by doxygen 1.3.8