#pragma once
#include <string>
#include <sstream>
#include <vector>

#define CivItem std::vector<std::string>
#define Civitems std::vector<CivItem>

/**
   inp文件对象模型
*/
class CivInp
{
public:
	/**
	*@brief 保存inp文件
	*@fileName: 文件名
	*/
	bool writeToFile(const char* fileName);

	void writeTitles();
	void writeJunctions(Civitems items);
	void writePipes(Civitems items);
	void writeTanks(Civitems items);
	void writeReservoirs(Civitems items);
	void writePumps(Civitems items);
	void writeValves(Civitems items);

	void writeCoordinates(Civitems items);
	void writeLabels(Civitems items);
	void writeVertices(Civitems items);

	void writeBackdrop(Civitems items);
	void writeEnd();
	void writeString(const std::string& s);
	void writeItems(const Civitems& items);
	void writeOptions(const Civitems& items);
	void writePatterns(Civitems items);
	void writeDemand(Civitems items);
	std::string currentTime();
private:
	std::ostringstream mTextStream;
};
