Move json_is_true/json_is_false to json_util.cpp
This commit is contained in:
@@ -136,7 +136,6 @@ uint64_t sscanf_json(const char *fmt, const json11::Json & str);
|
||||
void fromhexstr(const std::string & from, int bytes, uint8_t *to);
|
||||
int disable_cache(std::string dev);
|
||||
std::string get_parent_device(std::string dev);
|
||||
bool json_is_true(const json11::Json & val);
|
||||
int shell_exec(const std::vector<std::string> & cmd, const std::string & in, std::string *out, std::string *err);
|
||||
int write_zero(int fd, uint64_t offset, uint64_t size);
|
||||
json11::Json read_parttable(std::string dev);
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
#include "disk_tool.h"
|
||||
#include "str_util.h"
|
||||
#include "json_util.h"
|
||||
#include "osd_id.h"
|
||||
|
||||
int disk_tool_t::prepare_one(std::map<std::string, std::string> options, int is_hdd)
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include "disk_tool.h"
|
||||
#include "rw_blocking.h"
|
||||
#include "str_util.h"
|
||||
#include "json_util.h"
|
||||
|
||||
struct __attribute__((__packed__)) vitastor_disk_superblock_t
|
||||
{
|
||||
|
||||
@@ -147,13 +147,6 @@ std::string get_parent_device(std::string dev)
|
||||
return dev.substr(0, i);
|
||||
}
|
||||
|
||||
bool json_is_true(const json11::Json & val)
|
||||
{
|
||||
if (val.is_string())
|
||||
return val == "true" || val == "yes" || val == "1";
|
||||
return val.bool_value();
|
||||
}
|
||||
|
||||
int shell_exec(const std::vector<std::string> & cmd, const std::string & in, std::string *out, std::string *err)
|
||||
{
|
||||
int child_stdin[2], child_stdout[2], child_stderr[2];
|
||||
|
||||
Reference in New Issue
Block a user