Ejemplo n.º 1
0
std::string CSyscallException::to_string() const
{
    std::stringstream ss;
    ss << "syscall_exception://"
       << get_errcode() << ":"
       << get_errmessage() << "@"
       << get_linenumber() << ":"
       << get_filename();

    return ss.str();
}
Ejemplo n.º 2
0
 
///get the Number of Lines of the map.txt
const int get_linenumber(std::ifstream& datei){
    int i = 0;
    std::string line;
    while(!datei.eof() && std::getline(datei, line)){
        i++;
    }
    return i;
}
  
///open the file for the get_linenumber function (you must open it a second time, since it gets used in the function)
std::ifstream map("magnetmapraw.txt");

///needs to be global, because we need the line number in most of the functions
const int t = get_linenumber(map);          
  
  
///parsing the file to a 2-dimension-float-Array: [ lines (dyn) ][ Position + Sensor-data (normalized) (13) ]
void get_map_data(){
    std::ifstream map("magnetmapraw.txt");
  
    ///allocate memory for the 2-dimensional-Array
    map_arr = new float*[t];
    for (int i = 0; i < t; ++i) {
        map_arr[i] = new float[13];
    }
  
    std::string line;
  
    int count = 0;