main.cpp File Reference

Extended Custom Database sample program. More...

#include <string>
#include <vector>
#include <iostream>
#include <fstream>
#include "dca/dca_base.h"
#include "dca/dca_url_classification.h"
#include "dca/dca_callbacks.h"
#include "mythreads.h"

Go to the source code of this file.

Defines

#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.
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.
static void SetupConnectionData (DbConnectionData &cData)
 Sets up the given cData to use a local URL database.
static void SetupCustomConnectionData (const std::string &customdb_folder, DbConnectionData &cData)
 Sets up the given cData to use a Custom Database.
static void PrintResults (const CategoriesInfo &catinfos, const UrlClassificationResults &cats)
 Prints out the classification results and uses the categories info for textual representation of matched categories.
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.
static void LoadUrlFile (const std::string &fileName, std::vector< std::string > &urlList)
 Loads given fileName and puts each line to given urlList (by deleting trailing CRLFs).
void TestUrlClassification (const std::string &aUrlListFile, const DcaInstance &myDca, const UrlDbClassifier &myUrlDbClassifier, const UrlDbClassifier &myUrlCustomDbClassifier, const CategoriesInfo &myCategoriesInfo)
 Performs URL database classification with some URLs found in a given text file.
int main (int argc, char *argv[])
 The main routine.

Variables

const std::string S_ToolName = "customdbsample_extended"
const std::string S_ToolVersion = "1.2"
const std::string S_UsageString
 Usage string, displayed if a parameter was missing.
volatile bool S_schedulerThreadError = false
volatile bool S_updateThreadError = false

Detailed Description

Extended Custom Database sample program.

Definition in file customdb_samples/customdbsample_extended/main.cpp.


Generated on 26 Sep 2016 for dca_interface by  doxygen 1.6.1