Last active
December 14, 2015 00:09
-
-
Save yanivmo/4996525 to your computer and use it in GitHub Desktop.
Parse a string of comma separated values using C++03 Standard Library only
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
std::set<std::string> CMService::getDirContents(const std::string& path) | |
{ | |
RepositoryService repository; | |
//RepositoryService::getDirContents returns CSVs in a string | |
std::stringstream contentsCsv(repository.getDirContents(path)); | |
std::string entry; | |
std::set<std::string> entries; | |
while (std::getline(contentsCsv, entry, ',')) { | |
entries.insert(entry); | |
} | |
return entries; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment