17#ifndef __CONFIG_FS_BULKSTORE_H
18#define __CONFIG_FS_BULKSTORE_H
21#include <config_obj.h>
23#include <hal_platdefs.h>
29 FLAG_EXPOSE_PATH_TO_CONFIG = 0x1,
30 FLAG_NEED_FS_RELOAD = 0x2,
31 FLAG_IS_SENSITIVE_HIDE_VALUE= 0x4,
32 FLAG_FS_PATH_PENDING = 0x8,
33 FLAG_ON_PATH_CHANGE_KEEP = 0x10,
34 FLAG_PEND_VAL_IS_PATH = 0x80000,
46 uint32_t bulkstore_flags;
48 void ReloadFromFile();
50 void GetValue(
NBString &s,
bool raw);
52 virtual void RawFdPrintTree(
int fd,
int n,
bool pretty, uint32_t mask,
bool braw_values,
bool valonly)
override;
54 config_fs_bulkstore(
const char *fname,
bool exposePathToConfig,
const char *name,
const char *desc = NULL,
bool keepOldFile =
false);
55 config_fs_bulkstore(
config_obj &owner,
const char *fname,
bool exposePathToConfig,
const char *name,
const char *desc = NULL,
bool keepOldFile =
false );
56 config_fs_bulkstore(config_fs_bulkstore &&e);
58 inline void SetBulkstoreFlags(uint32_t flags) { bulkstore_flags |= flags; }
59 inline void ClearBulkstoreFlags(uint32_t flags) { bulkstore_flags &= ~flags; }
60 inline uint32_t GetBulkstoreFlags(uint32_t flags){
return bulkstore_flags; }
63 virtual void CommitTestedValue(uint32_t permission_mask)
override;
64 void SetFilePath(
const char *newFname, OnRename action = OnRename::MOVE);
65 const char * GetFilePath()
const {
return fs_path.
c_str(); }
66 void SetExposeToConfig(
bool enable)
69 bulkstore_flags |= FLAG_EXPOSE_PATH_TO_CONFIG;
71 bulkstore_flags &= ~FLAG_EXPOSE_PATH_TO_CONFIG;
74 virtual void GetRawValue(
NBString &s)
override;
75 virtual void GetTextValue(
NBString &s)
override;
76 operator NBString()
const {
return val; };
78 virtual void GetTypeValue(
NBString &s)
override;
79 virtual void ExtendedSchema(
int fd,
int indent,
bool pretty)
override;
Lightweight alternative to C++ CString class.
Definition nbstring.h:118
const char * c_str() const
Method to pass a NBString as a constant char *.
A class to create, read, and modify a JSON object.
Definition json_lexer.h:535
Base class used to create configuration objects.
Definition config_obj.h:320
String Configuration Variable.
Definition config_obj.h:1127