aboutsummaryrefslogtreecommitdiff
path: root/oop2w1/ProcessFile.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'oop2w1/ProcessFile.cpp')
-rw-r--r--oop2w1/ProcessFile.cpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/oop2w1/ProcessFile.cpp b/oop2w1/ProcessFile.cpp
new file mode 100644
index 0000000..7f3629f
--- /dev/null
+++ b/oop2w1/ProcessFile.cpp
@@ -0,0 +1,36 @@
+#include "ProcessFile.h"
+
+ProcessFile::ProcessFile() { }
+ProcessFile::~ProcessFile() { }
+
+void ProcessFile::process(std::ifstream &file) {
+ uint32_t grootte = 0;
+ file.read((char*) &grootte, sizeof(uint32_t));
+ for (unsigned int i = 0; i < grootte; i++) {
+ enum GETAL type;
+ file.read((char*) &type, sizeof(enum GETAL));
+
+ switch(type) {
+ case LONG: {
+ read_and_print<int32_t>(file);
+ break;
+ }
+ case SHORT: {
+ read_and_print<int16_t>(file);
+ break;
+ }
+ case DOUBLE: {
+ read_and_print<double>(file);
+ break;
+ }
+ case FLOAT: {
+ read_and_print<float >(file);
+ break;
+ }
+ default: {
+ break;
+ }
+ }
+ }
+}
+