Program Listing for File EdgeListReader.hpp

Return to documentation for file (include/networkit/io/EdgeListReader.hpp)

/*
 * EdgeListReader.hpp
 *
 *  Created on: 18.06.2013
 *      Author: cls
 */

#ifndef NETWORKIT_IO_EDGE_LIST_READER_HPP_
#define NETWORKIT_IO_EDGE_LIST_READER_HPP_

#include <map>
#include <string>

#include <networkit/io/GraphReader.hpp>

namespace NetworKit {

class EdgeListReader final : public GraphReader {

public:
    EdgeListReader() = default; // nullary constructor for Python shell

    EdgeListReader(char separator, node firstNode, std::string_view commentPrefix = "#",
                   bool continuous = true, bool directed = false);

    Graph read(std::string_view path) override;

    const std::map<std::string, node> &getNodeMap() const;

private:
    char separator;
    std::string commentPrefix;
    node firstNode;
    bool continuous;
    std::map<std::string, node> mapNodeIds;
    bool directed;
};

} /* namespace NetworKit */
#endif // NETWORKIT_IO_EDGE_LIST_READER_HPP_