UltraLite User's Guide
Developing C++ API Applications
Building your UltraLite C++ application
The generator generates table classes from publications in the database, and query classes from any SQL statements added with the ul_add_statement stored procedure, writing the output to the following files:
filename.hpp This file contains the prototypes for the generated interface. You should inspect this file to determine the API you can use in your application.
filename.cpp This file contains the interface source. You do not need to look at this file.
filename.h This file contains internal definitions required by UltraLite. You do not need to look at this file.
Here, filename is the name supplied on the ulgen command line.
Whether you use queries in a project, publications, or a mix to define the classes in your application, you must generate all the code in a single run of the UltraLite generator.
To generate UltraLite code for a publication
Run the UltraLite generator specifying the publication name with the -u
command-line switch. For example:
ulgen -c "uid=dba;pwd=sql" -t c++ -u pubName -f filename
To generate UltraLite code for a UltraLite project
Run the UltraLite generator, specifying the project name with the -j
command-line switch. For example:
ulgen -c "uid=dba;pwd=sql" -t c++ -j projectname -f filename
To generate UltraLite code for both a project and a publication
Run the UltraLite generator, specifying the project name and the publication name. For example:
ulgen -c "uid=dba;pwd=sql" -t c++ -j projectname -u pubname -f filename
For more information on the UltraLite generator, see The UltraLite generator.