-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
unknown
committed
Sep 10, 2018
1 parent
3af425f
commit 49d7098
Showing
4 changed files
with
57 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#pragma once | ||
|
||
#include "json.hpp" | ||
|
||
using json = nlohmann::json; | ||
|
||
class Task:public json | ||
{ | ||
public: | ||
void operator() (); | ||
}; | ||
|
||
Task&& loadjson(std::string file_path); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#include "json.h" | ||
#include <fstream> | ||
#include <exception> | ||
#include <iostream> | ||
|
||
struct NotImplementedError: public std::exception | ||
{ | ||
}; | ||
|
||
void Task::operator() () | ||
{ | ||
std::cout << "Running Task" << std::endl; | ||
throw NotImplementedError(); | ||
} | ||
|
||
Task&& loadjson(std::string file_path) | ||
{ | ||
std::ifstream file(file_path); | ||
Task s; | ||
file >> *static_cast<json*>(&s); | ||
return std::move(s); | ||
} |