unfinished but, soon adding books
This commit is contained in:
parent
928d9b9e01
commit
4a0da14f89
@ -1,7 +1,10 @@
|
||||
#include <cinttypes>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <fstream>
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
#include "isbn-interaction.h"
|
||||
#include "csv.h"
|
||||
|
||||
@ -47,3 +50,20 @@ std::string get_all_books()
|
||||
|
||||
return total_lines + "}";
|
||||
}
|
||||
|
||||
void add_new_book(std::string isbn)
|
||||
{
|
||||
pid_t pid;
|
||||
|
||||
|
||||
std::string program_name = "./isbn";
|
||||
std::string write = "w";
|
||||
const char* args[] = {program_name.c_str(), isbn.c_str(), write.c_str()};
|
||||
|
||||
pid = fork();
|
||||
if (0 == pid) { //
|
||||
// this is the child
|
||||
}
|
||||
|
||||
//TODO execvp the args blah blah
|
||||
}
|
||||
|
@ -17,7 +17,6 @@ std::string book_vec_to_json(std::vector<std::string> headers, std::vector<std::
|
||||
*/
|
||||
std::string get_all_books();
|
||||
|
||||
|
||||
|
||||
void add_new_book(std::string isbn);
|
||||
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user