#include #include "datatypes.h" #include "logger.h" SSMD::Logger logger; int main() { SSMD::Lines lines; std::string data( "172.16.47.10,gts_community_r,gts_community_w,10,1,001CC0B16177,64,128,64,128\n" "172.16.47.11,gts_community_r,gts_community_w,10,1,001CC0B16178,65,129,66,138\n" "172.16.47.10,gts_community_r,gts_community_w,16,1,001CC0B16179,66,130,68,148\n" "172.16.47.10,gts_community_r,gts_community_w,16,8,001CC0B16180,67,131,70,158\n" ); std::cout << data << std::endl; if (!parseData(data, lines)) { logger << "Failed to parse data" << std::endl; } else { SSMD::Lines::const_iterator it; for (it = lines.begin(); it != lines.end(); ++it) { logger << "line: " << it->switchIP << "," << it->readCommunity << "," << it->writeCommunity << "," << it->uplinkPort << "," << it->userPort << "," << it->mac << "," << it->upShape << "," << it->downShape << "," << it->upBurst << "," << it->downBurst << std::endl; } } return 0; }