Revision ee0dd796 custompackages/graph-parser/src/parser.cpp

View differences:

custompackages/graph-parser/src/parser.cpp
48 48
    typedef std::map<std::string, Vertex> NameVertexMap;
49 49
    NameVertexMap routers;
50 50

  
51
    ifstream inFile(filePath);
51
    ifstream inFile(filePath.c_str());
52 52

  
53 53
    vector<string> strs;
54 54
    for (string line; getline(inFile, line); /**/) {
......
60 60
        if (strs.size() == 3) {
61 61
            string source = strs[0];
62 62
            string target = strs[1];
63
            double cost = stof(strs[2]);
63
            // TODO: use atof as a way around the error: ‘stof’ was not declared in this scope
64
            // double cost = stof(strs[2]);
65
            double cost = atof(strs[2].c_str());
64 66

  
65 67
            addLinkToGraph(source, target, cost, g, routers);
66 68

  

Also available in: Unified diff