*) Intended readers:
The servicedbgen tool is mainly intended to be used as a Symbian product creation time tool for prepopulating 
Qt Serviceframework databases. It is not a tool for normal runtime / application usage.  However, it may
be useful also for development-phase and testing purposes.

*) Overview:
The servicedbgen tool is a command line application to populate Qt Serviceframework databases. 
In principle, the tool takes XML files describing the service as input, and produces SQLite databases as output.
Services can be both added and removed.

The tool is intended to run on the cross-compiling machine (i.e. Windows or Linux) and is therefore delivered as a prebuilt 
application along with the SDK (servicedbgen.exe). The tool can be invoked in two different ways. The first one is the conventional invokation 
from the command line  with necessary parameters. The second one is to type directives into your project's .pro-file and let qmake + make
take care of automagically running the tool. The latter approach is also the one used in product creation time.

*) Design:
The design of the servicedbgen tool itself is straightforward. It takes in commandline parameters, parses and 
executes them. For the database population the tool uses the same servicedatabase creation components as the Qt 
Serviceframework itself. Therefore whenever the tool is rebuilt, it reflects the latest changes
in database components too.

There are two main ways to run the tool: individual mode and batch mode. In individual mode, the tool is given
individual XML files as input. In batch mode, the tool reads XML files from given the directory, or from default
directory if none given. It is worthwhile to note that the tool uses Nokia Vendor ID as the security token when adding
the services. Therefore if an application needs to tweak the preinstalled services during runtime, it needs to be 
equipped with Nokia Vendor ID.

Some services may require initialization prior to their first usage (e.g. to initialize databases etc.). 
This can be indicated by giving an option for the tool to indicate that initialization is needed for the given service(s).  
As a result, the QServiceManager will later call QServicePluginInterface::installService() for those services when the service is
loaded first time i.e. QServiceManager::loadInterface() is called.

The tool supports both WINSCW emulator as well as hardware targets. The resulting databases are identical, but
the locations differ (see Appendix). 

*)Usage from command line

The usage of the tool is as follows:
servicedbgen [options] <command> [command parameters]

To see the list of all available options, 
type 'servicedbgen --help'.

Basic usage examples:
 - registering service1 and service2 for winscw target:
        servicedbgen -twinscw add service1.xml service2.xml
 - registering service1 for all targets, service requesting initialization:
        servicedbgen -tall -i add service1.xml
 - unregistering service1 from all targets:
        servicedbgen -tall remove service1.xml
 - registering all services for armv5 from default descriptor path:
        servicedbgen -tall -b -c add
 - registering services for all targets from specific descriptor path:
        servicedbgen -tall -b add ./mypath/services
 - removing services for all targets from default descriptor path:
        servicedbgen -tall -b remove

The default target, if unspecified, is '-tall'.

*) Usage from .pro-file

Add following lines to your project's .pro-file (inside a symbian-block):

CONFIG += QTSERVICE                  // qmake magic, causes processing of qtservice.prf
QTSERVICE.DESCRIPTOR = <XML files>   // the list of service descriptor XML files
QTSERVICE.INITIALIZE = yes           // add  this if given descriptors need initialization

----------- Appendix

Note: data in the appendix is subject to changes over tame, and merely to demonstrate the 
principles. If up-to-date information is needed, please refer to the implementation.

*) Database locations
These are the paths where the tool stores the resulting db. The tool does not provide
choice to alternate these destinations, because the Qt Serviceframework looks up from
these databases.
"/epoc32/winscw/c/data/temp/QtServiceFW" // Emulator 
"/epoc32/data/c/private/2002AC7F/Nokia"  // HW

*) Default XML lookup paths
These are the paths where the tool looks for XML files (.xml) if 
batch option was given and no path was specified.
"/epoc32/winscw/c/private/2002AC7F/Nokia/des" // Emulator
"/epoc32/data/z/private/2002AC7F/Nokia/des"   // HW

