From d2cfd3eeeb8b6af3b7ccda01e6c1ac581a2df398 Mon Sep 17 00:00:00 2001
From: Joel Grunbaum <joelgrun@gmail.com>
Date: Thu, 13 Jan 2022 06:54:09 +0000
Subject: [PATCH] Added time parsing

---
 bom.cpp |   26 ++++++++++++++------------
 1 files changed, 14 insertions(+), 12 deletions(-)

diff --git a/bom.cpp b/bom.cpp
index 5642cfc..64058ba 100644
--- a/bom.cpp
+++ b/bom.cpp
@@ -35,21 +35,23 @@
 	std::ifstream fs("bom_data.xml");
 	std::vector<char> buffer{std::istreambuf_iterator<char>(fs),
 	                         istreambuf_iterator<char>()};
-    buffer.push_back('\0');
+	buffer.push_back('\0');
 	rapidxml::xml_document<> d;
 	d.parse<0>(&buffer[0]);
-    // Walk stations
+	// Walk stations
 	for (rapidxml::xml_node<>* n = d.first_node()->last_node()->first_node(); n;
 	     n = n->next_sibling()) {
-        int bom_id = std::stoi(n->first_attribute()->next_attribute()->value());
-        for (auto &i : bs) {
-            if (i.second.stationId == bom_id) {
-                // Should be apparent temp
-                i.second.bomPrice = std::stod(n->first_node()->first_node()->first_node()->first_node()->value());
-                std::cout << i.second.product << ", " << i.second.stationId << ", " << i.second.bomPrice << std::endl;
-                break;
-            }
-        }
-    }
+		int bom_id = std::stoi(n->first_attribute()->next_attribute()->value());
+		for (auto& i : bs) {
+			if (i.second.stationId == bom_id) {
+				// Should be apparent temp
+				i.second.bomPrice = std::stod(n->first_node()
+				                                  ->first_node()
+				                                  ->first_node()
+				                                  ->first_node()
+				                                  ->value());
+			}
+		}
+	}
 }
 } // namespace bom

--
Gitblit v1.9.3