DiaDes  0.1
DIAgnosis of Discrete-Event System
Public Member Functions | Private Attributes | List of all members
Diades::CmdInterface::FileSuffixes Class Reference

#include <CmdInterface.hh>

Public Member Functions

 FileSuffixes (const std::vector< std::string > &suffixes)
 
bool match (const std::string &fileName, const std::string &suffix) const
 

Private Attributes

const string _fileBase = "[a-zA-Z_][a-zA-Z_0-9]*\\."
 
std::unordered_map< std::string, std::regex > _suffixes
 

Detailed Description

Gather the set of file suffixes to handle in a program and perform suffix matching. (use of std::regex)

Todo:
fix the problem of file with multiple dots like ../../toto.ddaut

Definition at line 49 of file CmdInterface.hh.

Constructor & Destructor Documentation

◆ FileSuffixes()

Diades::CmdInterface::FileSuffixes::FileSuffixes ( const std::vector< std::string > &  suffixes)
Parameters
suffixesthe set of file suffixes to handle

Definition at line 37 of file CmdInterface.cc.

References _fileBase, and _suffixes.

Member Function Documentation

◆ match()

bool Diades::CmdInterface::FileSuffixes::match ( const std::string &  fileName,
const std::string &  suffix 
) const
Parameters
fileNamethe name of a file
suffixa suffix to test
Returns
true if the fileName has the tested suffix, return false if not OR if the suffix is not managed in fileSuffixes

Definition at line 54 of file CmdInterface.cc.

References _suffixes.

Referenced by completeFsm(), determineFsm(), explainFsm(), exportToDot(), exportTsToDdAut(), insertFsms(), minimizeFsm(), projectFsm(), runFsm(), synchroniseFsm(), tagDdAutStates(), trimDdAutStates(), Diades::CmdInterface::writeAut(), Diades::CmdInterface::writeFiniteAutomaton(), and Diades::CmdInterface::writeFiniteStateMachine().

Member Data Documentation

◆ _fileBase

const string Diades::CmdInterface::FileSuffixes::_fileBase = "[a-zA-Z_][a-zA-Z_0-9]*\\."
private

Definition at line 52 of file CmdInterface.hh.

Referenced by FileSuffixes().

◆ _suffixes

std::unordered_map<std::string, std::regex> Diades::CmdInterface::FileSuffixes::_suffixes
private

Definition at line 53 of file CmdInterface.hh.

Referenced by FileSuffixes(), and match().


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