Skip to content
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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Assignment _5/.idea/.name

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 26 additions & 0 deletions Assignment _5/.idea/Assignment _5.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions Assignment _5/.idea/encodings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions Assignment _5/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Assignment _5/.idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

323 changes: 323 additions & 0 deletions Assignment _5/.idea/workspace.xml

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions Assignment _5/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
cmake_minimum_required(VERSION 3.3)
project(Assignment__5)

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 )

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.

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})

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't forget to link your library if this is you "driver"
target_link_libraries(Assignment__5 <your namespace>)

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.

81 changes: 81 additions & 0 deletions Assignment _5/main.cpp
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(){

Choose a reason for hiding this comment

The 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.
void init(std::string config_file_path)


std::ofstream myfile;
myfile.open(CONFIG);

std::string first_and_last = "", email = "", cypher = "", timezone;

Choose a reason for hiding this comment

The 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();
}
12 changes: 12 additions & 0 deletions Assignment _5/main.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
//
// Created by Tim on 3/13/2016.
//


//struct config{

Choose a reason for hiding this comment

The 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;
//}
4 changes: 4 additions & 0 deletions Assignment _5/reader.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
//
// Created by Tim on 3/15/2016.
//