37 lines
1.0 KiB
C++
Executable File
37 lines
1.0 KiB
C++
Executable File
#ifndef PARAMETER_H
|
|
#define PARAMETER_H
|
|
|
|
#include <array>
|
|
#include <string>
|
|
#include <vector>
|
|
#include "jansson.h"
|
|
#include "simulation/jansson_additionals.h"
|
|
|
|
class Parameter {
|
|
public:
|
|
Parameter(std::string filename);
|
|
~Parameter();
|
|
|
|
double doubleValue(const json_path& path) const;
|
|
double doubleValue(const json_path& path, double default_value) const;
|
|
int intValue(const json_path& path) const;
|
|
int intValue(const json_path& path, int default_value) const;
|
|
std::string stringValue(const json_path& path) const;
|
|
std::string stringValue(const json_path& path,
|
|
const std::string& default_value) const;
|
|
bool boolValue(const json_path& path) const;
|
|
bool boolValue(const json_path& path, bool default_value) const;
|
|
|
|
bool pathExists(const json_path& path) const;
|
|
json_t* jsonFile() const;
|
|
json_t* jsonObjectFromBase(const json_path& path) const;
|
|
|
|
private:
|
|
json_error_t* j_error_;
|
|
json_t* j_file_;
|
|
|
|
json_t* openParameterFile(const std::string& filename) const;
|
|
};
|
|
|
|
#endif /* PARAMETER_H */
|