#include "stdafx.h" #include #include #include #include using namespace System; using namespace std; void loadConfiguration(string fileName, string *content_indices[255], string *content_values[255]) { // Read configurations. ifstream file(fileName.c_str()); string line; string name; string value; string inSection; //std::string content_indices[255]; //std::string content_values[255]; int posEqual; int i; while (getline(file, line)) { if ( !line.length() ) continue; if ( line[0] == '#' ) continue; if ( line[0] == ';' ) continue; if ( line[0] == '[' ) { //inSection = trim(line.substr(1, line.find(']')-1)); continue; posEqual = line.find('='); /*name = trim(line.substr(0, posEqual)); value = trim(line.substr(posEqual+1));*/ *content_indices[i] = inSection+"/"+name; *content_values[i++] = value; } } } int main(array ^args) { string *indices[255]; string *values[255]; loadConfiguration("config.ini", indices, values); std::cout << indices; return 0; }