2021-04-26 16:48:45 +00:00
|
|
|
// Includes basic EZLib functions
|
|
|
|
#include <iostream>
|
|
|
|
#include <chrono>
|
2021-04-26 19:24:25 +00:00
|
|
|
#include <fstream>
|
2021-04-26 16:48:45 +00:00
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
|
2021-04-26 19:24:25 +00:00
|
|
|
void ezl_hello(int nl) { // Print a hello message
|
2021-04-26 16:48:45 +00:00
|
|
|
if (nl == 1) {
|
|
|
|
cout << "Hello, from EZLib!\n";
|
|
|
|
} else {
|
|
|
|
cout << "Hello, from EZLib!";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-04-26 19:24:25 +00:00
|
|
|
void ezl_info() { // Info about EZLib
|
2021-04-26 19:05:40 +00:00
|
|
|
cout << "EZLib v1.0.0"; // NL is disabled by default
|
|
|
|
}
|
|
|
|
|
2021-04-26 19:24:25 +00:00
|
|
|
void ezl_ver(int nl) { // Redirected to ezl_info()
|
2021-04-26 19:05:40 +00:00
|
|
|
ezl_info();
|
2021-04-26 16:48:45 +00:00
|
|
|
}
|
|
|
|
|
2021-04-26 19:24:25 +00:00
|
|
|
void ezl_time(int nl) { // Prints the UNIX Timestamp
|
2021-04-26 16:48:45 +00:00
|
|
|
const auto p1 = std::chrono::system_clock::now();
|
|
|
|
if (nl == 1) {
|
|
|
|
cout << chrono::duration_cast<std::chrono::seconds>(
|
|
|
|
p1.time_since_epoch()).count() << "\n";
|
|
|
|
} else {
|
|
|
|
cout << chrono::duration_cast<std::chrono::seconds>(
|
|
|
|
p1.time_since_epoch()).count();
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
2021-04-26 19:24:25 +00:00
|
|
|
|
|
|
|
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();
|
|
|
|
}
|