#ifndef IO_H
#define IO_H

#define VERSION_IO "1.2 (06.07.2017)"

// includes
#include <iostream>
#include <fstream>
#include <string>

// save integer, double, character and string to filestream
void saveInt(std::ofstream &ofs, const int &i);
void saveDouble(std::ofstream& ofs, const double& d);
void saveChar(std::ofstream &ofs, const char &c);
void saveString(std::ofstream &ofs, const std::string &s);

// read integer, character and string from filestream
int			readInt(std::ifstream &ifs);
double		readDouble(std::ifstream& ifs);
char		readChar(std::ifstream &ifs);
std::string	readString(std::ifstream &ifs);

// save/read endian integer to/from filestream (used to identify kind of system fileformat)
void saveEndian(std::ofstream &ofs);
void readEndian(std::ifstream &ifs);

// save/read system to/from filestream (used to identify kind of system)
void saveSystem(std::ofstream &ofs);
void readSystem(std::ifstream &ifs);

// save/read system to/from filestream (used to identify kind of system)
void saveVersion(std::ofstream &ofs, std::string version);
void readVersion(std::ifstream &ifs, std::string version);

// save/read system to/from filestream (used to identify kind of system)
void saveHeader(std::ofstream &ofs, std::string version);
void readHeader(std::ifstream &ifs, std::string version);



// save handle/value pair
void saveVariable(std::ofstream &ofs, const std::string &s, int i);
void saveVariable(std::ofstream &ofs, const std::string &s, long i);
void saveVariable(std::ofstream &ofs, const std::string &s, float i);
void saveVariable(std::ofstream &ofs, const std::string &s, double i);
void saveVariable(std::ofstream &ofs, const std::string &s, const std::string &i);


// save handle/value pair
void saveVariable(std::ofstream &ofs, const std::string &s, int i, std::string output);
void saveVariable(std::ofstream &ofs, const std::string &s, long i, std::string output);
void saveVariable(std::ofstream &ofs, const std::string &s, float i, std::string output);
void saveVariable(std::ofstream &ofs, const std::string &s, double i, std::string output);
void saveVariable(std::ofstream &ofs, const std::string &s, const std::string &i, std::string output);


#endif




