A device detection library that is used natively or by 51Degrees products

ConfigBase.hpp

1/* *********************************************************************
2 * This Original Work is copyright of 51 Degrees Mobile Experts Limited.
3 * Copyright 2026 51 Degrees Mobile Experts Limited, Davidson House,
4 * Forbury Square, Reading, Berkshire, United Kingdom RG1 3EU.
5 *
6 * This Original Work is licensed under the European Union Public Licence
7 * (EUPL) v.1.2 and is subject to its terms as set out below.
8 *
9 * If a copy of the EUPL was not distributed with this file, You can obtain
10 * one at https://opensource.org/licenses/EUPL-1.2.
11 *
12 * The 'Compatible Licences' set out in the Appendix to the EUPL (as may be
13 * amended by the European Commission) shall be deemed incompatible for
14 * the purposes of the Work and the provisions of the compatibility
15 * clause in Article 5 of the EUPL shall not apply.
16 *
17 * If using the Work as, or as part of, a network application, by
18 * including the attribution notice(s) required under Article 5 of the EUPL
19 * in the end user terms of the application under an appropriate heading,
20 * such notice(s) shall fulfill the requirements of that article.
21 * ********************************************************************* */
22
23#ifndef FIFTYONE_DEGREES_CONFIG_BASE_HPP
24#define FIFTYONE_DEGREES_CONFIG_BASE_HPP
25
26#include <vector>
27#include <string>
28#include "Exceptions.hpp"
29#include "config.h"
30
31using std::vector;
32
33namespace FiftyoneDegrees {
34 namespace Common {
35 FIFTYONE_DEGREES_COMMON_CXX_BEGIN
61 class ConfigBase {
62 public:
67
74
78 virtual ~ConfigBase();
79
85
92
98 void setUseTempFile(bool use);
99
105 void setReuseTempFile(bool reuse);
106
115 void setTempDirectories(vector<string> tempDirs);
116
122 void setPropertyValueIndex(bool index);
123
129
137
143 bool getUseTempFile() const;
144
150 bool getReuseTempFile() const;
151
158 vector<string> getTempDirectories() const;
159
166
171 virtual uint16_t getConcurrency() const;
172
176 private:
179
182 vector<string> tempDirs;
183
187 void freeTempDirectories();
188
193 void mapTempDirectories();
194 };
195 FIFTYONE_DEGREES_COMMON_CXX_END
196 }
197}
198
199#endif
virtual uint16_t getConcurrency() const
Get the expected number of concurrent accessors of the data set.
bool getUseTempFile() const
Get whether or not a temporary file should be created from the original data file and used to initial...
bool getPropertyValueIndex() const
Gets a flag indicating if an index of values for properties and profile is created.
void setPropertyValueIndex(bool index)
Set whether or not an index to speed up the retrieval of values for profiles and properties is create...
void setReuseTempFile(bool reuse)
Set whether or not a temporary file that already exists for a master file should be reused by another...
void setUseTempFile(bool use)
Set whether or not a temporary file should be created from the original data file and used to initial...
void setUseUpperPrefixHeaders(bool use)
Set whether or not the HTTP header field might be prefixed with 'HTTP_'.
bool getUseUpperPrefixHeaders() const
Get whether or not an HTTP_ upper case prefixes should be considered when evaluating HTTP headers.
vector< string > getTempDirectories() const
Gets a vector of temporary directory strings which should be used to store temporary files.
virtual ~ConfigBase()
Free any memory associated with temporary directories.
ConfigBase(fiftyoneDegreesConfigBase *config)
Constructs a new instance of the configuration with a reference to the C configuration provided.
void setTempDirectories(vector< string > tempDirs)
Sets a collection of temporary directories to use if temporary file operation is required in the orde...
bool getReuseTempFile() const
Get whether temporary files can be reused across multiple processes.
Shared classes.
Definition Collection.hpp:31
A C++ wrapper class for transform.h conversion routines.
Definition ComponentMetaDataBuilderHash.hpp:33
Base configuration structure containing common configuration options, and options that apply to struc...
Definition config.h:53