#include "hdstutilities.h"

HDstUtilities


class description - source file - inheritance tree (.pdf)

class HDstUtilities : public TObject

Inheritance Chart:
TObject
<-
HDstUtilities
    private:
HDstUtilities() public:
HDstUtilities(const HDstUtilities&) ~HDstUtilities() static TClass* Class() static char* extractArg(int* argc, char*** argv, const char* arg) static void freeCmdLineArgs(int argc, char** argv) virtual TClass* IsA() const HDstUtilities& operator=(const HDstUtilities&) static Bool_t readCmdLineArgsFromFile(const char* filename, int* argc, char*** argv) virtual void ShowMembers(TMemberInspector& insp, char* parent) static void str2CmdLineArgs(const char* input, int* argc, char*** argv) virtual void Streamer(TBuffer& b) void StreamerNVirtual(TBuffer& b)

Data Members

    private:
static const Int_t MAX_LINE_LENGTH

Class Description


bool readCmdLineArgsFromFile(const char* filename, int* argc, char*** argv)
 This function parses a text file and save the "key = value" pairs
 found on the lines of that file in a structure which looks exactly
 like the one filled with the command line arguments of a program.
 A file might look like that:

 ########################################
 #
 #  Example config file
 #
 ########################################

 # a comment
    # another comment

 family-name = lang
 name=simon
 institute = GSI  # in Darmstadt

 telephone  = 06519 / 71-2914
    fax= "06159 / 71-2989"
 --email = 's.lang@gsi.de'

 The corresponding command line would look like this,
 filename --family-name=lang --name=simon --telephone="06159 / 71-2914"...
 which is what the getopt_long() function expects. Here, "filename"
 is the name of the test file being evaluated.
 The function fills argc and argv with the data and returns true on
 success. It is written in plain C (except the return type),
 because it's lazy author wants to use it in other C programs as well.

void str2CmdLineArgs(const char* input, int* argc, char*** argv)
 This function converts a string which looks like a command line
 into the related array of arguments as it is usually passed to the
 main() function of a program. Results are stored in argc and argv.
 The first string (usually the name of the executable) is set to
 "from-string" here.
 Use (double-) quotes to protect arguments containing white spaces
 from being cut.
 This function is written in plain C because it's lazy author wants to
 use it in other C programs as well.

void freeCmdLineArgs(int argc, char** argv)
 This functions frees the memory used by a command line argument structure

char* extractArg(int* argc, char*** argv, const char* arg)
 This function parses a list of command line arguments (saved in
 the structure referenced by 'argc' and 'argv'), and removes the argument
 specified by 'arg' from this list. If the argument describes an option
 with a value (in this case the next argument is treated as value), then
 one must append a ':' to its name. Finally, this returns the option name
 or the value.
 The memory of the returned string must be deleted by the caller of this
 function.



Inline Functions


                  void ~HDstUtilities()
         HDstUtilities HDstUtilities()
               TClass* Class()
               TClass* IsA() const
                  void ShowMembers(TMemberInspector& insp, char* parent)
                  void Streamer(TBuffer& b)
                  void StreamerNVirtual(TBuffer& b)
         HDstUtilities HDstUtilities(const HDstUtilities&)
        HDstUtilities& operator=(const HDstUtilities&)


Last update: Fri Jan 26 11:54:22 2007


ROOT page - Class index - Class Hierarchy - Top of the page

This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.