Skip to content

Commit

Permalink
#63 - json_test builds again.
Browse files Browse the repository at this point in the history
  • Loading branch information
PerMalmberg committed Aug 31, 2019
1 parent bad38d1 commit bd7ed05
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 15 deletions.
3 changes: 0 additions & 3 deletions lib/smooth/core/json/JsonFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,8 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.

#include <smooth/core/json/JsonFile.h>
#include <cJSON.h>

#include <memory>
#include <vector>
#include <iostream>

namespace smooth::core::json
{
Expand Down
7 changes: 3 additions & 4 deletions lib/smooth/include/smooth/core/json/JsonFile.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// Smooth - C++ framework for writing applications based on Espressif's ESP-IDF.

// Copyright (C) 2017 Per Malmberg (https://github.com/PerMalmberg)
//
// This program is free software: you can redistribute it and/or modify
Expand All @@ -26,11 +25,11 @@ namespace smooth::core::json
class JsonFile
{
public:
JsonFile(std::string full_path);
explicit JsonFile(std::string full_path);

bool save() const;
[[nodiscard]] bool save() const;

bool exists() const
[[nodiscard]] bool exists() const
{
return f.exists();
}
Expand Down
12 changes: 6 additions & 6 deletions lib/smooth/include/smooth/core/json/Value.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,19 +101,19 @@ namespace smooth::core::json

explicit operator bool() const;

std::string get_string(const std::string& default_value_value) const;
[[nodiscard]] std::string get_string(const std::string& default_value_value) const;

int get_int(int default_value) const;
[[nodiscard]] int get_int(int default_value) const;

bool get_bool(bool default_value) const;
[[nodiscard]] bool get_bool(bool default_value) const;

int get_array_size() const;
[[nodiscard]] int get_array_size() const;

std::string get_name() const;
[[nodiscard]] std::string get_name() const;

void get_member_names(std::vector<std::string>& names) const;

std::string to_string() const;
[[nodiscard]] std::string to_string() const;

// Deletes named object
void erase(const std::string& name);
Expand Down
3 changes: 1 addition & 2 deletions test/json_test/json_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
#include <algorithm>
#include <fstream>
#include <cassert>
#include <unistd.h>
#include <json/cJSON/cJSON.h>
#include <cJSON.h>
#include <smooth/core/task_priorities.h>
#include <smooth/core/json/Value.h>
#include "test_example.json.h"
Expand Down

0 comments on commit bd7ed05

Please sign in to comment.