Nemiver  0.3
Public Member Functions | Protected Attributes | List of all members
nemiver::common::ReadLine Class Reference

#include <nmv-asm-utils.h>

Public Member Functions

 ReadLine (Gtk::Window &a_parent, const std::list< UString > &where_to_look, list< UString > &session_dirs, map< UString, bool > &ignore_paths, FindFileAndReadLine read_line_func)
 
bool operator() (const UString &a_file_path, int a_line_number, std::string &a_line)
 

Protected Attributes

Gtk::Window & m_parent
 
const std::list< UString > & m_where_to_look
 
list< UString > & m_session_dirs
 
map< UString, bool > & m_ignore_paths
 
FindFileAndReadLine read_line
 

Detailed Description

This is a wrapper type around (a functor) for the call to ui_utils::find_file_and_read_line.

The function call operator of this functor read the line N of a given file F. The functor has context to know where to look for the file F; otherwise it can ask the user (interactively) for help.

Constructor & Destructor Documentation

◆ ReadLine()

nemiver::common::ReadLine::ReadLine ( Gtk::Window &  a_parent,
const std::list< UString > &  where_to_look,
list< UString > &  session_dirs,
map< UString, bool > &  ignore_paths,
FindFileAndReadLine  read_line_func 
)
inline

Constructor for the ReadLine functor.

Parameters
a_parentthe parent window used by the dialog used by the functor to interact with the user, should the need arise.
where_to_looka list of directories where to look for the file the function call operators of the functor might be interested in.
session_dirsif the file is found in a directory D, that D is put in this list.
ignore_pathif the file is not found but is part of this map, do not ask the user for help in finding it.
read_line_functhe function to use to do the actual job of finding the file.

Member Function Documentation

◆ operator()()

bool nemiver::common::ReadLine::operator() ( const UString a_file_path,
int  a_line_number,
std::string &  a_line 
)
inline

The function-call operator of the functor.

Parameters
a_file_paththe file to look for.
a_line_numberthe number of the line of a_file_path to read.
a_linethe resulting line read.
Returns
true iff a line was read.

Member Data Documentation

◆ m_ignore_paths

map<UString, bool>& nemiver::common::ReadLine::m_ignore_paths
protected

◆ m_parent

Gtk::Window& nemiver::common::ReadLine::m_parent
protected

◆ m_session_dirs

list<UString>& nemiver::common::ReadLine::m_session_dirs
protected

◆ m_where_to_look

const std::list<UString>& nemiver::common::ReadLine::m_where_to_look
protected

◆ read_line

FindFileAndReadLine nemiver::common::ReadLine::read_line
protected

The documentation for this class was generated from the following file: