Config.cpp
Go to the documentation of this file.
00001 // this is for emacs file handling -*- mode: c++; indent-tabs-mode: nil -*-
00002 
00003 // -- BEGIN LICENSE BLOCK ----------------------------------------------
00004 // This file is part of FZIs ic_workspace.
00005 //
00006 // This program is free software licensed under the LGPL
00007 // (GNU LESSER GENERAL PUBLIC LICENSE Version 3).
00008 // You can find a copy of this license in LICENSE folder in the top
00009 // directory of the source code.
00010 //
00011 // © Copyright 2016 FZI Forschungszentrum Informatik, Karlsruhe, Germany
00012 //
00013 // -- END LICENSE BLOCK ------------------------------------------------
00014 
00015 //----------------------------------------------------------------------
00021 //----------------------------------------------------------------------
00022 #include "icl_core_config/Config.h"
00023 
00024 #include <iostream>
00025 
00026 namespace icl_core {
00027 namespace config {
00028 
00029 const char * CONFIGFILE_CONFIG_KEY = "/configfile";
00030 
00031 void dump()
00032 {
00033   ConfigManager::instance().dump();
00034 }
00035 
00036 void debugOutCommandLine(int argc, char *argv[])
00037 {
00038   for (int j = 0; j < argc; j++)
00039   {
00040     std::cout << argv[j] << " ";
00041   }
00042   std::cout << std::endl;
00043 }
00044 
00045 ConfigIterator find(const ::icl_core::String& query)
00046 {
00047   return ConfigManager::instance().find(query);
00048 }
00049 
00050 bool initialize(int& argc, char *argv[], bool remove_read_arguments)
00051 {
00052   return initialize(argc, argv,
00053                     remove_read_arguments ? Getopt::eCLC_Cleanup : Getopt::eCLC_None,
00054                     Getopt::ePRC_Strict);
00055 }
00056 
00057 bool initialize(int& argc, char *argv[], Getopt::CommandLineCleaning cleanup,
00058                 Getopt::ParameterRegistrationCheck registration_check)
00059 {
00060   // Ensure that the commandline options for ConfigManager are registered.
00061   ConfigManager::instance();
00062 
00063   bool res = Getopt::instance().initialize(argc, argv, cleanup, registration_check);
00064   if (res)
00065   {
00066     res = ConfigManager::instance().initialize();
00067   }
00068   return res;
00069 }
00070 
00071 }}


fzi_icl_core
Author(s):
autogenerated on Tue Aug 8 2017 02:28:03