LIMA
Libre Multilingual Analyzer — C++ API
Loading...
Searching...
No Matches
ConfigurationHelper.h
Go to the documentation of this file.
1// Copyright 2020-2022 CEA LIST
2// SPDX-FileCopyrightText: 2022 CEA LIST <gael.de-chalendar@cea.fr>
3//
4// SPDX-License-Identifier: MIT
5
6#ifndef LIMA_HELPERS_CONFIGURATION_HELPER_H
7#define LIMA_HELPERS_CONFIGURATION_HELPER_H
8
10
11#include <string>
13
14namespace Lima
15{
16namespace LinguisticProcessing
17{
18
20{
21protected:
22 ConfigurationHelper(const std::string& processUnitName, const std::string& loggingCategory)
23 : m_processUnitName(processUnitName),
24 m_loggingCategory(loggingCategory)
25 {
26 }
27
28 enum Flags
29 {
30 REQUIRED = 0x1,
31 NOT_EMPTY = 0x2,
32 NOT_ZERO = 0x2
33 };
34
35 void getStringParameter(
37 const std::string& name,
38 std::string& value,
39 int flags = Flags::REQUIRED,
40 std::string default_value = "");
41
42 std::string getStringParameter(
44 const std::string& name,
45 int flags = Flags::REQUIRED,
46 std::string default_value = "");
47
48 void getIntParameter(
50 const std::string& name,
51 int& value,
52 int flags = Flags::REQUIRED,
53 int default_value = 0);
54
55 int getIntParameter(
57 const std::string& name,
58 int flags = Flags::REQUIRED,
59 int default_value = 0);
60
61 bool isInitLazy();
62
63private:
64 std::string m_processUnitName;
65 std::string m_loggingCategory;
66};
67
68#define CONFIGURATIONHELPER_LOGGING_INIT(X) \
69 namespace \
70 { \
71 inline std::string THIS_FILE_LOGGING_CATEGORY() \
72 { \
73 X; \
74 return logger.zone().toStdString(); \
75 } \
76 }
77
78}
79}
80#endif
#define LIMA_LP_HELPERS_EXPORT
ConfigurationHelper(const std::string &processUnitName, const std::string &loggingCategory)
originally detectGroupConfigurationStructure.h in detectlibraries
NAUTITIA.