ROSE  0.11.102.0
Classes | Public Types | Public Member Functions | Protected Member Functions | List of all members
Rose::BinaryAnalysis::ModelChecker::SourceLister Class Reference

Description

Lists parts of source files.

A source lister lists parts of source files and caches the results.

Definition at line 19 of file SourceLister.h.

#include <Rose/BinaryAnalysis/ModelChecker/SourceLister.h>

Classes

struct  Settings
 

Public Types

using Ptr = SourceListerPtr
 

Public Member Functions

void appendDirectory (const boost::filesystem::path &)
 Add a search directory. More...
 
bool list (std::ostream &, const SourceLocation &, const std::string &prefix)
 List some lines of source code. More...
 
boost::format currentLineFormat () const
 Property: Format string for current line. More...
 
void currentLineFormat (const boost::format &)
 Property: Format string for current line. More...
 
boost::format contextLineFormat () const
 Property: Format context lines. More...
 
void contextLineFormat (const boost::format &)
 Property: Format context lines. More...
 
size_t leadingContext () const
 Property: Number of leading context lines. More...
 
void leadingContext (size_t)
 Property: Number of leading context lines. More...
 
size_t trailingContext () const
 Property: Number of trailing context lines. More...
 
void trailingContext (size_t)
 Property: Number of trailing context lines. More...
 
std::vector< boost::filesystem::path > directories () const
 Property: Search directories. More...
 
void directories (const std::vector< boost::filesystem::path > &)
 Property: Search directories. More...
 

Static Public Member Functions

static Ptr instance ()
 Allocating constructor. More...
 
static Ptr instance (const Settings &)
 Allocating constructor. More...
 

Protected Member Functions

 SourceLister (const Settings &)
 

Member Function Documentation

static Ptr Rose::BinaryAnalysis::ModelChecker::SourceLister::instance ( )
static

Allocating constructor.

Initial settings can be specified with an argument, or the settings can be changed after construction through the various properties.

Thread safety: This constructor is thread safe.

static Ptr Rose::BinaryAnalysis::ModelChecker::SourceLister::instance ( const Settings )
static

Allocating constructor.

Initial settings can be specified with an argument, or the settings can be changed after construction through the various properties.

Thread safety: This constructor is thread safe.

boost::format Rose::BinaryAnalysis::ModelChecker::SourceLister::currentLineFormat ( ) const

Property: Format string for current line.

This property is a boost::format string for the current line. It should expect two arguments: a size_t line number and the line content as an std::string.

Thread safety: This method is thread safe.

void Rose::BinaryAnalysis::ModelChecker::SourceLister::currentLineFormat ( const boost::format &  )

Property: Format string for current line.

This property is a boost::format string for the current line. It should expect two arguments: a size_t line number and the line content as an std::string.

Thread safety: This method is thread safe.

boost::format Rose::BinaryAnalysis::ModelChecker::SourceLister::contextLineFormat ( ) const

Property: Format context lines.

This property is a boost::format string for the lines that appear before and after the current line. It should expect two arguments: a size_t line number and the std::string line content.

Thread safety: This method is thread safe.

void Rose::BinaryAnalysis::ModelChecker::SourceLister::contextLineFormat ( const boost::format &  )

Property: Format context lines.

This property is a boost::format string for the lines that appear before and after the current line. It should expect two arguments: a size_t line number and the std::string line content.

Thread safety: This method is thread safe.

size_t Rose::BinaryAnalysis::ModelChecker::SourceLister::leadingContext ( ) const

Property: Number of leading context lines.

This is the number of lines that will be printed before the specified line. It is not an error if the leading context lines don't exist.

Thread safety: This method is thread safe.

void Rose::BinaryAnalysis::ModelChecker::SourceLister::leadingContext ( size_t  )

Property: Number of leading context lines.

This is the number of lines that will be printed before the specified line. It is not an error if the leading context lines don't exist.

Thread safety: This method is thread safe.

size_t Rose::BinaryAnalysis::ModelChecker::SourceLister::trailingContext ( ) const

Property: Number of trailing context lines.

This is the number of lines that will be printed after the specified line. It is not an error if the trailing context lines don't exist.

Thread safety: This method is thread safe.

void Rose::BinaryAnalysis::ModelChecker::SourceLister::trailingContext ( size_t  )

Property: Number of trailing context lines.

This is the number of lines that will be printed after the specified line. It is not an error if the trailing context lines don't exist.

Thread safety: This method is thread safe.

std::vector<boost::filesystem::path> Rose::BinaryAnalysis::ModelChecker::SourceLister::directories ( ) const

Property: Search directories.

This property is a vector of directory names that will be searched in the order specified.

Thread safety: This method is thread safe. See also appendDirectory for a more efficient way to change this property.

void Rose::BinaryAnalysis::ModelChecker::SourceLister::directories ( const std::vector< boost::filesystem::path > &  )

Property: Search directories.

This property is a vector of directory names that will be searched in the order specified.

Thread safety: This method is thread safe. See also appendDirectory for a more efficient way to change this property.

void Rose::BinaryAnalysis::ModelChecker::SourceLister::appendDirectory ( const boost::filesystem::path &  )

Add a search directory.

Adds the specified directory to the end of the search path. This is faster than obtaining a copy of the property's value, appending the directory, and then saving the property. Also, it's an atomic operation.

Thread safety: This method is thread safe.

bool Rose::BinaryAnalysis::ModelChecker::SourceLister::list ( std::ostream &  ,
const SourceLocation ,
const std::string &  prefix 
)

List some lines of source code.

Tries to find the specified source location and then lists it. Returns true if lines were listed, or false if not listed. Failures are due to files not being found and/or the file not containing the the requested line number. The results are cached.

Thread safety: This method is thread safe.


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