Skip to content

imagine243/CsvParser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

CsvParser

Csv file parser

it use for cocos2dx 2.2.3.

parser a csv file to a lot maps.

###usage

CsvParser * textParser = CsvParser::create("resources/config/tag_text.csv");
CsvParser * soundParser = CsvParser::create("resources/config/tag_sound.csv");


int textSize =  textParser->size();
for (int i = 0; i < textSize; i++)
{
	TextConfig * textConfig = TextConfig::create();
	std::map<std::string, std::string> textMap = textParser->findOne(i);
	
	textConfig->setid(strToInt(textMap.at("ID")));

	int colorR = strToInt(textMap.at("ColorR"));
	int colorG = strToInt(textMap.at("ColorG"));
	int colorB = strToInt(textMap.at("ColorB"));

	textConfig->setbColor(ccc3(colorR,colorG,colorB));

	textConfigArray->addObject(textConfig);
}

About

Csv file parser

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages