๐Ÿ“Œ2์›” 3์ฃผ์ฐจ ํ”„๋กœ์ ํŠธ ์ง„ํ–‰์ƒํ™ฉ - minho0315/OpenCV GitHub Wiki

๐Ÿ—omr์นด๋“œ ์ถ”๊ฐ€

์ด 20์žฅ

1


๐Ÿ—xml ํŒŒ์ผ ์ถ”๊ฐ€

TinyXML

TinyXML ์€ C ++ ์–ธ์–ด๋ฅผ ์œ„ํ•œ ์ž‘๊ณ  ๋‹จ์ˆœํ•˜๋ฉฐ ์šด์˜ ์ฒด์ œ์— ๋…๋ฆฝ์ ์ธ XML ํŒŒ์„œ


TinyXML ๋‹ค์šด๋กœ๋“œ

2


์••์ถ• ํ’€๊ณ  ํ”„๋กœ์ ํŠธ์— ํŒŒ์ผ ๋„ฃ๊ธฐ

3

ํ”„๋กœ์ ํŠธ -> ์ถ”๊ฐ€ -> ๊ธฐ์กดํŒŒ์ผ ์ถ”๊ฐ€

4

์ฝ”๋“œ ์ถ”๊ฐ€

//xml ์„ ์–ธ
	TiXmlDocument doc;
	TiXmlDeclaration* pDec1 = new TiXmlDeclaration("1.0", "", "");
	doc.LinkEndChild(pDec1);

	//๋ฃจํŠธ ๋…ธ๋“œ ์ถ”๊ฐ€
	TiXmlElement* pRoot = new TiXmlElement("OMR");
	doc.LinkEndChild(pRoot);

	//์ฃผ์„ ๋ฌธ์žฅ ์ถ”๊ฐ€
	TiXmlComment* pComment = new TiXmlComment();
	pComment->SetValue("Directory name");
	pRoot->LinkEndChild(pComment);


	const char* dNP = directoryName.c_str();
	// ํ•˜์œ„๋…ธ๋“œ ๋ฐ ๋ฐ์ดํ„ฐ ์ถ”๊ฐ€
	TiXmlElement* pElem = new TiXmlElement(dNP);
	pRoot->LinkEndChild(pElem);

	TiXmlElement* pSubElem;
	for (iter = Total.begin(); iter != Total.end(); iter++)
	{
		pSubElem = new TiXmlElement("student");
		pElem->LinkEndChild(pSubElem);
		pSubElem->SetAttribute("studentID", iter->first);
		pSubElem->SetAttribute("score", iter->second);
	}

	doc.SaveFile("resultList.xml");

๊ฒฐ๊ณผ

5


๐Ÿ—๊ด€๋ฆฌ์ž๋ชจ๋“œ ์„ค์ •

๊ด€๋ฆฌ์ž๋ชจ๋“œ๋กœ ๋“ค์–ด๊ฐ€๋ฉด ๋ฌธ์ œ์˜ ๋‹ต, ๋””๋ ‰ํ† ๋ฆฌ ์„ ํƒ

1


์‚ฌ์šฉ์ž๋ชจ๋“œ๋กœ ๋“ค์–ด๊ฐ€๋ฉด ๊ด€๋ฆฌ์ž๋ชจ๋“œ์—์„œ ์„ ํƒํ•œ ๊ฐ’ ์ ์šฉ
default๊ฐ’์œผ๋กœ ๋””๋ ‰ํ† ๋ฆฌ omr5 ์„ค์ •

2


์˜ˆ์™ธ์ฒ˜๋ฆฌ

์ž…๋ ฅ๊ฐ’ ์ œํ•œ

3


์ •๋‹ต๊ฐ’ 1~5 ์‚ฌ์ด๋กœ ์ œํ•œ

4


๋””๋ ‰ํ† ๋ฆฌ ์ œํ•œ

5


๐Ÿ—์ถœ์ฒ˜

https://m.blog.naver.com/PostView.nhn?blogId=chansung0602&logNo=221014997196&proxyReferer=https:%2F%2Fwww.google.com%2F

https://sourceforge.net/projects/tinyxml/

https://en.wikipedia.org/wiki/TinyXML

โš ๏ธ **GitHub.com Fallback** โš ๏ธ