#include <xtd/xtd>
using namespace std;
class program {
inline static const ustring file_name =
"app_settings.dat";
public:
static auto main() {
write_default_values();
display_values();
}
static void write_default_values() {
using_(fstream fs =
file::open(file_name, ios::out | ios::binary | ios::trunc)) {
writer << 1.250F;
writer << R"(c:\Temp)";
writer << 10;
writer << true;
}
}
static void display_values() {
float aspect1, aspect2;
int auto_save_time;
bool show_status_bar;
reader >> aspect1;
reader >> temp_directory;
reader >> aspect2;
reader >> auto_save_time;
reader >> show_status_bar;
}
if(aspect1 != aspect2)
else
}
}
};
static void write_line()
Writes the current line terminator to the standard output stream using the specified format informati...
Reads primitive data types as binary values in a specific encoding.
Definition binary_reader.hpp:41
void push(std::streampos pos=0)
Push the current position.
void rewind()
Rewind stream.
std::streampos pop()
Pop the current top position.
std::streampos tellg()
Tell the current seek position of the readers stream;.
Writes primitive types in binary to a stream and supports writing strings.
Definition binary_writer.hpp:45
static std::fstream open(const xtd::string &path, std::ios::openmode mode)
Opens a FileStream on the specified path.
static bool exists(const xtd::string &path) noexcept
Determines whether the specified file exists.
#define startup_(main_method)
Defines the entry point to be called when the application loads. Generally this is set either to the ...
Definition startup.hpp:167
#define using_(...)
The specified expression is cleared automatically when the scope is ended.
Definition using.hpp:33
xtd::string ustring
Represents text as a sequence of UTF-8 code units.
Definition string.hpp:33
The xtd::io namespace contains types that allow reading and writing to files and data streams,...
Definition binary_reader.hpp:17
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8