dca_interface
6.3.4
|
Uses the DCA API to show how live updates of the instaciated DCA work.
If there is any update is available, it will be downloaded and installed. After the update process, it will print out all updated files and all available update details.
You may extend the sample by simply initializing more DCA modules. Then you will get more possible updates for these additional modules.
It also shows how to use the classes:
Syntax:
Files | |
file | generic_samples/updatesample/main.cpp |
Update sample program. | |
Macros | |
#define | DCA_BINDIR "bin/linux" |
DCA subdirectory of the DCA binaries. | |
#define | DCA_INITDIR "init" |
DCA subdirectory of the DCA initialization data. | |
#define | DCA_LOGDIR "./logs" |
Relative directory for logfile(s). | |
Functions | |
static void | SetupInitData (const std::string &redist_folder, InitData &initData) |
Sets up the given initData by substituting the given redist_folder with DCA subdirectories. More... | |
static void | SetupLicense (const std::string &ticket, const std::string &product, LicenseData &licenseData) |
Sets up the given licenseData by copying the given ticket and product strings. More... | |
static void | PrintLicenseInfo (const License &aLicense) |
Prints out the information about the provided License. More... | |
int | TestUpdate (const DcaInstance &myDca, const License &myLicense) |
Sets up required classes and performs an update by calling UpdateModule::performUpdate(). More... | |
static void | PrintToolHeader () |
Prints out the name and the version of this sample. | |
static void | PrintUsage (const char *name) |
Prints out the syntax of the sample. More... | |
int | main (int argc, char *argv[]) |
The main routine. More... | |
Variables | |
const std::string | S_UsageString |
Usage string - that is printed out if a parameter was missing. More... | |
|
static |
Sets up the given initData by substituting the given redist_folder with DCA subdirectories.
[in] | redist_folder | This is the folder where the DCA has been installed to (assuming trailing filslash) |
[out] | initData | The InitData structure to set up |
Definition at line 95 of file generic_samples/updatesample/main.cpp.
|
static |
Sets up the given licenseData by copying the given ticket and product strings.
[in] | ticket | This is the ticket data as provided with your DCA license |
[in] | product | This is the product shortcut e.g. DC oder MS etc |
[out] | licenseData | The LicenseData structure to set up |
Definition at line 110 of file generic_samples/updatesample/main.cpp.
|
static |
Prints out the information about the provided License.
[in] | aLicense | The license for which information should be displayed. |
Definition at line 122 of file generic_samples/updatesample/main.cpp.
int TestUpdate | ( | const DcaInstance & | myDca, |
const License & | myLicense | ||
) |
Sets up required classes and performs an update by calling UpdateModule::performUpdate().
This function initializes the UpdateModule and calls then its performUpdate method.
Then it prints out the results in detail.
[in] | myDca | A valid set up DCA Instance |
[in] | myLicense | A valid set up License |
Definition at line 157 of file generic_samples/updatesample/main.cpp.
|
static |
Prints out the syntax of the sample.
[in] | name | The name of the executable |
Definition at line 235 of file generic_samples/updatesample/main.cpp.
int main | ( | int | argc, |
char * | argv[] | ||
) |
The main routine.
[in] | argc | The count of arguments provided |
[in] | argv | An array of provided arguments |
Definition at line 252 of file generic_samples/updatesample/main.cpp.
const std::string S_UsageString |
Usage string - that is printed out if a parameter was missing.
Definition at line 56 of file generic_samples/updatesample/main.cpp.