Ejemplo n.º 1
0
void Kit::ingestCsvInput(std::vector<std::vector<std::string>> csvFieldList)
{
	std::vector<std::string> csvField;
	std::string firstField;
	std::string quantity;
	std::string partNumber;
	std::string description;
	int line;

	for (int i = 0; i < csvFieldList.size(); i++)
	{

		line = i;
		csvField = csvFieldList[i];

		if (line == 0)
		{
			firstField = csvField[0];
			setKitName(firstField);
		}

		//checks if field is size 3 and if not header
		if (csvField.size() >= 3 && csvField[0] != "Qty")
		{
			quantity = csvField[0];
			partNumber = csvField[1];
			description = csvField[2];
			setQuantity(quantity);
			setPartNumber(partNumber);
			setDescription(description);
			setAttributes(getQuantity(), getDescription());
			addParts();
		}
	}
}//end ingestCsvInput()
Ejemplo n.º 2
0
Head::Head()
{
	addParts();
}