diff options
author | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 16:51:28 +0200 |
---|---|---|
committer | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 16:51:28 +0200 |
commit | 8f27768c1c35f09152b35caeab20e705086fd03f (patch) | |
tree | 1b1c8fa36bb2b7fc60e2be551a454de239bb5c7f /library/globalFunctions.cpp | |
parent | 1.7 (diff) | |
download | FreeFileSync-8f27768c1c35f09152b35caeab20e705086fd03f.tar.gz FreeFileSync-8f27768c1c35f09152b35caeab20e705086fd03f.tar.bz2 FreeFileSync-8f27768c1c35f09152b35caeab20e705086fd03f.zip |
1.8
Diffstat (limited to 'library/globalFunctions.cpp')
-rw-r--r-- | library/globalFunctions.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/library/globalFunctions.cpp b/library/globalFunctions.cpp index 5afb1650..d4579312 100644 --- a/library/globalFunctions.cpp +++ b/library/globalFunctions.cpp @@ -92,3 +92,35 @@ wxString& globalFunctions::includeNumberSeparator(wxString& number) number.insert(i, GlobalResources::thousandsSeparator); return number; } + + +int globalFunctions::readInt(ifstream& stream) +{ + int result = 0; + char* buffer = reinterpret_cast<char*>(&result); + stream.read(buffer, sizeof(int)); + return result; +} + + +void globalFunctions::writeInt(ofstream& stream, const int number) +{ + const char* buffer = reinterpret_cast<const char*>(&number); + stream.write(buffer, sizeof(int)); +} + + +int globalFunctions::readInt(wxInputStream& stream) +{ + int result = 0; + char* buffer = reinterpret_cast<char*>(&result); + stream.Read(buffer, sizeof(int)); + return result; +} + + +void globalFunctions::writeInt(wxOutputStream& stream, const int number) +{ + const char* buffer = reinterpret_cast<const char*>(&number); + stream.Write(buffer, sizeof(int)); +} |