This source file defines the class behaviors for the application.
More...
#include <unistd.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <signal.h>
#include <time.h>
#include "CGenDatabase.h"
Functions |
void | DisplayHelp (char *prgName) |
| This procedure displays the help screen and then exits the program.
|
void | HandleArgs (int argc, char *argv[]) |
| This procedure reads in the command line parameters and translates it to something the program can understand.
|
void | SigIntCtrl (int val) |
| This procedure is called when the user (or something else) generates an interrupt signal (CTRL-C, etc). It then tells the system to quit by changing the flag bShouldQuit to true.
|
void | SetupSignals () |
| This procedure sets up the signal handling routine for CTRL-C to use a user defined handler instead of the default one since we need to close the connections and files that are open during this time frame.
|
void | CleanSignals () |
| This procedure returns the CTRL-C handler back to it's default settings.
|
int | main (int argc, char *argv[]) |
| This procedure performs the tasks that were specified on the command line.
|
Variables |
bool | bShouldQuit = false |
| This variable is used to allow the program to quit everything, and still perform wrap-up procedures.
|
char | DestDir [1024] |
| This is the destination directory for the source files that are being created.
|
char | SpecDB [1024] |
| This is the Database that is specified on the command line.
|
char | SpecTable [1024] |
| This is the Table that is specified on the command line.
|
char | Host [1024] |
| This is the host that has mysql running on it.
|
Detailed Description
This source file defines the class behaviors for the application.
- Author:
- Daniel R. Woods
- Version:
- 1.0
Function Documentation
This procedure returns the CTRL-C handler back to it's default settings.
void DisplayHelp |
( |
char * |
prgName | ) |
|
This procedure displays the help screen and then exits the program.
- Parameters:
-
prgName | This is the name of the program that will be displayed for this help screen. |
Usage: mksqlcpp {-/}Option
-
H[host] = specify the Host.
-
d[directory] = specify the destination directory. example mksqlcpp -dtmp
-
D[database] = specify the Database.
-
T[table] = specify the Table.
-
? = display this help screen
void HandleArgs |
( |
int |
argc, |
|
|
char * |
argv[] |
|
) |
| |
This procedure reads in the command line parameters and translates it to something the program can understand.
- Parameters:
-
argc | An integer that contains the count of arguments that follow in argv. The argc parameter is always greater than or equal to 1. |
argv | An array of null-terminated strings representing command-line arguments entered by the user of the program. By convention, argv[0] is the command with which the program is invoked, argv[1] is the first command-line argument, and so on, until argv[argc], which is always NULL. See Customizing Command Line Processing for information on suppressing command-line processing. The first command-line argument is always argv[1] and the last one is argv[argc 1]. |
int main |
( |
int |
argc, |
|
|
char * |
argv[] |
|
) |
| |
This procedure performs the tasks that were specified on the command line.
- Parameters:
-
argc | An integer that contains the count of arguments that follow in argv. The argc parameter is always greater than or equal to 1. |
argv | An array of null-terminated strings representing command-line arguments entered by the user of the program. By convention, argv[0] is the command with which the program is invoked, argv[1] is the first command-line argument, and so on, until argv[argc], which is always NULL. See Customizing Command Line Processing for information on suppressing command-line processing. The first command-line argument is always argv[1] and the last one is argv[argc 1]. |
This procedure sets up the signal handling routine for CTRL-C to use a user defined handler instead of the default one since we need to close the connections and files that are open during this time frame.
void SigIntCtrl |
( |
int |
val | ) |
|
This procedure is called when the user (or something else) generates an interrupt signal (CTRL-C, etc). It then tells the system to quit by changing the flag bShouldQuit to true.
Variable Documentation
This variable is used to allow the program to quit everything, and still perform wrap-up procedures.
This is the destination directory for the source files that are being created.
This is the host that has mysql running on it.
This is the Database that is specified on the command line.
This is the Table that is specified on the command line.