\r\n

51Degrees Device Detection C/C++  4.5

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 2023 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 
31 using std::vector;
32 
33 namespace FiftyoneDegrees {
34  namespace Common {
60  class ConfigBase {
61  public:
73 
77  virtual ~ConfigBase();
78 
90  void setUseUpperPrefixHeaders(bool use);
91 
97  void setUseTempFile(bool use);
98 
104  void setReuseTempFile(bool reuse);
105 
114  void setTempDirectories(vector<string> tempDirs);
115 
121  void setPropertyValueIndex(bool index);
122 
135  bool getUseUpperPrefixHeaders() const;
136 
142  bool getUseTempFile() const;
143 
149  bool getReuseTempFile() const;
150 
157  vector<string> getTempDirectories() const;
158 
164  bool getPropertyValueIndex() const;
165 
170  virtual uint16_t getConcurrency() const;
171 
175  private:
178 
181  vector<string> tempDirs;
182 
186  void freeTempDirectories();
187 
192  void mapTempDirectories();
193  };
194  }
195 }
196 
197 #endif
bool getPropertyValueIndex() const
Gets a flag indicating if an index of values for properties and profile is created.
A C++ wrapper class for transform.h conversion routines.
Definition: ComponentMetaDataBuilderHash.hpp:33
void setReuseTempFile(bool reuse)
Set whether or not a temporary file that already exists for a master file should be reused by another...
void setPropertyValueIndex(bool index)
Set whether or not an index to speed up the retrieval of values for profiles and properties is create...
C++ class wrapper for the fiftyoneDegreesConfigBase configuration structure.
Definition: ConfigBase.hpp:60
void setUseUpperPrefixHeaders(bool use)
Set whether or not the HTTP header field might be prefixed with 'HTTP_'.
void setUseTempFile(bool use)
Set whether or not a temporary file should be created from the original data file and used to initial...
bool getUseTempFile() const
Get whether or not a temporary file should be created from the original data file and used to initial...
virtual uint16_t getConcurrency() const
Get the expected number of concurrent accessors of the data set.
bool getUseUpperPrefixHeaders() const
Get whether or not an HTTP_ upper case prefixes should be considered when evaluating HTTP headers.
ConfigBase(fiftyoneDegreesConfigBase *config)
Constructs a new instance of the configuration with a reference to the C configuration provided.
Base configuration structure containing common configuration options, and options that apply to struc...
Definition: config.h:49
bool getReuseTempFile() const
Get whether temporary files can be reused across multiple processes.
void setTempDirectories(vector< string > tempDirs)
Sets a collection of temporary directories to use if temporary file operation is required in the orde...
virtual ~ConfigBase()
Free any memory associated with temporary directories.
vector< string > getTempDirectories() const
Gets a vector of temporary directory strings which should be used to store temporary files.