From 24fbe6feb6114fb72a1fbab1a47e5f82dee261c3 Mon Sep 17 00:00:00 2001 From: latenightz Date: Mon, 26 Apr 2021 19:15:16 +0000 Subject: [PATCH 1/5] Add 'branch.txt' --- branch.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 branch.txt diff --git a/branch.txt b/branch.txt new file mode 100644 index 0000000..9ce1db2 --- /dev/null +++ b/branch.txt @@ -0,0 +1 @@ +btest \ No newline at end of file From 7c887e662c46090f56e24a4e7b6da00b556ae330 Mon Sep 17 00:00:00 2001 From: latenightz Date: Mon, 26 Apr 2021 19:15:48 +0000 Subject: [PATCH 2/5] Update 'README.md' --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index cf43def..4b52bb0 100644 --- a/README.md +++ b/README.md @@ -2,4 +2,6 @@ C++ library for making your programs easier. (sometimes) -The wiki can be found here, it includes tutorials for using EZLib! \ No newline at end of file +The wiki can be found here, it includes tutorials for using EZLib! + +pre-releases can be found on the `pre-release` branch. \ No newline at end of file From 6e7fd053ff1504c57f4c74f839a8fe11e9e8ad22 Mon Sep 17 00:00:00 2001 From: latenightz Date: Mon, 26 Apr 2021 19:23:36 +0000 Subject: [PATCH 3/5] Delete 'testing.cpp' --- testing.cpp | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 testing.cpp diff --git a/testing.cpp b/testing.cpp deleted file mode 100644 index 9d2dbd7..0000000 --- a/testing.cpp +++ /dev/null @@ -1,17 +0,0 @@ -// Testing file for EZLib functions -#include -#include "lib/ez.h" - -using namespace std; - -int main() { - cout << "Hello world from the testing app!\n[next you should see EZLib functions]\n"; - ezl_hello(1); // Displays hello message from EZLib - ezl_ver(1); // Displays version of EZLib - cout << "\n"; // Due to the current feature ezl_ver() not being availible, - // You have to manually add \n... sorry! - cout << "System time: "; // not part of EZLib - ezl_time(1); // Displays system time using EZLib - // Note: if 1 is added in the parenthesis, it will print a newline \n at the end. - // Using 0 or any integer but 1 will result in no newline. -} From 3a2c38a8cb8c484bbd3d36e4e87c2e491fb39558 Mon Sep 17 00:00:00 2001 From: latenightz Date: Mon, 26 Apr 2021 19:24:09 +0000 Subject: [PATCH 4/5] Add 'test/testing.cpp' --- test/testing.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 test/testing.cpp diff --git a/test/testing.cpp b/test/testing.cpp new file mode 100644 index 0000000..34c35ec --- /dev/null +++ b/test/testing.cpp @@ -0,0 +1,19 @@ +// Testing file for EZLib functions +#include +#include "lib/ez.h" + +using namespace std; + +int main() { + cout << "Hello world from the testing app!\n[next you should see EZLib functions]\n"; + ezl_hello(1); // Displays hello message from EZLib + ezl_ver(1); // Displays version of EZLib + cout << "\n"; // Due to the current feature ezl_ver() not being availible, + // You have to manually add \n... sorry! + cout << "System time: "; // not part of EZLib + ezl_time(1); // Displays system time using EZLib + // Note: if 1 is added in the parenthesis, it will print a newline \n at the end. + // Using 0 or any integer but 1 will result in no newline. + ezl_wf("testing.txt", "hello, this was written with ezlib's file writer.\n"); // write to "testing.txt" + ezl_rf("testing.txt"); // Reads the file "testing.txt" +} From d4dfcdfdc96d304f0ae2c25ac04364ece3483cc2 Mon Sep 17 00:00:00 2001 From: latenightz Date: Mon, 26 Apr 2021 19:24:25 +0000 Subject: [PATCH 5/5] Update 'lib/ez.h' --- lib/ez.h | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/lib/ez.h b/lib/ez.h index 16d3e8d..c3cac9c 100644 --- a/lib/ez.h +++ b/lib/ez.h @@ -1,10 +1,11 @@ // Includes basic EZLib functions #include #include +#include using namespace std; -void ezl_hello(int nl) { +void ezl_hello(int nl) { // Print a hello message if (nl == 1) { cout << "Hello, from EZLib!\n"; } else { @@ -12,15 +13,15 @@ void ezl_hello(int nl) { } } -void ezl_info() { +void ezl_info() { // Info about EZLib cout << "EZLib v1.0.0"; // NL is disabled by default } -void ezl_ver(int nl) { +void ezl_ver(int nl) { // Redirected to ezl_info() ezl_info(); } -void ezl_time(int nl) { +void ezl_time(int nl) { // Prints the UNIX Timestamp const auto p1 = std::chrono::system_clock::now(); if (nl == 1) { cout << chrono::duration_cast( @@ -31,3 +32,23 @@ void ezl_time(int nl) { } } + +void ezl_rf(string filename) { // Reads a file + string ezlrf_output; + ifstream ezl_readfile(filename); + + while (getline (ezl_readfile, ezlrf_output)) { + cout << ezlrf_output; +} + + ezl_readfile.close(); + +} + +void ezl_wf(string filename, string text2write) { // Writes a file + ofstream ezl_writefile(filename); + + ezl_writefile << text2write; + + ezl_writefile.close(); +} \ No newline at end of file