Config.cpp
Go to the documentation of this file.
1 // this is for emacs file handling -*- mode: c++; indent-tabs-mode: nil -*-
2 
3 // -- BEGIN LICENSE BLOCK ----------------------------------------------
4 // This file is part of FZIs ic_workspace.
5 //
6 // This program is free software licensed under the LGPL
7 // (GNU LESSER GENERAL PUBLIC LICENSE Version 3).
8 // You can find a copy of this license in LICENSE folder in the top
9 // directory of the source code.
10 //
11 // © Copyright 2016 FZI Forschungszentrum Informatik, Karlsruhe, Germany
12 //
13 // -- END LICENSE BLOCK ------------------------------------------------
14 
15 //----------------------------------------------------------------------
21 //----------------------------------------------------------------------
22 #include "icl_core_config/Config.h"
23 
24 #include <iostream>
25 
26 namespace icl_core {
27 namespace config {
28 
29 const char * CONFIGFILE_CONFIG_KEY = "/configfile";
30 
31 void dump()
32 {
34 }
35 
36 void debugOutCommandLine(int argc, char *argv[])
37 {
38  for (int j = 0; j < argc; j++)
39  {
40  std::cout << argv[j] << " ";
41  }
42  std::cout << std::endl;
43 }
44 
46 {
47  return ConfigManager::instance().find(query);
48 }
49 
50 bool initialize(int& argc, char *argv[], bool remove_read_arguments)
51 {
52  return initialize(argc, argv,
53  remove_read_arguments ? Getopt::eCLC_Cleanup : Getopt::eCLC_None,
55 }
56 
57 bool initialize(int& argc, char *argv[], Getopt::CommandLineCleaning cleanup,
58  Getopt::ParameterRegistrationCheck registration_check)
59 {
60  // Ensure that the commandline options for ConfigManager are registered.
62 
63  bool res = Getopt::instance().initialize(argc, argv, cleanup, registration_check);
64  if (res)
65  {
67  }
68  return res;
69 }
70 
71 }}
all options have to be registered
Definition: GetoptParser.h:59
static ConfigManager & instance()
bool initialize(int &argc, char *argv[], bool remove_read_arguments)
Definition: Config.cpp:50
known command line options are removed
Definition: GetoptParser.h:67
Base header file for the configuration framework.
void debugOutCommandLine(int argc, char *argv[])
Definition: Config.cpp:36
KeyValueDirectoryIterator< T > find(const String &query) const
ThreadStream & endl(ThreadStream &stream)
Definition: ThreadStream.h:249
const char * CONFIGFILE_CONFIG_KEY
Definition: Config.cpp:29
ConfigIterator find(const ::icl_core::String &query)
Definition: Config.cpp:45
command line options are left untouched
Definition: GetoptParser.h:66
bool initialize(int &argc, char *argv[], bool remove_read_arguments)
std::string String
Definition: BaseTypes.h:43
static Getopt & instance()


fzi_icl_core
Author(s):
autogenerated on Mon Jun 10 2019 13:17:58