-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Just the init stuff, putting the other stuff up shortly. #6
base: master
Are you sure you want to change the base?
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
cmake_minimum_required(VERSION 3.3) | ||
project(Assignment__5) | ||
|
||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") | ||
|
||
set(SOURCE_FILES main.cpp main.h reader.cpp) | ||
add_executable(Assignment__5 ${SOURCE_FILES}) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't forget to link your library if this is you "driver" There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I now see that you are still coding this in one file, but keep this in mind when you create the library. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
#include <iostream> | ||
#include <fstream> | ||
|
||
//#include './library.h" | ||
|
||
const std::string CONFIG = "C:/Users/Tim/ClionProjects/Assignment_2_File_Generator/config.txt"; | ||
const std::string EDIT = "C:/Users/Tim/ClionProjects/Assignment_2_File_Generator/edit.txt"; | ||
|
||
void init(); | ||
void edit(); | ||
|
||
|
||
int main(int argc, char *argv[]) { | ||
|
||
if (static_cast<std::string>(argv[1]) == "init"){ | ||
init(); | ||
|
||
} | ||
|
||
else if (static_cast<std::string>(argv[1]) == "edit"){ | ||
edit(); | ||
|
||
} | ||
return 0; | ||
} | ||
void init(){ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add a parameter to pass the the path. It will be needed when you turn this into a library. |
||
|
||
std::ofstream myfile; | ||
myfile.open(CONFIG); | ||
|
||
std::string first_and_last = "", email = "", cypher = "", timezone; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I like how you put all of this in one line. |
||
|
||
std::cout << "Enter your first and last name, please" << std::endl; | ||
std::getline(std::cin, first_and_last); | ||
|
||
while (first_and_last == "") { | ||
std::cout << "Please enter your first and last name to continue" << std::endl; | ||
std::getline(std::cin, first_and_last); | ||
} | ||
myfile << first_and_last << std::endl; | ||
|
||
std::cout << "Enter your email address, please" << std::endl; | ||
std::getline(std::cin, email); | ||
|
||
while (email == "") { | ||
std::cout << "Please enter your email to continue" << std::endl; | ||
std::getline(std::cin, email); | ||
} | ||
myfile << email << std::endl; | ||
|
||
std::cout << "Enter your unique cypher, please" << std::endl; | ||
std::getline(std::cin, cypher); | ||
|
||
while (cypher == "") { | ||
std::cout << "Please enter your unique cypher to continue" << std::endl; | ||
std::getline(std::cin, cypher); | ||
} | ||
myfile << cypher << std::endl; | ||
|
||
std::cout << "Enter your timezone offset, please" << std::endl; | ||
std::getline(std::cin, timezone); | ||
|
||
|
||
while (timezone == "") { | ||
std::cout << "Please enter your timezone to continue" << std::endl; | ||
std::getline(std::cin, timezone); | ||
} | ||
myfile << timezone << std::endl; | ||
|
||
|
||
myfile.close(); | ||
|
||
return void(); | ||
} | ||
|
||
void edit(){ | ||
|
||
std::cout << "Something edited, blah blah blah" << std::endl; | ||
|
||
return void(); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// | ||
// Created by Tim on 3/13/2016. | ||
// | ||
|
||
|
||
//struct config{ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This struct looks good. |
||
// std::string first; | ||
//std::string last; | ||
// std::string cypher; | ||
// std::string timzone; | ||
//std::string email; | ||
//} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
// | ||
// Created by Tim on 3/15/2016. | ||
// | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't forget to include your lib folder if this is you "driver"
include_directories( ./lib ) link_directories( ./lib )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I now see that you are still coding this in one file, but keep this in mind when you create the library.