Welcome to DataBase++ ver 2.02 ! -------------------------------- This file contains information pertaining to installing, compiling and using DataBase++. Please read it in it's entirety before using DataBase++. IMPORTANT! THE DEMO VERSION ALLOWS NO MORE THAN 20 RECORDS IN ANY .DBF FILE. TO REGISTER DATABASE++, SEE SECTION 9. TABLE OF CONTENTS ----------------- 1. Contents 2. Installation 3. Overview 4. Compiling 5. Rebuilding DataBase++ 6. Building the Database++ DLL 7. Index File Information 8. Class Information 9. Ordering Information 10. Disclaimer 1. CONTENTS ------------ Several files are included with DataBase++. A listing of these files along with a brief description are as follows: FILE PUPRPOSE ---- -------- CLASSES.TXT Class documentation. DBPPDATA.H Declarations for class DBDatabase. DBPPDATA.CPP DBDatabase class definitions. README.TXT You are reading it! DBPPLIB.IDE Project file to build DataBase++ into LIB form. DBPPDLL.IDE Project file to build DataBase++ into DLL form. DBPP202.LIB DataBase++ library compiled for the DOS large memory model. DBPPSTRU.H Declarations for class DBStructure. DBPPSTRU.CPP Definitions for class DBStructure. DBPPINDX.H Declarations for class DBIndex. DBPPINDX.CPP Definitions for class DBIndex. EXAMPLE*.CPP Examples. EXAMPLE.IDE Project file to build all examples. 2. INSTALLATION ---------------- To install DataBase++, make a directory on your system's hard disk and copy the entire contents of the DataBase++ disk. The path where the DataBase++ header files will be stored should be added to your compiler configuration files, make files and project files that will be used with DataBase++. The path where the DataBase++ library files will be stored should likewise be added to the appropriate configuration files, make files and project files. 3. OVERVIEW ----------- DataBase++ is a set of C++ classes designed to work in conjunction with Sequiter Software's CodeBase 5.x database library for C. DataBase++ 2.02 was compiled with Borland C++ 4.5. It is designed to virtually remove the programmer from having to directly interface with CodeBase 5.x. No CodeBase initialization statements are required and in most programming cases, DataBase++ will handle every aspect of your program without resorting to direct CodeBase interaction. Access methods in DataBase++ provide the programmer with pointers to the CODEBASE and D4DATA structures if the programmer wants direct CodeBase access. DataBase++ was created by my own desire to use CodeBase in a higher level and in a totally Object Oriented manner. I wanted to have an Object represent a database file and be able to send messages to that object instead of having to handle database's in the traditional way. After looking at CodeBase++ and not being satisfied with it, I created DataBase++. There are quite a few advantages of using DataBase++. Below are just a few: - Completely upgraded to be compatable with CodeBase 5.x. - No need to initialize CodeBase. - No CodeBase structure references to manage. - One DataBase object per file for easy management. - Multi user friendly. - No need to manually unlock CodeBase index's after moving the record pointer in a multi-user environment. This is a CodeBase requirement and is handled automatically by DataBase++. - Supports all file formats that CodeBase does. - Easy creation of database and index files. - No cryptic function names. Use method names you are already familiar with like skip(), append(), goTo(), etc... 4. COMPILING ------------ There are several things to note when compiling your application with DataBase++. First, you MUST use all the switches you would normally use when compiling a CodeBase app. See your CodeBase manual for compile time switches. Second, CodeBase provides for combined index file emulation for Clipper .NTX and dBASE .NDX index files. This is done by CodeBase creating .CGP files which contain information on which index files are associated with the given data file. If you want to use this capability with DatBase++, you must define INDEX_GROUPS in addition to the CodeBase compile time switches when compiling your app. Otherwise normal index files will be created and used. If using Foxpro .CDX index files, make sure that INDEX_GROUPS IS NOT defined. See CLASSES.TXT under the section for class DBIndexTag for more details. The name of the DataBase++ library file for the large memory model is dbpp202.LIB. The examples below use DBASE.LIB, c4FOX.LIB and c4CLIP.LIB for reference the the CodeBase libraries. Your CodeBase library files may be named differently. Check with your CodeBase documentation. Examples using the Borland C++ compile: For dBASE using .NDX index files, no combined indexes: bcc -ml -DS4NDX yourfile.cpp c4dbase.lib dbpp202.lib emu.lib mathl.lib cl.lib For dBASE using .NDX index files with combined index emulation: bcc -ml -DS4NDX;INDEX_GROUPS yourfile.cpp c4dbase.lib dbpp202.lib emu.lib mathl.lib cl.lib For Foxpro using .CDX index files: bcc -ml -DS4FOX yourfile.cpp c4fox.lib dbpp202.lib emu.lib mathl.lib cl.lib For Clipper .NTX files, no combined indexes: bcc -ml -DS4CLIPPER yourfile.cpp c4clip.lib dbpp202.lib emu.lib mathl.lib cl.lib For Clipper .NTX files with combined index emulation: bcc -ml -DS4CLIPPER;INDEX_GROUPS yourfile.cpp c4clip.lib dbpp202.lib emu.lib mathl.lib cl.lib Notice that emu.lib and mathl.lib are included. If your app. will run on a machine that has a floating point processor, substitute them with the appropriate libraries. CodeBase requires floating point functions. There are several example files included (example*.cpp) and a Borland C++ 4.5 project file which will construct them. You may need to change paths in the project to fit your own paths and possibly change the name of the CodeBase library you are using. 5. REBUILDING DATABASE++ ------------------------- DataBase++ can be rebuilt using the supplied DBPPLIB.IDE project file if you are using Borland C++. Otherwise, DataBase++ can be rebuilt by creating a make file or suitable project file which includes all DBPP*.CPP files. 6. BUILDING THE DATABASE++ DLL ------------------------------- DataBase++ can be built to produce a Windows 16-bit DLL by using the supplied DBPPDLL.IDE project file if you are using Borland C++. All the DataBase++ source is compatable to reside in DLL form. The file DBPP202.DEF is the module definition file. Note that producing the DLL named DBPP202.DLL will yield an import library named DBPP202.LIB. 7. INDEX FILE INFORMATION ------------------------- DataBase++ supports all index file types that CodeBase does. You must be sure to compile your app. with the proper S4 type switches for proper index file operation. If you purchase DataBase++, you will be able to compile the source code for DataBase++ and create your own libraries. If you do, you must also be sure to use the same S4 switches when compiling DataBase++. The S4 switches are as follows: S4FOX - FoxPro .CDX files. S4NDX - dBASE III .NDX files. S4CLIPPER - Clipper .NTX files. There are more switch combinations for CodeBase. See your CodeBase manual for more information. If you purchase DataBase++ and are not using FoxPro .CDX file formats, you may compile DataBase++ and your app. with the INDEX_GROUPS compile switch to give your app. combined index emulation. This will create a .CGP file for each database file, which lists all your index files for that .DBF. When you open your database file with the open() method and you are using combined index file emulation or are using FoxPro .CDX formats, all index files are automatically opened with the database file. See your CodeBase documentation for more information on .CGP combined index emulation. Opening and selecting index files: If you are using an index file format which utilizes combined index file emulation, the index files are opened with the database. Therefore, selecting an index requires only that you call the setIndexTag() method. NOTE: The DBDatabase::openIndex() method is pre-processed out if you are using combined index file emulation. Example: db.open(); db.setIndexTag( "name" ); If you are NOT using an index file format which utilizes combined index file emulation, the index files MUST be opened before you attempt to select them. Failure to do so will yield a CodeBase error. You use the openIndex() method to open the index files. There is no need to specify an index file extension when calling openIndex() as CodeBase will know which default index file extension is used by the compile time switched you use and which CodeBase library you are linking in. Selecting an index is still accomplished with the setIndexTag() method. The last index file to be opened is the currently selected index. Example: db.open(); db.openIndex( "name" ); // Open it. db.setIndexTag( "name" ); // Select it. 8. CLASS INFORMATION -------------------- DataBase++ consists of several classes organized under one base class. Below is a diagram of the class heirarchy. More detailed information on class methods may be found in the file CLASSES.TXT: DBObject // Parent class. DBDatabase // Database class. DBIndex // Represent an index. DBIndexTag // Contains a DBArray of DBIndex's. DBField // Represent a database field. DBStructure // Contains a DBArray of DBField's. DBArray // Array type of DBObject pointers. DBObject: Parent class for all classes in DataBase++. At this time, it essentially does nothing. It's main purpose is to provide a common root for the DBArray class. It should be noted that utilizing templates in a compiler such as Borland C++ 3.0 or above would make storing object pointers of differing types a bit easier, but I can't plan on everyone having a compiler that supports them. DataBase++ was written in Borland C++ 4.0; and the original versions did use templates. DBIndex: Represents an index structure. This is really a structure that contains fields to hold the index tag name and expression. DBIndexTag: Comprised of a DBArray of DBIndex pointers, this class is responsible for creation and manipulation of a set of indexes for a given data file. DBIndex object pointers are added by the addTag() method. DBField: Represents a database field. This is really a structure that contains fields for name, type, length and decimals. DBStructure: Comprised of a DBArray of DBField object pointers, this class is responsible for the creation of a database structure. DBField pointers are added by the addField() method. DBArray: Stores DBObject pointers. 9. ORDERING INFORMATION ----------------------- DataBase++ 2.02 is considered ShareWare. If you find these classes useful, please support its continuation by registering. Upon registration, you will receive all source code for DataBase++ 2.02. DataBase++ is available for a fee of $45.00, which includes the cost of shipping within the US. For that amount, you will receive all source code and can alter that code for your own purposes. Send orders to: Jeff Stapleton 15 Hampton Rd. Montgomery, IL 60538 or contact me on Compuserve at 102654,1031 Please specify that you are ordering DataBase++ ver. 2.02 when ordering. 10. DISCLAIMER ------------- DataBase++ is sold with no warrantee, either expressed or implied. The author assumes no responsibility for any damage caused as a result of using this product. CodeBase and CodeBase 5.x are registered trademarks of Sequiter Software. Borland C++ is a registered trademark of Borland International. // eof README.TXT