![]() |
Eclipse SUMO - Simulation of Urban MObility
|
modul for handling file buckets More...
#include <GNEApplicationWindowHelper.h>
Public Member Functions | |
| bool | checkFilename (const GNEAttributeCarrier *AC, const std::string &filename) const |
| check if the given filename can be assigned to the given AC | |
| FileBucketHandler (GNEApplicationWindow *applicationWindow, OptionsCont &neteditOptions, OptionsCont &sumoOptions) | |
| constructor | |
| std::string | getConfigDirectory () const |
| get current config directory (if we defined a netedit, sumo or netconvert config) | |
| std::string | getConfigFilePrefix (const std::string &sufix) const |
| get current config patter (if we defined a netedit, sumo or netconvert config) | |
| void | registerAC (const GNEAttributeCarrier *AC) |
| register AC | |
| void | unregisterAC (const GNEAttributeCarrier *AC) |
| delete AC | |
| FileBucket * | updateAC (const GNEAttributeCarrier *AC, const std::string &filename) |
| update filename vinculated with this AC | |
| void | updateOptions () |
| update options | |
| ~FileBucketHandler () | |
| destructor | |
| FileBucket * | getDefaultBucket (const FileBucket::Type type) const |
| functions related with buckets | |
| FileBucket * | getBucket (const FileBucket::Type type, const std::string &filename, const bool create) |
| get bucket | |
| const std::vector< FileBucket * > & | getFileBuckets (const FileBucket::Type type) const |
| get vector with all fileBuckets related with the given file type | |
| std::string | getDefaultFilename (const FileBucket::Type type) const |
| functions related with filenames | |
| std::string | getDefaultFolder (const FileBucket::Type type) const |
| get default folder associated with the given tipe | |
| void | setDefaultFilenameFile (const FileBucket::Type type, const std::string &filename) |
| brief set default additional file | |
| bool | isFilenameDefined (const FileBucket::Type type) const |
| check if at least we have an additional file defined | |
| void | resetDefaultFilenames () |
| brief set default files for all buckets | |
Private Member Functions | |
| FileBucketHandler (const FileBucketHandler &)=delete | |
| Invalidated copy constructor. | |
| std::string | getPrefix (FileBucket::Type type, const std::vector< std::string > invalidExtensions) const |
| get prefix of the given filename | |
| FileBucketHandler & | operator= (const FileBucketHandler &)=delete |
| Invalidated assignment operator. | |
| std::string | parseFilenames (const std::vector< FileBucket::Type > types) const |
| parse filenames | |
| void | removeEmptyBuckets () |
| removed empty buckets | |
Private Attributes | |
| GNEApplicationWindow * | myApplicationWindow = nullptr |
| pointer to application window | |
| std::map< FileBucket::Type, std::vector< FileBucket * > > | myBuckets |
| map with the buckets | |
| OptionsCont & | myNeteditOptions |
| reference to netedit options | |
| OptionsCont & | mySumoOptions |
| reference to sumo options | |
modul for handling file buckets
Definition at line 1174 of file GNEApplicationWindowHelper.h.
| GNEApplicationWindowHelper::FileBucketHandler::FileBucketHandler | ( | GNEApplicationWindow * | applicationWindow, |
| OptionsCont & | neteditOptions, | ||
| OptionsCont & | sumoOptions ) |
constructor
Definition at line 2386 of file GNEApplicationWindowHelper.cpp.
References myApplicationWindow, myBuckets, myNeteditOptions, mySumoOptions, FileBucket::prefixes, and FileBucket::types.
Referenced by FileBucketHandler(), and operator=().
| GNEApplicationWindowHelper::FileBucketHandler::~FileBucketHandler | ( | ) |
|
privatedelete |
Invalidated copy constructor.
References FileBucketHandler().
| bool GNEApplicationWindowHelper::FileBucketHandler::checkFilename | ( | const GNEAttributeCarrier * | AC, |
| const std::string & | filename ) const |
check if the given filename can be assigned to the given AC
Definition at line 2483 of file GNEApplicationWindowHelper.cpp.
References GNEAttributeCarrier::getTagProperty(), GNETagProperties::isFileCompatible(), myBuckets, GNETagProperties::saveInParentFile(), and FileBucket::types.
| FileBucket * GNEApplicationWindowHelper::FileBucketHandler::getBucket | ( | const FileBucket::Type | type, |
| const std::string & | filename, | ||
| const bool | create ) |
get bucket
Definition at line 2533 of file GNEApplicationWindowHelper.cpp.
References getDefaultBucket(), getDefaultFilename(), myBuckets, and setDefaultFilenameFile().
| std::string GNEApplicationWindowHelper::FileBucketHandler::getConfigDirectory | ( | ) | const |
get current config directory (if we defined a netedit, sumo or netconvert config)
Definition at line 2505 of file GNEApplicationWindowHelper.cpp.
References getDefaultFolder(), isFilenameDefined(), and FileBucket::prefixes.
| std::string GNEApplicationWindowHelper::FileBucketHandler::getConfigFilePrefix | ( | const std::string & | sufix | ) | const |
get current config patter (if we defined a netedit, sumo or netconvert config)
Definition at line 2516 of file GNEApplicationWindowHelper.cpp.
References getDefaultFilename(), isFilenameDefined(), and FileBucket::prefixes.
| FileBucket * GNEApplicationWindowHelper::FileBucketHandler::getDefaultBucket | ( | const FileBucket::Type | type | ) | const |
functions related with buckets
get default bucket
Definition at line 2527 of file GNEApplicationWindowHelper.cpp.
References myBuckets.
Referenced by getBucket(), and updateAC().
| std::string GNEApplicationWindowHelper::FileBucketHandler::getDefaultFilename | ( | const FileBucket::Type | type | ) | const |
functions related with filenames
get default filename associated with the given tipe
Definition at line 2567 of file GNEApplicationWindowHelper.cpp.
References myBuckets.
Referenced by getBucket(), getConfigFilePrefix(), getDefaultFolder(), and getPrefix().
| std::string GNEApplicationWindowHelper::FileBucketHandler::getDefaultFolder | ( | const FileBucket::Type | type | ) | const |
get default folder associated with the given tipe
Definition at line 2573 of file GNEApplicationWindowHelper.cpp.
References getDefaultFilename().
Referenced by getConfigDirectory().
| const std::vector< FileBucket * > & GNEApplicationWindowHelper::FileBucketHandler::getFileBuckets | ( | const FileBucket::Type | type | ) | const |
get vector with all fileBuckets related with the given file type
Definition at line 2561 of file GNEApplicationWindowHelper.cpp.
References myBuckets.
|
private |
get prefix of the given filename
Definition at line 2748 of file GNEApplicationWindowHelper.cpp.
References getDefaultFilename(), and StringUtils::replace().
Referenced by updateOptions().
| bool GNEApplicationWindowHelper::FileBucketHandler::isFilenameDefined | ( | const FileBucket::Type | type | ) | const |
check if at least we have an additional file defined
Definition at line 2601 of file GNEApplicationWindowHelper.cpp.
References myBuckets.
Referenced by getConfigDirectory(), and getConfigFilePrefix().
|
privatedelete |
Invalidated assignment operator.
References FileBucketHandler().
|
private |
parse filenames
Definition at line 2711 of file GNEApplicationWindowHelper.cpp.
References myBuckets.
Referenced by updateOptions().
| void GNEApplicationWindowHelper::FileBucketHandler::registerAC | ( | const GNEAttributeCarrier * | AC | ) |
register AC
Definition at line 2412 of file GNEApplicationWindowHelper.cpp.
References FileBucket::addElement(), GNEAttributeCarrier::getFileBucket(), GNEAttributeCarrier::getTagProperty(), and GNETagProperties::saveInParentFile().
|
private |
removed empty buckets
Definition at line 2730 of file GNEApplicationWindowHelper.cpp.
References myBuckets, and FileBucket::types.
| void GNEApplicationWindowHelper::FileBucketHandler::resetDefaultFilenames | ( | ) |
brief set default files for all buckets
Definition at line 2607 of file GNEApplicationWindowHelper.cpp.
References myBuckets, and updateOptions().
| void GNEApplicationWindowHelper::FileBucketHandler::setDefaultFilenameFile | ( | const FileBucket::Type | type, |
| const std::string & | filename ) |
brief set default additional file
Definition at line 2593 of file GNEApplicationWindowHelper.cpp.
References myBuckets, and updateOptions().
Referenced by getBucket().
| void GNEApplicationWindowHelper::FileBucketHandler::unregisterAC | ( | const GNEAttributeCarrier * | AC | ) |
delete AC
Definition at line 2422 of file GNEApplicationWindowHelper.cpp.
References GNEAttributeCarrier::getFileBucket(), GNEAttributeCarrier::getTagProperty(), FileBucket::removeElement(), and GNETagProperties::saveInParentFile().
| FileBucket * GNEApplicationWindowHelper::FileBucketHandler::updateAC | ( | const GNEAttributeCarrier * | AC, |
| const std::string & | filename ) |
update filename vinculated with this AC
Definition at line 2431 of file GNEApplicationWindowHelper.cpp.
References getDefaultBucket(), GNEAttributeCarrier::getFileBucket(), GNEAttributeCarrier::getID(), GNEAttributeCarrier::getTagProperty(), GNETagProperties::isFileCompatible(), GNETagProperties::isNetworkElement(), GNEAttributeCarrier::isTemplate(), myBuckets, FileBucket::NETWORK, FileBucket::removeElement(), GNETagProperties::saveInParentFile(), TLF, FileBucket::types, and updateOptions().
| void GNEApplicationWindowHelper::FileBucketHandler::updateOptions | ( | ) |
update options
Definition at line 2617 of file GNEApplicationWindowHelper.cpp.
References FileBucket::ADDITIONAL, FileBucket::DATA, FileBucket::DEMAND, FileBucket::EDGETYPE, getPrefix(), FileBucket::MEANDATA, myApplicationWindow, myBuckets, myNeteditOptions, mySumoOptions, FileBucket::NETCONVERT_CONFIG, FileBucket::NETCONVERT_PREFIX, FileBucket::NETEDIT_CONFIG, FileBucket::NETEDIT_PREFIX, FileBucket::NETWORK, parseFilenames(), FileBucket::SUMO_CONFIG, FileBucket::SUMO_PREFIX, and FileBucket::TLS.
Referenced by resetDefaultFilenames(), setDefaultFilenameFile(), and updateAC().
|
private |
pointer to application window
Definition at line 1249 of file GNEApplicationWindowHelper.h.
Referenced by FileBucketHandler(), and updateOptions().
|
private |
map with the buckets
Definition at line 1258 of file GNEApplicationWindowHelper.h.
Referenced by checkFilename(), FileBucketHandler(), getBucket(), getDefaultBucket(), getDefaultFilename(), getFileBuckets(), isFilenameDefined(), parseFilenames(), removeEmptyBuckets(), resetDefaultFilenames(), setDefaultFilenameFile(), updateAC(), updateOptions(), and ~FileBucketHandler().
|
private |
reference to netedit options
Definition at line 1252 of file GNEApplicationWindowHelper.h.
Referenced by FileBucketHandler(), and updateOptions().
|
private |
reference to sumo options
Definition at line 1255 of file GNEApplicationWindowHelper.h.
Referenced by FileBucketHandler(), and updateOptions().