OpenASIP  2.0
Static Public Member Functions | List of all members
SetHistoryFilename Class Reference
Collaboration diagram for SetHistoryFilename:
Collaboration graph

Static Public Member Functions

static bool execute (SimulatorInterpreter &interpreter, SimulatorFrontend &, const std::string &newValue)
 
static const DataObjectdefaultValue ()
 
static bool warnOnExistingProgramAndMachine ()
 

Detailed Description

Setting action that sets the command history file name.

Definition at line 442 of file SettingCommand.cc.

Member Function Documentation

◆ defaultValue()

static const DataObject& SetHistoryFilename::defaultValue ( )
inlinestatic

Returns the default value of this setting.

Returns
The default value.

Definition at line 472 of file SettingCommand.cc.

472  {
473  static const DataObject defaultValue_(SIM_DEFAULT_COMMAND_LOG);
474  return defaultValue_;
475  }

References SIM_DEFAULT_COMMAND_LOG.

◆ execute()

static bool SetHistoryFilename::execute ( SimulatorInterpreter interpreter,
SimulatorFrontend ,
const std::string &  newValue 
)
inlinestatic

Sets the command history file name.

Parameters
interpreterTo set the history file name for.
newValueValue to set.
Returns
True if setting was successful.

Definition at line 452 of file SettingCommand.cc.

455  {
456  if (!(FileSystem::fileIsCreatable(newValue) ||
457  FileSystem::fileIsWritable(newValue)) ||
458  FileSystem::fileIsDirectory(newValue)) {
459  interpreter.lineReader()->outputStream()
460  << "Could not open file for writing." << std::endl;
461  return false;
462  }
463  interpreter.lineReader()->setInputHistoryLog(newValue);
464  return true;
465  }

References FileSystem::fileIsCreatable(), FileSystem::fileIsDirectory(), FileSystem::fileIsWritable(), ScriptInterpreter::lineReader(), LineReader::outputStream(), and LineReader::setInputHistoryLog().

Here is the call graph for this function:

◆ warnOnExistingProgramAndMachine()

static bool SetHistoryFilename::warnOnExistingProgramAndMachine ( )
inlinestatic

Should the action warn if program & machine exist and value was changed

Returns
boolean value on whether or not to warn

Definition at line 482 of file SettingCommand.cc.

482  {
483  return false;
484  }

The documentation for this class was generated from the following file:
DataObject
Definition: DataObject.hh:50
LineReader::setInputHistoryLog
virtual void setInputHistoryLog(const std::string &historyFilename)
Definition: LineReader.cc:124
FileSystem::fileIsCreatable
static bool fileIsCreatable(const std::string fileName)
Definition: FileSystem.cc:123
FileSystem::fileIsDirectory
static bool fileIsDirectory(const std::string fileName)
FileSystem::fileIsWritable
static bool fileIsWritable(const std::string fileName)
LineReader::outputStream
virtual std::ostream & outputStream()
Definition: LineReader.cc:102
SIM_DEFAULT_COMMAND_LOG
#define SIM_DEFAULT_COMMAND_LOG
The default command log file name.
Definition: SimulatorConstants.hh:51
ScriptInterpreter::lineReader
virtual LineReader * lineReader() const
Definition: ScriptInterpreter.cc:367