cameradar_standalone/src/configuration.cpp
std::pair<bool, std::string>
read_file(const std::string& path) {
    auto line = std::string{};
    auto content = std::string{};
    auto file = std::ifstream{ path };

    if (file.is_open()) {
        while (getline(file, line)) { content += line + "\n"; }
        file.close();
    } else {
        return std::make_pair(false, std::string{});
    }

    return std::make_pair(true, content);
}
// Read a file at the path "path"
// If the file is available we return the whole content as
// an std::string inside a pair
// otherwise return false and an empty string inside a pair
Read a file at the path "path"
If the file is available we return the whole content as
an std::string inside a pair
otherwise return false and an empty string inside a pair
Read a file at the path " path " If the file is available we return the whole content as an std :: string inside a pair otherwise return false and an empty string inside a pair
std::pair<bool, std::string>
read_file(const std::string& path) {
    auto line = std::string{};
    auto content = std::string{};
    auto file = std::ifstream{ path };
    if (file.is_open()) {
        while (getline(file, line)) { content += line + "\n"; }
        file.close();
    } else {
        return std::make_pair(false, std::string{});
    }
    return std::make_pair(true, content);
}
std :: pair < bool , std :: string > read_file ( const std :: string & path ) { auto line = std :: string { } ; auto content = std :: string { } ; auto file = std :: ifstream { path } ; if ( file . is_open ( ) ) { while ( getline ( file , line ) ) { content += line + " \n " ; } file . close ( ) ; } else { return std :: make_pair ( false , std :: string { } ) ; } return std :: make_pair ( true , content ) ; }
Read a file at the path "path"
If the file is available we return the whole content as
an std::string inside a pair
otherwise return false and an empty string inside a pair
Read a file at the path " path " If the file is available we return the whole content as an std :: string inside a pair otherwise return false and an empty string inside a pair